* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --radius: 14px;
    --radius-sm: 10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 640px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px 20px 24px;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.title {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
}

.icon-btn:hover,
.icon-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

/* ===== Progress ===== */
.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: white;
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
    min-width: 50px;
    text-align: right;
}

/* ===== Stats Card ===== */
.stats-card {
    background: var(--card);
    margin: -12px 16px 12px;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 10;
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}

.stat-item.done .stat-value {
    color: var(--success);
}

.stat-item.remaining .stat-value {
    color: var(--warning);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.reset-btn {
    background: var(--bg);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover,
.reset-btn:active {
    background: #fee2e2;
    transform: scale(0.95);
}

/* ===== Category Tabs ===== */
.category-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    flex-shrink: 0;
    padding: 8px 16px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== Checklist ===== */
.checklist-container {
    padding: 0 16px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-hint {
    font-size: 13px;
    color: var(--text-secondary);
}

.checklist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 100px;
}

.checklist-item {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.checklist-item:active {
    transform: scale(0.98);
}

.checklist-item.done {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.checklist-item.done .item-name {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.checkbox {
    width: 28px;
    height: 28px;
    border: 2.5px solid #d1d5db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s;
    background: white;
}

.checklist-item.done .checkbox {
    background: var(--success);
    border-color: var(--success);
}

.checklist-item.done .checkbox::after {
    content: '✓';
    color: white;
    font-size: 16px;
    font-weight: bold;
    animation: pop 0.3s ease-out;
}

@keyframes pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.item-content {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.shot-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.checklist-item.done .shot-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.item-category {
    font-size: 11px;
    padding: 2px 8px;
    background: #ede9fe;
    color: var(--primary);
    border-radius: 10px;
    font-weight: 500;
}

.item-notes {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

/* ===== Completion Toast ===== */
.completion-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.completion-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.toast-emoji {
    font-size: 48px;
    margin-bottom: 8px;
}

.toast-text {
    font-size: 20px;
    font-weight: 700;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal.small.show {
    align-items: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content.small {
    border-radius: var(--radius);
    max-height: 90vh;
    width: calc(100% - 32px);
    max-width: 360px;
    margin-bottom: 0;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 17px;
    font-weight: 700;
}

.close-btn {
    background: var(--bg);
    border: none;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover,
.close-btn:active {
    background: #fee2e2;
    transform: scale(0.95);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.modal-footer button {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* ===== Paste Table Modal ===== */
.paste-intro {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.7;
}

.paste-intro strong {
    color: var(--primary-dark);
    display: block;
    margin-bottom: 6px;
}

.paste-intro ol,
.paste-intro ul {
    margin: 6px 0 0 18px;
    padding: 0;
    color: var(--text-secondary);
}

.paste-intro li {
    margin-bottom: 2px;
}

.paste-tip {
    margin-bottom: 10px;
}

.paste-format {
    padding-top: 10px;
    border-top: 1px dashed #bae6fd;
}

.paste-format ul {
    list-style: none;
    margin-left: 0;
}

.paste-format li {
    padding: 2px 0;
}

.paste-format code {
    background: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.paste-intro kbd {
    background: white;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

.paste-textarea {
    width: 100%;
    min-height: 200px;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    background: var(--bg);
    transition: all 0.2s;
}

.paste-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.paste-preview {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.paste-preview .section-title {
    color: var(--success);
}

/* ===== Quick Actions ===== */
.quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.quick-btn {
    flex: 1;
    min-width: 80px;
    padding: 10px 12px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: #e5e7eb;
}

.quick-btn.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.quick-btn.primary:hover {
    background: var(--primary-dark);
}

.quick-btn.danger {
    background: #fef2f2;
    color: var(--danger);
}

.quick-btn.danger:hover {
    background: #fee2e2;
}

/* ===== Shot Tags (分镜标签) ===== */
.shots-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.shot-tag {
    padding: 4px 10px;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.shot-tag:hover {
    border-color: var(--primary-light);
    background: #ede9fe;
}

.shot-tag.done {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
}

.shot-tag.add-shot {
    background: transparent;
    border: 1.5px dashed var(--border);
    color: var(--text-secondary);
    font-weight: 700;
    min-width: 28px;
    padding: 4px 8px;
}

.shot-tag.add-shot:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #ede9fe;
}

.shot-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 8px;
}

.shot-count.all-done {
    background: #d1fae5;
    color: var(--success);
}

/* ===== Library (素材库) ===== */
.library-intro {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #92400e;
}

.library-intro strong {
    color: #78350f;
}

.library-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.lib-action-btn {
    padding: 8px 14px;
    background: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.lib-action-btn:hover {
    background: #e5e7eb;
}

.lib-category {
    margin-bottom: 20px;
}

.lib-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.lib-cat-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.lib-cat-add-all {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lib-cat-add-all:hover {
    background: var(--primary);
    color: white;
}

.lib-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lib-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
}

.lib-item:hover {
    background: #f3f4f6;
}

.lib-item:has(input:checked) {
    background: #ede9fe;
    border-color: var(--primary-light);
}

.lib-item.added {
    opacity: 0.5;
    cursor: not-allowed;
}

.lib-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.lib-item-name {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

.lib-added-tag {
    font-size: 11px;
    background: #d1fae5;
    color: var(--success);
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
}

/* ===== Section Title ===== */
.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title .count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* ===== Add Form ===== */
.add-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.add-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.add-form input,
.add-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--bg);
}

.add-form input:focus,
.add-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

.add-form textarea {
    resize: vertical;
    min-height: 50px;
}

.add-btn {
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.add-btn:hover {
    background: var(--primary-dark);
    transform: scale(0.99);
}

.add-btn:active {
    transform: scale(0.98);
}

/* ===== Manage List ===== */
.manage-section {
    margin-bottom: 24px;
}

.manage-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.manage-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.manage-item-info {
    flex: 1;
    min-width: 0;
}

.manage-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manage-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.manage-item.done .manage-item-name {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.manage-item-actions {
    display: flex;
    gap: 6px;
}

.manage-item button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toggle-btn {
    background: white;
}

.toggle-btn.done {
    background: var(--success);
    color: white;
}

.edit-btn {
    background: white;
}

.edit-btn:hover {
    background: #ede9fe;
}

.delete-btn {
    background: white;
}

.delete-btn:hover {
    background: #fee2e2;
}

/* ===== Templates ===== */
.template-section {
    margin-top: 8px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.template-btn {
    padding: 16px;
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.template-btn:hover {
    background: #ede9fe;
    border-color: var(--primary-light);
    color: var(--primary);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: calc(100% - 64px);
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 380px) {
    .title {
        font-size: 17px;
    }

    .stat-value {
        font-size: 20px;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Haptic Feedback ===== */
@media (hover: none) {
    .checklist-item:active {
        background: #f3f4f6;
    }

    .checklist-item.done:active {
        background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    }
}

/* ===== View Switching ===== */
.view.hidden {
    display: none;
}

/* ===== FAB (浮动新建按钮) ===== */
.fab {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 28px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 50;
    transition: all 0.2s;
}

.fab:hover,
.fab:active {
    transform: translateX(-50%) scale(0.96);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

/* ===== Project Detail Header ===== */
.project-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    padding: 6px 10px;
    margin: -6px -10px;
    border-radius: 10px;
    transition: background 0.2s;
    position: relative;
}

.project-title:active {
    background: rgba(255, 255, 255, 0.15);
}

.title-edit-hint {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.6;
    pointer-events: none;
}

.project-name {
    font-size: 16px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-date {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 1px;
}

#backBtn {
    background: rgba(255, 255, 255, 0.2);
    font-size: 20px;
    font-weight: 700;
}

/* ===== Date Groups (首页日期分组) ===== */
.date-group {
    margin-bottom: 20px;
}

.date-group-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 6px 4px 10px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 5;
}

.project-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== Project Card ===== */
.project-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.project-card:active {
    transform: scale(0.98);
}

.project-card.done {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.project-card-main {
    flex: 1;
    min-width: 0;
}

.project-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.project-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-card.done .project-card-name {
    color: var(--text-secondary);
}

.project-complete-badge {
    font-size: 11px;
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    flex-shrink: 0;
}

.project-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-secondary);
}

.project-cat-tag {
    background: #ede9fe;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.project-shot-stat,
.project-action-stat {
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 500;
}

.project-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.project-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.project-card.done .project-progress-fill {
    background: var(--success);
}

.project-empty-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-style: italic;
}

.project-card-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.proj-action-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: var(--bg);
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.proj-action-btn:hover {
    background: #e5e7eb;
}

.proj-action-btn.danger:hover {
    background: #fee2e2;
}

/* ===== New Project Form ===== */
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    margin-top: 4px;
}

.form-label:first-child {
    margin-top: 0;
}

.new-project-tip {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.6;
    color: #0369a1;
}

/* ===== Project List Empty State in container ===== */
#projectList {
    padding-bottom: 100px;
}

#projectList .empty-state {
    display: block;
    text-align: center;
    padding: 60px 20px;
}

/* ===== Responsive tweaks for project view ===== */
@media (max-width: 380px) {
    .project-card {
        padding: 12px;
    }

    .project-card-actions {
        gap: 3px;
    }

    .proj-action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .fab {
        padding: 12px 22px;
        font-size: 14px;
    }
}

/* ===== Cloud Sync ===== */
.sync-badge {
    background: rgba(255,255,255,0.18);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 14px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sync-badge:hover,
.sync-badge:active { transform: scale(0.96); background: rgba(255,255,255,0.28); }
.sync-badge[data-status="syncing"] {
    background: rgba(245,158,11,0.25);
    border-color: rgba(245,158,11,0.6);
    animation: pulse 1.2s ease-in-out infinite;
}
.sync-badge[data-status="ok"] {
    background: linear-gradient(135deg, rgba(16,185,129,0.3) 0%, rgba(5,150,105,0.4) 100%);
    border-color: rgba(16,185,129,0.7);
}
.sync-badge[data-status="error"] {
    background: rgba(239,68,68,0.25);
    border-color: rgba(239,68,68,0.6);
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.sync-intro {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.7;
}
.sync-intro strong {
    color: var(--primary-dark);
    display: block;
    margin-bottom: 4px;
}
.sync-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.sync-hint code {
    background: white;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.sync-status {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    border: 1px dashed var(--border);
}
.sync-actions-row {
    display: flex;
    gap: 8px;
    padding: 12px 20px 20px;
    border-top: 1px solid var(--border);
}
.sync-actions-row button {
    flex: 1;
    padding: 10px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    background: var(--bg);
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s;
}
.sync-actions-row button:hover,
.sync-actions-row button:active {
    background: #e5e7eb;
}
