/* =========================================================
 * 旧变量映射到设计系统（开发三典 v1.0）
 * 通过重新定义同名变量让旧 CSS 自动应用新配色
 * ========================================================= */
:root {
    /* 主色 - TodoList 航海日志（海军绿） */
    --primary: #5a6b3a;
    --primary-light: rgba(74, 93, 74, 0.08);
    --primary-hover: #2C3525;

    /* 语义色 */
    --success: #5A6E4A;
    --success-light: rgba(90, 110, 74, 0.12);
    --warning: #C8956A;
    --warning-light: rgba(200, 149, 106, 0.12);
    --danger: #B85450;
    --danger-light: rgba(184, 84, 80, 0.10);
    --accent: #5a6b3a;
    --accent-light: rgba(90,107,58,0.12);
    
    /* 中性色（米色羊皮主题） */
    --bg: #EFE9DC;
    --card: rgba(255,255,255,0.75);
    --hover: #F5EFE0;
    --border: #D9D0B8;
    --border-soft: #E8DFC8;
    
    /* 文字色 */
    --text-primary: #2C3525;
    --text-secondary: #6B6B5C;
    --text-tertiary: #9A9685;
    --text-white: #FFFFFF;
    
    /* 阴影（米色调） */
    --shadow: 0 1px 2px rgba(60, 50, 30, 0.06);
    --shadow-hover: 0 4px 12px rgba(60, 50, 30, 0.10);
    
    /* 间距 */
    --sidebar-width: 240px;
    --radius: 8px;
    --radius-sm: 4px;
}

/* 旧的深色模式已废弃，移除 */

/* =========================================================
 * 暗色模式（开发三典 v1.0）— 航海日志·夜色版
 * 复用 4 主题结构，仅在 [data-theme="todolist-dark"] 下覆盖
 * ========================================================= */
[data-theme="todolist-dark"] {
    /* 主色（提亮为低光友好） */
    --primary: #8FAA85;
    --primary-light: rgba(143, 170, 133, 0.16);
    --primary-hover: #A8C29E;

    /* 语义色 */
    --success: #8FAA85;
    --success-light: rgba(143, 170, 133, 0.16);
    --warning: #D4A77A;
    --warning-light: rgba(212, 167, 122, 0.16);
    --danger: #D67870;
    --danger-light: rgba(214, 120, 112, 0.16);

    /* 暗色米色系（深暖灰） */
    --bg: #1A1F1A;
    --bg-page: #141814;
    --bg-card: #1F241F;
    --bg-card-2: #232923;
    --hover: #283028;

    /* 边框 */
    --border: #2E342E;
    --border-soft: #262A26;

    /* 文字（暖白） */
    --text-primary: #E5E5DC;
    --text-secondary: #B0B0A6;
    --text-tertiary: #6E6E64;
    --text-muted: #505048;
    --text-white: #FFFFFF;

    /* 阴影（深色更强） */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.6);

    /* 评级色 */
    --rate-unknown: #D67870;
    --rate-unknown-light: rgba(214, 120, 112, 0.18);
    --rate-vague: #D4A77A;
    --rate-vague-light: rgba(212, 167, 122, 0.18);
    --rate-known: #8FAA85;
    --rate-known-light: rgba(143, 170, 133, 0.18);

    /* 优先级色（暗色） */
    --accent: #6FA8D4;
    --accent-light: rgba(111, 168, 212, 0.18);
}

/* 暗色模式下的进度环等高线 */
[data-theme="todolist-dark"] .ring-tick {
    stroke: rgba(143, 170, 133, 0.3);
}
[data-theme="todolist-dark"] .ring-bg {
    stroke: rgba(143, 170, 133, 0.15);
}
[data-theme="todolist-dark"] .ring-fill {
    stroke: var(--primary);
}
[data-theme="todolist-dark"] .compass-star path {
    fill: var(--primary);
}
[data-theme="todolist-dark"] .progress-label {
    color: var(--text-tertiary);
}

/* 暗色模式背景：深色径向渐变 */
[data-theme="todolist-dark"] body {
    background: var(--bg-page);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(143, 170, 133, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(212, 167, 122, 0.05) 0%, transparent 50%);
    color: var(--text-primary);
    background-attachment: fixed;
}

/* 暗色模式等高线背景 */
[data-theme="todolist-dark"] .content::before {
    background-image:
        radial-gradient(ellipse 600px 200px at 10% 90%, transparent 60%, rgba(143, 170, 133, 0.08) 60.5%, transparent 61%),
        radial-gradient(ellipse 800px 280px at 10% 90%, transparent 64%, rgba(143, 170, 133, 0.06) 64.5%, transparent 65%),
        radial-gradient(ellipse 1000px 360px at 10% 90%, transparent 68%, rgba(143, 170, 133, 0.04) 68.5%, transparent 69%);
}

/* 暗色模式任务卡：背景更亮 */
[data-theme="todolist-dark"] .task-item {
    background: var(--bg-card);
    border-color: var(--border-soft);
}
[data-theme="todolist-dark"] .task-item:hover {
    background: var(--bg-card-2);
    border-color: var(--border);
}

/* 暗色模式 today-hero 装饰 */
[data-theme="todolist-dark"] .today-hero::before {
    background-image:
        radial-gradient(circle at 30% 30%, transparent 50%, rgba(143, 170, 133, 0.10) 50.5%, transparent 51%),
        radial-gradient(circle at 30% 30%, transparent 60%, rgba(143, 170, 133, 0.08) 60.5%, transparent 61%),
        radial-gradient(circle at 30% 30%, transparent 70%, rgba(143, 170, 133, 0.06) 70.5%, transparent 71%);
}

/* 暗色模式 stat-card 图标背景 */
[data-theme="todolist-dark"] .stat-icon {
    background: var(--bg-card-2);
}
[data-theme="todolist-dark"] .stat-card.overdue .stat-icon { color: var(--danger); background: var(--danger-light); }
[data-theme="todolist-dark"] .stat-card.today .stat-icon { color: var(--warning); background: var(--warning-light); }
[data-theme="todolist-dark"] .stat-card.future .stat-icon { color: var(--primary); background: var(--primary-light); }
[data-theme="todolist-dark"] .stat-card.done .stat-icon { color: var(--success); background: var(--success-light); }

/* 暗色模式 section-title icon */
[data-theme="todolist-dark"] .section-title-icon {
    background: var(--bg-card-2);
}

/* 暗色模式模态框 */
[data-theme="todolist-dark"] .modal-content {
    background: var(--bg-card);
    border-color: var(--border);
}
[data-theme="todolist-dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* 暗色模式输入框 */
[data-theme="todolist-dark"] .input,
[data-theme="todolist-dark"] .textarea {
    background: var(--bg-card-2);
    border-color: var(--border-soft);
    color: var(--text-primary);
}
[data-theme="todolist-dark"] .input:focus,
[data-theme="todolist-dark"] .textarea:focus {
    border-color: var(--primary);
}

/* 暗色模式按钮 */
[data-theme="todolist-dark"] .btn-ghost {
    color: var(--text-secondary);
}
[data-theme="todolist-dark"] .btn-ghost:hover {
    background: var(--hover);
    color: var(--text-primary);
}

/* 暗色模式 nav-item */
[data-theme="todolist-dark"] .nav-item:hover {
    background: var(--hover);
}

/* 暗色模式 progress bar 背景 */
[data-theme="todolist-dark"] .progress {
    background: var(--bg-card-2);
}

/* 暗色模式 scrollbar */
[data-theme="todolist-dark"] ::-webkit-scrollbar-track {
    background: var(--bg-page);
}
[data-theme="todolist-dark"] ::-webkit-scrollbar-thumb {
    background: var(--border);
}
[data-theme="todolist-dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* =========================================================
 * 自动模式（跟随系统）
 * 通过 JS 读取 prefers-color-scheme 并应用对应主题
 * ========================================================= */
@media (prefers-color-scheme: dark) {
    /* 在 data-theme="auto" 时由 JS 切换到 todolist-dark */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

.app {
    display: flex;
    height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.nav-item .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--hover);
    color: var(--text-tertiary);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.nav-item.active .badge {
    background: var(--primary);
    color: var(--text-white);
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 8px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 12px 8px;
}

.btn-add-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 16px);
    margin: 8px;
    padding: 8px 12px;
    background: none;
    border: 1px dashed var(--border);
    color: var(--text-tertiary);
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-add-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-section-header:hover {
    background: var(--hover);
    color: var(--text-primary);
}

.nav-section-header.active {
    background: var(--primary-light);
    color: var(--primary);
}

.btn-add-sm {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 16px;
    opacity: 0;
    transition: all 0.2s ease;
}

.nav-section-header:hover .btn-add-sm {
    opacity: 1;
}

.btn-add-sm:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-items {
    padding-left: 16px;
}

.nav-item-sm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-item-sm:hover {
    background: var(--hover);
    color: var(--text-primary);
}

.nav-item-sm.active {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-sm {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    background: var(--hover);
    color: var(--text-tertiary);
}

.nav-item-sm.active .badge-sm {
    background: var(--primary);
    color: var(--text-white);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.btn-settings {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-settings:hover {
    background: var(--hover);
    color: var(--text-primary);
}

/* 主内容区 */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.toolbar h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    width: 220px;
    background: var(--bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 108, 191, 0.1);
}

.search-input:hover {
    border-color: var(--primary);
}

.sort-dropdown {
    position: relative;
}

.btn-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sort:hover {
    background: var(--border);
    color: var(--text-primary);
}

.sort-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    z-index: 100;
    min-width: 150px;
}

.sort-menu.active {
    display: block;
}

.sort-menu button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.sort-menu button:hover {
    background: var(--hover);
}

.sort-menu button:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.sort-menu button:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 8px;
}

.btn-batch {
    padding: 6px 12px;
    background: var(--hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-batch:hover {
    background: var(--border);
    color: var(--text-primary);
}

.btn-batch.danger {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

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

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 108, 191, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--danger);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-text {
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-text:hover {
    opacity: 0.8;
}

.btn-menu {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.mobile-only {
    display: none;
}

/* 内容区 */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.view {
    display: none;
    max-width: 800px;
    margin: 0 auto;
}

.view.active {
    display: block;
}

/* 卡片 */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

/* 日期头部 */
.date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 4px;
}

.date-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.date-right {
    text-align: right;
}

.date-day {
    font-family: var(--font-heading, var(--font-serif-cn));
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    font-feature-settings: "tnum";
}

.date-info {
    font-size: 16px;
    color: var(--text-secondary);
    font-family: var(--font-body);
}

.current-time {
    font-family: var(--font-mono, 'JetBrains Mono', 'SF Mono', monospace);
    font-size: 32px;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 2px;
    font-feature-settings: "tnum";
}

/* 倒计时卡片 */
.countdown-card {
    background: var(--primary);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-white);
}

.countdown-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: var(--fw-medium);
}

.countdown-time {
    font-size: 48px;
    font-weight: 700;
    font-family: var(--font-mono, 'JetBrains Mono', 'SF Mono', monospace);
    letter-spacing: 2px;
    margin-bottom: 8px;
    font-feature-settings: "tnum" 1;
    /* 数字入场动画 */
    animation: countdownPulse 1.2s var(--ease-out, ease);
}

/* 倒计时数字每分钟更新时轻微脉冲 */
@keyframes countdownPulse {
    0%   { transform: scale(1); color: inherit; }
    30%  { transform: scale(1.04); color: var(--primary); }
    100% { transform: scale(1); color: inherit; }
}

.countdown-task {
    font-size: 14px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 统计卡片 */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.stat-card.overdue {
    border-left: 3px solid var(--danger);
}

.stat-card.today {
    border-left: 3px solid var(--warning);
}

.stat-card.future {
    border-left: 3px solid var(--primary);
}

.stat-card.done {
    border-left: 3px solid var(--success);
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card.overdue .stat-number {
    color: var(--danger);
}

.stat-card.today .stat-number {
    color: var(--warning);
}

.stat-card.future .stat-number {
    color: var(--primary);
}

.stat-card.done .stat-number {
    color: var(--success);
}

.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 任务区块 */
.section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 8px 0;
}

.section-title.overdue {
    color: var(--danger);
}

.section-title.future {
    color: var(--primary);
}

/* 任务列表 */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    user-select: none;
}

.task-item:hover {
    background: var(--hover);
    box-shadow: var(--shadow-hover);
}

.task-item.completed {
    opacity: 0.7;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.task-item.urgent {
    border-left: 3px solid var(--danger);
}

.task-item.dragging {
    opacity: 0.5;
    background: var(--primary-light);
    box-shadow: var(--shadow-hover);
}

.task-item.drag-over {
    border-top: 2px solid var(--primary);
}

.task-select {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item:hover .task-select {
    opacity: 1;
}

.task-item.selected .task-select {
    opacity: 1;
}

.task-item.selected {
    background: var(--primary-light);
}

.task-drag-handle {
    cursor: grab;
    color: var(--text-tertiary);
    padding: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item:hover .task-drag-handle {
    opacity: 1;
}

.task-drag-handle:active {
    cursor: grabbing;
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.task-checkbox:hover {
    border-color: var(--primary);
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

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

.task-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.task-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.task-priority {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.task-priority.low {
    background: #E0F2FE;
    color: #0369A1;
}

.task-priority.medium {
    background: var(--warning-light);
    color: #92400E;
}

.task-priority.high {
    background: var(--danger-light);
    color: #991B1B;
}

.task-reminder {
    font-size: 12px;
    color: var(--primary);
}

.task-repeat {
    font-size: 12px;
    color: var(--success);
}

.task-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-deadline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg);
    color: var(--text-secondary);
}

.task-deadline.overdue {
    background: var(--danger-light);
    color: var(--danger);
}

.task-deadline.today {
    background: var(--warning-light);
    color: #D97706;
}

.task-countdown {
    font-size: 11px;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    padding: 2px 8px;
    border-radius: 4px;
}

.task-countdown.overdue {
    background: var(--danger-light);
    color: var(--danger);
    font-weight: 600;
}

.task-countdown.urgent {
    background: var(--danger-light);
    color: var(--danger);
    font-weight: 600;
    animation: pulse 1s infinite;
}

.task-countdown.today {
    background: var(--warning-light);
    color: #D97706;
}

.task-countdown.soon {
    background: var(--primary-light);
    color: var(--primary);
}

.task-countdown.normal {
    background: var(--bg);
    color: var(--text-tertiary);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.task-project {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
}

.task-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.task-important {
    color: var(--border);
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s ease;
}

.task-important:hover {
    color: var(--warning);
    transform: scale(1.1);
}

.task-important.active {
    color: var(--warning);
}

.task-delete {
    color: var(--border);
    cursor: pointer;
    font-size: 14px;
    opacity: 0;
    transition: all 0.2s ease;
    padding: 2px;
}

.task-item:hover .task-delete {
    opacity: 1;
}

.task-delete:hover {
    color: var(--danger);
}

/* 项目卡片 */
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: all 0.2s ease;
}

.project-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    margin-bottom: 8px;
}

.project-card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.project-card-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.project-card:hover .project-card-actions {
    opacity: 1;
}

.project-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    cursor: pointer;
}

.project-card small {
    font-size: 12px;
    color: var(--text-tertiary);
}

.btn-icon-sm {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-icon-sm:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.btn-danger-sm {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-danger-sm:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.project-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 领域头部 */
.area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.area-info h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.area-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.area-content {
    margin-top: 16px;
}

.text-center {
    text-align: center;
    padding: 12px;
}

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

.project-info h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.project-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    animation: emptyStateEnter 480ms var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

.empty-illustration {
    margin-bottom: var(--sp-5, 20px);
    animation: emptyFloat 6s ease-in-out infinite;
}

.empty-svg {
    width: 200px;
    height: 160px;
    max-width: 100%;
}

.empty-title {
    font-family: var(--font-heading, var(--font-serif-cn));
    font-size: var(--fs-xl, 20px);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    margin: 0 0 var(--sp-2, 8px) 0;
    letter-spacing: 0.02em;
}

.empty-desc {
    font-size: var(--fs-sm, 14px);
    color: var(--text-secondary);
    margin: 0 0 var(--sp-6, 24px) 0;
}

.empty-action {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2, 8px);
    padding: 10px 20px;
    font-size: var(--fs-sm, 14px);
}
.empty-action .icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

@keyframes emptyStateEnter {
    0%   { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

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

.empty-state p {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

/* 回收站 */
.trash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.trash-info {
    font-size: 13px;
    color: var(--text-tertiary);
}

.trash-item {
    opacity: 0.8;
}

.task-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

.btn-text-sm {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-text-sm:hover {
    background: var(--hover);
}

.btn-text-sm.danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card);
    border-radius: 12px;
    width: 480px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-sm {
    width: 360px;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 4px;
    transition: color 0.2s ease;
}

.btn-close:hover {
    color: var(--text-primary);
}

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

.modal-body input,
.modal-body textarea,
.modal-body select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 12px;
    background: var(--bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 108, 191, 0.1);
}

.input-with-hint {
    position: relative;
    margin-bottom: 12px;
}

.input-with-hint input {
    width: 100%;
    margin-bottom: 0;
}

.input-hint {
    position: absolute;
    bottom: -20px;
    left: 0;
    right: 0;
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 1;
}

.modal-body textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-secondary);
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}

.icon-select {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.icon-option {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-option:hover {
    border-color: var(--primary);
}

.icon-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

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

/* 设置 */
.settings-group {
    margin-bottom: 20px;
}

.settings-group h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item span {
    font-size: 14px;
    color: var(--text-primary);
}

/* 开关组件 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--card);
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.setting-item select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 13px;
}

/* 提醒时间滑块 */
.reminder-count-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.reminder-count-btn {
    flex: 1;
    padding: 8px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reminder-count-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.reminder-count-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-white);
}

.reminder-slider-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 12px;
    position: relative;
}

.reminder-slider-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.reminder-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.reminder-time-preview {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    font-family: 'JetBrains Mono', monospace;
}

.reminder-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    margin-bottom: 8px;
}

.reminder-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.reminder-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.reminder-slider-marks {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
}

.reminder-slider-marks span {
    font-size: 10px;
    color: var(--text-tertiary);
}

.reminder-summary {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
}

.reminder-summary-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.reminder-summary-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reminder-summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.reminder-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}

.btn-add-reminder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: none;
    border: 1px dashed var(--border);
    color: var(--text-tertiary);
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    width: 100%;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-add-reminder:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-remove-reminder {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-remove-reminder:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* Toast通知 */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-hover);
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 320px;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.success {
    border-left-color: var(--success);
}

.toast-notification.warning {
    border-left-color: var(--warning);
}

.toast-notification.error {
    border-left-color: var(--danger);
}

.toast-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* 提醒模态框 */
.reminder-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.reminder-modal-content {
    background: var(--card);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.reminder-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse 1s infinite;
}

.reminder-modal-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.reminder-modal-task {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 8px;
}

.reminder-modal-time {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.reminder-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.reminder-modal-actions button {
    min-width: 100px;
}

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

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Markdown 内容样式 */
.markdown-content {
    font-size: 14px;
    line-height: 1.6;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin: 12px 0 8px;
    font-weight: 600;
}

.markdown-content h1 { font-size: 18px; }
.markdown-content h2 { font-size: 16px; }
.markdown-content h3 { font-size: 14px; }
.markdown-content p { margin: 8px 0; }

.markdown-content code {
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.markdown-content pre {
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.markdown-content pre code {
    background: none;
    padding: 0;
}

.markdown-content a {
    color: var(--primary);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 24px;
    margin: 8px 0;
}

.markdown-content li { margin: 4px 0; }

.markdown-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--text-secondary);
}

.markdown-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.markdown-content del {
    color: var(--text-tertiary);
}

/* 统计页面 */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.overview-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    text-align: center;
    border-top: 3px solid var(--primary);
}

.overview-card.success {
    border-top-color: var(--success);
}

.overview-card.warning {
    border-top-color: var(--warning);
}

.overview-card.danger {
    border-top-color: var(--danger);
}

.overview-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.overview-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stats-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.stats-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* 进度环 */
.progress-ring-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.progress-ring {
    position: relative;
    width: 150px;
    height: 150px;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: var(--bg);
    stroke-width: 10;
}

.progress-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* 图表 */
.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 0 8px;
}

.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    min-height: 4px;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
}

.chart-bar.today {
    background: var(--success);
}

.chart-label {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.chart-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 项目统计 */
.project-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.project-stat-info {
    width: 120px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-stat-bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.project-stat-progress {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.project-stat-value {
    width: 50px;
    text-align: right;
    font-size: 13px;
    color: var(--text-secondary);
}

/* 优先级分布图 */
.priority-chart {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 20px 0;
}

.priority-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.priority-bar-container {
    width: 60px;
    height: 120px;
    background: var(--bg);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.priority-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 8px;
    transition: height 0.5s ease;
}

.priority-bar.high {
    background: var(--danger);
}

.priority-bar.medium {
    background: var(--warning);
}

.priority-bar.low {
    background: var(--primary);
}

.priority-bar.normal {
    background: var(--text-tertiary);
}

.priority-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.priority-count {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 时间分布图 */
.time-chart {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 150px;
    padding: 0 8px;
}

.time-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.time-bar {
    width: 100%;
    min-height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
    transition: height 0.3s ease;
}

.time-label {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 4px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.text-secondary {
    color: var(--text-secondary);
}
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-stat-bar {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.tag-stat-progress {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.tag-stat-value {
    width: 50px;
    text-align: right;
    font-size: 13px;
    color: var(--text-secondary);
}

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

/* ==================== 番茄钟 ==================== */
.pomodoro-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.pomodoro-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.pomodoro-task {
    margin-bottom: 24px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.pomodoro-task span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.pomodoro-timer {
    margin-bottom: 24px;
}

.timer-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.timer-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: var(--bg);
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 300;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.pomodoro-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.btn-pomodoro {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--primary);
    color: var(--text-white);
}

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

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

.btn-pomodoro.secondary:hover {
    background: var(--border);
}

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

.btn-pomodoro.danger:hover {
    background: #D45455;
}

.pomodoro-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.pomodoro-stat {
    text-align: center;
}

.pomodoro-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

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

/* ==================== 滑动手势 ==================== */
.task-item {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
}

.task-item::before,
.task-item::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item::before {
    left: 0;
    background: var(--success);
    color: white;
    content: '✓ 完成';
    font-size: 14px;
}

.task-item::after {
    right: 0;
    background: var(--danger);
    color: white;
    content: '✕ 删除';
    font-size: 14px;
}

.task-item.swipe-right::before {
    opacity: 1;
}

.task-item.swipe-left::after {
    opacity: 1;
}

.task-item.swiped {
    transform: translateX(0);
}

/* 触摸反馈 */
.task-item:active {
    background: var(--hover);
}

/* ==================== 任务模板 ==================== */
.template-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

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

.template-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.template-desc {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-actions {
    display: flex;
    gap: 4px;
    margin-left: 12px;
}

.btn-text-sm {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-text-sm:hover {
    background: var(--primary-light);
}

.btn-text-sm.danger {
    color: var(--danger);
}

.btn-text-sm.danger:hover {
    background: var(--danger-light);
}

/* ==================== 响应式设计 ==================== */

/* 平板和手机 */
@media (max-width: 768px) {
    /* 侧边栏 */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        z-index: 100;
        transition: left 0.3s ease;
        width: 280px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    
    .sidebar.open ~ .sidebar-overlay {
        display: block;
    }
    
    /* 工具栏 */
    .toolbar {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .toolbar h2 {
        font-size: 16px;
        order: 1;
    }
    
    .toolbar-right {
        order: 2;
        width: 100%;
        justify-content: flex-end;
    }
    
    .search-input {
        width: 100px;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .btn-primary {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .btn-sort {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .mobile-only {
        display: flex;
    }
    
    /* 内容区 */
    .content {
        padding: 16px;
    }
    
    /* 日期显示 */
    .date-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .date-day {
        font-size: 36px;
    }
    
    .date-info {
        font-size: 14px;
    }
    
    .current-time {
        font-size: 24px;
    }
    
    /* 倒计时卡片 */
    .countdown-card {
        padding: 16px;
    }
    
    .countdown-time {
        font-size: 36px;
    }
    
    /* 统计卡片 */
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    /* 任务项 */
    .task-item {
        padding: 12px;
    }
    
    .task-title {
        font-size: 14px;
    }
    
    .task-desc {
        font-size: 12px;
        -webkit-line-clamp: 1;
    }
    
    .task-info {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .task-deadline,
    .task-countdown,
    .task-project {
        font-size: 10px;
        padding: 1px 6px;
    }
    
    /* 表单 */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 8px;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 12px 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 12px 16px;
    }
    
    /* 项目列表 */
    .project-list {
        grid-template-columns: 1fr;
    }
    
    .project-card {
        padding: 16px;
    }
    
    /* 领域头部 */
    .area-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .area-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .area-actions button {
        flex: 1;
        min-width: 0;
    }
    
    /* 番茄钟 */
    .pomodoro-card {
        padding: 24px;
    }
    
    .timer-circle {
        width: 160px;
        height: 160px;
    }
    
    .timer-text {
        font-size: 36px;
    }
    
    .pomodoro-stats {
        gap: 16px;
    }
    
    /* 提醒滑块 */
    .reminder-slider-marks span {
        font-size: 9px;
    }
    
    /* Toast通知 */
    .toast-notification {
        left: 16px;
        right: 16px;
        max-width: none;
    }
    
    /* 批量操作 */
    .batch-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .batch-count {
        font-size: 12px;
    }
    
    .btn-batch {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .toolbar {
        padding: 8px 12px;
    }
    
    .toolbar h2 {
        font-size: 14px;
    }
    
    .search-input {
        width: 80px;
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .btn-primary {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .content {
        padding: 12px;
    }
    
    .date-day {
        font-size: 28px;
    }
    
    .date-info {
        font-size: 12px;
    }
    
    .current-time {
        font-size: 20px;
    }
    
    .countdown-card {
        padding: 12px;
    }
    
    .countdown-time {
        font-size: 28px;
    }
    
    .stats-row {
        gap: 6px;
    }
    
    .stat-card {
        padding: 8px;
    }
    
    .stat-number {
        font-size: 18px;
    }
    
    .task-item {
        padding: 10px;
    }
    
    .task-title {
        font-size: 13px;
    }
    
    .task-desc {
        display: none;
    }
    
    .task-info {
        gap: 2px;
    }
    
    .task-deadline,
    .task-countdown,
    .task-project {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .modal-content {
        margin: 4px;
    }
    
    .modal-body input,
    .modal-body textarea,
    .modal-body select {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .pomodoro-card {
        padding: 16px;
    }
    
    .timer-circle {
        width: 120px;
        height: 120px;
    }
    
    .timer-text {
        font-size: 28px;
    }
    
    .btn-pomodoro {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* 滚动条 - 设计规范：8px宽度，圆角4px */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* =========================================================
 * 设计系统 v1.0 增强样式（开发三典）
 * ========================================================= */

/* 浅色亚麻底色（替代原 --bg 蓝白调） */
body {
    background: var(--bg);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(200, 149, 106, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(74, 93, 74, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
}

/* 等高线背景（航海主题装饰，content 区底部） */
.content::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(ellipse 600px 200px at 10% 90%, transparent 60%, rgba(74, 93, 74, 0.05) 60.5%, transparent 61%),
        radial-gradient(ellipse 800px 280px at 10% 90%, transparent 64%, rgba(74, 93, 74, 0.04) 64.5%, transparent 65%),
        radial-gradient(ellipse 1000px 360px at 10% 90%, transparent 68%, rgba(74, 93, 74, 0.03) 68.5%, transparent 69%);
}
.content {
    position: relative;
    z-index: 1;
}

/* ===== 今日视图（航海日志风格：罗盘 + 日期并列） ===== */
.today-hero {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--sp-6);
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-xl);
    padding: var(--sp-6);
    margin-bottom: var(--sp-5);
    position: relative;
    overflow: hidden;
}

/* 等高线角部装饰（仅 today-hero） */
.today-hero::before {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 200px;
    height: 200px;
    background-image:
        radial-gradient(circle at 30% 30%, transparent 50%, rgba(74, 93, 74, 0.05) 50.5%, transparent 51%),
        radial-gradient(circle at 30% 30%, transparent 60%, rgba(74, 93, 74, 0.04) 60.5%, transparent 61%),
        radial-gradient(circle at 30% 30%, transparent 70%, rgba(74, 93, 74, 0.03) 70.5%, transparent 71%);
    pointer-events: none;
}

.today-progress-ring {
    position: relative;
    width: 200px;
    height: 200px;
}

.progress-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-tick {
    fill: none;
    stroke: var(--border-soft);
    stroke-width: 1;
    stroke-dasharray: 1 5;
    opacity: 0.6;
}

.ring-bg {
    fill: none;
    stroke: var(--border-soft);
    stroke-width: 12;
}

.ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.progress-label {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: var(--sp-1);
}

.progress-value {
    font-family: var(--font-heading, var(--font-serif-cn));
    font-size: 48px;
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--sp-1);
    font-feature-settings: "tnum";
}

.progress-detail {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.today-date-block {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.today-day {
    font-family: var(--font-heading, var(--font-serif-cn));
    font-size: 96px;
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    line-height: 0.9;
    letter-spacing: -0.02em;
}

.today-day-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.today-day-suffix {
    font-family: var(--font-heading, var(--font-serif-cn));
    font-size: var(--fs-2xl);
    font-weight: var(--fw-regular);
    color: var(--text-tertiary);
    letter-spacing: 0;
}

.today-info {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
    color: var(--text-secondary);
    font-size: var(--fs-md);
}

#today-weekday {
    color: var(--primary);
    font-weight: var(--fw-medium);
}

.current-time {
    font-family: var(--font-mono);
    font-size: var(--fs-3xl);
    color: var(--primary);
    letter-spacing: 0.05em;
    margin-top: var(--sp-2);
    font-feature-settings: "tnum";
}

/* ===== 状态卡（含图标） ===== */
.stat-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    padding: var(--sp-3) var(--sp-4);
    box-shadow: var(--sh-sm);
    transition: all var(--dur-base) var(--ease-out);
    cursor: pointer;
    text-align: left;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transition: width var(--dur-base) var(--ease-out);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-md);
    border-color: var(--border);
}
.stat-card:hover::before { width: 5px; }
.stat-card.overdue::before { background: var(--danger); }
.stat-card.today::before { background: var(--warning); }
.stat-card.future::before { background: var(--primary); }
.stat-card.done::before { background: var(--success); }

.stat-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    border-radius: var(--r-md);
    flex-shrink: 0;
}
.stat-card.overdue .stat-icon { color: var(--danger); background: var(--danger-light); }
.stat-card.today .stat-icon { color: var(--warning); background: var(--warning-light); }
.stat-card.future .stat-icon { color: var(--primary); background: var(--primary-light); }
.stat-card.done .stat-icon { color: var(--success); background: var(--success-light); }

/* 状态卡徽章：数字 > 0 时显示右上角色点 */
.stat-card .stat-badge {
    position: absolute;
    top: var(--sp-2);
    right: var(--sp-3);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--dur-base) var(--ease-out);
}
.stat-card.has-data .stat-badge { opacity: 1; transform: scale(1); }
.stat-card.overdue .stat-badge { background: var(--danger); }
.stat-card.today .stat-badge { background: var(--warning); }
.stat-card.future .stat-badge { background: var(--primary); }
.stat-card.done .stat-badge { background: var(--success); }

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

.stat-number {
    font-family: var(--font-heading, var(--font-serif-cn));
    font-size: 22px;
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 2px;
    font-feature-settings: "tnum";
}

.stat-label {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

/* 旧 stat-card 数字居中样式不再适用，覆写 */
.stat-card.overdue .stat-number,
.stat-card.today .stat-number,
.stat-card.future .stat-number,
.stat-card.done .stat-number {
    color: var(--text-primary);
}

/* ===== 任务分组（带图标） ===== */
.section {
    margin-bottom: var(--sp-5);
    position: relative;
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-family: var(--font-heading, var(--font-serif-cn));
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text-primary);
    margin-bottom: var(--sp-3);
    padding: 0;
    border-bottom: none;
}

.section-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-card);
    border-radius: var(--r-sm);
    color: var(--primary);
}

.section-title.overdue { color: var(--danger); }
.section-title.overdue .section-title-icon { color: var(--danger); background: var(--danger-light); }
.section-title.future { color: var(--primary); }
.section-title.overdue::before { content: none; }

/* ===== 任务卡片视觉精致化 ===== */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--border-soft);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    cursor: pointer;
    transition: all var(--dur-base) var(--ease-out);
    min-height: 48px;
    user-select: none;
    font-family: var(--font-body);
    margin-bottom: var(--sp-2);
}
.task-item:hover {
    border-color: var(--border);
    border-left-color: var(--primary);
    box-shadow: var(--sh-md);
    transform: translateX(2px);
}
.task-item.completed {
    opacity: 0.65;
    background: var(--bg-page);
    /* 完成动画：淡出 + 缩小 */
    animation: taskComplete 480ms var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both;
}
.task-item.completed .task-title {
    text-decoration: line-through;
    text-decoration-color: var(--text-tertiary);
    text-decoration-thickness: 1.5px;
    color: var(--text-tertiary);
    transition: color 320ms var(--ease-out, ease);
}

/* 完成动画关键帧 */
@keyframes taskComplete {
    0%   { transform: scale(1); }
    35%  { transform: scale(0.98); background: var(--success-light); }
    100% { transform: scale(1); opacity: 0.65; }
}

/* checkbox 完成态：✓ 飞入动画 */
.task-checkbox svg {
    transition: transform 320ms var(--ease-out, cubic-bezier(0.34, 1.56, 0.64, 1));
}
.task-item.completed .task-checkbox svg {
    transform: scale(1.1);
}

/* 搜索高亮：<mark> 标签样式 */
.search-highlight {
    background: var(--warning-light, rgba(200, 149, 106, 0.25));
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: var(--fw-semibold, 600);
    box-shadow: 0 0 0 1px var(--warning);
}

/* 任务项快速操作按钮：默认半透明，hover 任务项时全显 */
.task-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-1, 4px);
    margin-left: auto;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 220ms var(--ease-out, ease), transform 220ms var(--ease-out, ease);
}
.task-item:hover .task-actions,
.task-item:focus-within .task-actions,
.task-item.selected .task-actions {
    opacity: 1;
    transform: translateX(0);
}
/* 移动端始终显示 */
@media (max-width: 768px) {
    .task-actions {
        opacity: 1;
        transform: translateX(0);
    }
}

.task-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    border-radius: var(--r-sm, 6px);
    cursor: pointer;
    transition: all 180ms var(--ease-out, ease);
    padding: 0;
}
.task-action-btn:hover {
    background: var(--bg-page, rgba(0, 0, 0, 0.04));
    color: var(--text-primary);
    transform: scale(1.08);
}
.task-action-btn:active {
    transform: scale(0.95);
}
.task-action-btn.important.active {
    color: var(--warning);
}
.task-action-btn.important.active svg {
    fill: var(--warning);
}
.task-action-btn.delete:hover {
    color: var(--danger);
    background: var(--danger-light);
}
.task-action-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}
.task-item.urgent {
    border-left-color: var(--danger);
}
.task-item.urgent:hover {
    border-left-color: var(--danger);
}

/* 优先级色条（依据 task.priority 等级） */
.task-item.priority-high {
    border-left-color: var(--danger);
    border-left-width: 4px;
}
.task-item.priority-medium {
    border-left-color: var(--warning);
    border-left-width: 4px;
}
.task-item.priority-low {
    border-left-color: var(--accent, #5B8AB8);
    border-left-width: 4px;
}
/* 重要任务：左边条 + 浅红底 */
.task-item.is-important {
    border-left-color: var(--danger);
}
.task-item.is-important.priority-medium {
    border-left-color: var(--warning);
}
.task-item.is-important.priority-low {
    border-left-color: var(--accent, #5B8AB8);
}

.task-title {
    font-family: var(--font-heading, var(--font-serif-cn));
    font-size: var(--fs-md);
    font-weight: var(--fw-medium);
    color: var(--text-primary);
    letter-spacing: 0.005em;
}

/* ===== 移动端 hero 调整 ===== */
@media (max-width: 768px) {
    .today-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: var(--sp-4);
    }
    .today-progress-ring {
        margin: 0 auto;
        width: 160px;
        height: 160px;
    }
    .today-day { font-size: 64px; }
    .progress-value { font-size: 36px; }
    .current-time { font-size: var(--fs-xl); }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== 移动端紧凑布局 ===== */
@media (max-width: 480px) {
    .today-progress-ring { width: 140px; height: 140px; }
    .today-day { font-size: 56px; }
    .progress-value { font-size: 30px; }
}

/* ===== 保留旧元素兼容（避免破坏） ===== */
.btn-menu.mobile-only { display: none; }

.area-header,
.project-header,
.trash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border-soft);
}

/* 侧边栏 nav-item 适配 SVG 图标 */
.nav-item .icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: color var(--dur-base) var(--ease-out);
}
.nav-item:hover .icon { color: var(--text-secondary); }
.nav-item.active .icon { color: var(--primary); }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--r-md);
    margin-bottom: 2px;
    transition: all var(--dur-base) var(--ease-out);
}

.btn-settings {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--r-md);
    transition: all var(--dur-base) var(--ease-out);
    text-align: left;
}
.btn-settings:hover {
    background: var(--hover);
    color: var(--text-primary);
}
.btn-settings .icon {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
}
.btn-settings:hover .icon { color: var(--text-secondary); }

/* 移动端 TabBar（设计系统） */
.mobile-tabbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -2px 12px rgba(60, 50, 30, 0.06);
    z-index: var(--z-fixed);
    padding: 0 var(--sp-1);
    align-items: center;
    justify-content: space-around;
}

.mobile-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 0;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-family: var(--font-body);
    transition: color var(--dur-base) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}
.mobile-tab-item .icon {
    width: 24px;
    height: 24px;
    color: var(--text-tertiary);
    transition: color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.mobile-tab-item .tab-label {
    font-size: 11px;
    line-height: 1.2;
    font-weight: var(--fw-medium);
}
.mobile-tab-item:active .icon { transform: scale(0.9); }
.mobile-tab-item.active {
    color: var(--primary);
}
.mobile-tab-item.active .icon {
    color: var(--primary);
}
.mobile-tab-item:hover { color: var(--text-secondary); }
.mobile-tab-item:hover .icon { color: var(--text-secondary); }
.mobile-tab-item.active:hover { color: var(--primary); }
.mobile-tab-item.active:hover .icon { color: var(--primary); }

/* 中央 FAB：圆形高亮按钮（新建任务） */
.mobile-fab {
    width: 52px;
    height: 52px;
    margin-top: -22px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: var(--text-on-primary, #fff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
    position: relative;
    z-index: 2;
    /* 入场动画 + 交互过渡合并 */
    animation: fabEnter 480ms var(--ease-out, cubic-bezier(0.34, 1.56, 0.64, 1)) 200ms both;
    transition: transform 240ms var(--ease-out, cubic-bezier(0.34, 1.56, 0.64, 1)),
                box-shadow 240ms var(--ease-out, ease),
                background-color 240ms var(--ease-out, ease);
}
.mobile-fab:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22), 0 3px 6px rgba(0, 0, 0, 0.12);
}
.mobile-fab:active {
    transform: translateY(0) scale(0.95);
}
.mobile-fab .icon {
    width: 24px;
    height: 24px;
    color: var(--text-on-primary, #fff);
    fill: currentColor;
}
/* FAB 入场动画关键帧 */
@keyframes fabEnter {
    0%   { transform: scale(0) translateY(40px); opacity: 0; }
    60%  { transform: scale(1.1) translateY(-4px); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* 移动端样式补充：显示 TabBar + 调整内容区底部留白 */
@media (max-width: 768px) {
    .mobile-tabbar { display: flex; }
    .content { padding-bottom: calc(64px + var(--sp-4)); }
}

/* 头部 toolbar 在移动端适配 */
@media (max-width: 768px) {
    .btn-menu.mobile-only { display: flex; }
    .toolbar-right .search-input { width: 100px; }
}

/* 浅色亚麻底色（替代原 --bg 蓝白调） */
body {
    background: var(--bg);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(200, 149, 106, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(74, 93, 74, 0.04) 0%, transparent 50%);
    background-attachment: fixed;
    /* 主题切换时颜色平滑过渡 */
    transition: background-color 320ms var(--ease-out, ease), color 320ms var(--ease-out, ease);
}

/* 主题切换全局过渡：让所有使用 CSS 变量的颜色/背景平滑过渡 */
body, .card, .task-item, .stat-card, .sidebar, .toolbar, .modal-content,
.section-title, .countdown-card, .overview-card, .stats-card,
.btn, .badge, .form-group input, .form-group select, .form-group textarea {
    transition: background-color 320ms var(--ease-out, ease),
                color 320ms var(--ease-out, ease),
                border-color 320ms var(--ease-out, ease),
                box-shadow 320ms var(--ease-out, ease);
}

/* 侧边栏增加细微米色纹理 */
.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-soft);
}

/* 卡片背景微调（避免白卡太亮） */
.card {
    background: var(--card);
    box-shadow: 0 1px 2px rgba(60, 50, 30, 0.06);
    border: 1px solid var(--border-soft);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(60, 50, 30, 0.10);
    border-color: var(--border);
}

/* 标题字体用衬线（航海日志风格） */
h1, h2, h3, .card-title {
    font-family: var(--font-heading, var(--font-serif-cn));
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

/* 主按钮增加衬线感 */
.btn-primary {
    font-family: var(--font-body);
    font-weight: var(--fw-medium);
    border-radius: var(--r-md);
}

/* 倒计时卡片改为米色重音（更柔和） */
.countdown-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
}

/* 移除原深色模式相关代码影响 */
[data-theme="dark"] {
    background: var(--bg);
}