/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

:root {
    /* 模块主题色 — 柔美可爱风 */
    --plan: #89C4E1;
    --plan-dark: #6BAED6;
    --english: #B8A9D4;
    --english-dark: #9B8CC3;
    --korean: #FF9AA2;
    --korean-dark: #F27A84;
    --reading: #FFCBA4;
    --reading-dark: #F5B07C;
    --fitness: #A0DFC8;
    --fitness-dark: #7DCFB3;
    --money: #FFC3A0;
    --money-dark: #F5A87C;
    --countdown: #D4A0A8;
    --countdown-dark: #C48892;
    --knowledge: #5B7C5F;
    --knowledge-dark: #4A6B4E;
    --inspiration: #6B8E5E;
    --inspiration-dark: #5A7D4E;

    /* 通用 */
    --primary: #A8A0D4;
    --primary-dark: #8C82C0;
    --bg: #F8F5FF;
    --card-bg: #FFFFFF;
    --text: #2D2B3D;
    --text-secondary: #8B87A0;
    --text-tertiary: #B5B1C8;
    --border: #E8E4F0;
    --shadow: 0 3px 16px rgba(140,130,180,0.08);
    --shadow-lg: 0 8px 32px rgba(140,130,180,0.14);
    --radius: 20px;
    --radius-sm: 14px;
    --radius-lg: 28px;
    --radius-xl: 36px;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

.hidden { display: none !important; }

/* ===== 启动画面 ===== */
.splash-screen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, #D4C5F0 0%, #F0C8D8 50%, #C5E0F0 100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.splash-screen.fade-out { opacity: 0; transform: scale(1.05); pointer-events: none; }
.splash-logo { text-align: center; color: #fff; animation: splashIn 0.8s ease; }
.splash-icon { font-size: 72px; margin-bottom: 16px; animation: bounce 1.5s ease infinite; }
.splash-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; letter-spacing: 1px; text-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.splash-subtitle { font-size: 13px; opacity: 0.9; letter-spacing: 2px; }
.splash-loader { margin-top: 48px; width: 160px; height: 5px; background: rgba(255,255,255,0.3); border-radius: 3px; overflow: hidden; }
.loader-bar { height: 100%; width: 40%; background: #fff; border-radius: 3px; animation: loading 1.2s ease infinite; }

@keyframes splashIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes loading { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ===== APP 容器 ===== */
.app-container {
    width: 100%; height: 100%; max-width: 430px; margin: 0 auto;
    display: flex; flex-direction: column;
    background: var(--bg); position: relative; overflow: hidden;
}
.status-bar-spacer { height: env(safe-area-inset-top, 0px); min-height: 0px; }

/* ===== 侧边栏遮罩 ===== */
.sidebar-overlay {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(45,43,61,0.35);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

/* ===== 侧边栏抽屉 ===== */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 600;
    width: 280px; max-width: 80vw;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex; flex-direction: column;
    box-shadow: 4px 0 40px rgba(140,130,180,0.15);
    border-radius: 0 28px 28px 0;
    overflow: hidden;
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
    padding: 32px 24px 20px;
    background: linear-gradient(135deg, #D4C5F0, #F0C8D8);
    color: #fff;
    text-align: center;
    border-radius: 0 0 28px 28px;
}
.sidebar-avatar { font-size: 48px; margin-bottom: 8px; display: block; }
.sidebar-name { font-size: 19px; font-weight: 700; }
.sidebar-tagline { font-size: 12px; opacity: 0.85; margin-top: 2px; }

.sidebar-nav {
    flex: 1; overflow-y: auto; padding: 12px 0;
    -webkit-overflow-scrolling: touch;
}
.sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-nav { scrollbar-width: none; }

.sidebar-section-label {
    font-size: 11px; font-weight: 700; color: var(--text-tertiary);
    padding: 16px 24px 8px; letter-spacing: 1px; text-transform: uppercase;
}

.sidebar-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 24px; margin: 2px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    border: none; background: transparent;
    width: calc(100% - 24px); font-family: inherit; font-size: 15px;
    text-align: left;
}
.sidebar-item:hover { background: #F5F0FF; }
.sidebar-item:active { transform: scale(0.97); }
.sidebar-item.active {
    background: #F5F0FF;
    color: var(--primary-dark);
    font-weight: 700;
}
.sidebar-item .sb-icon { font-size: 22px; flex-shrink: 0; width: 28px; text-align: center; }
.sidebar-item .sb-label { flex: 1; }
.sidebar-item .sb-badge {
    font-size: 11px; background: var(--primary); color: #fff;
    padding: 2px 8px; border-radius: 10px; font-weight: 600;
}

/* ===== 汉堡按钮 ===== */
.hamburger-btn {
    position: absolute; top: 16px; left: 16px; z-index: 10;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: none; cursor: pointer;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
    transition: background 0.2s;
}
.hamburger-btn:active { background: rgba(255,255,255,0.4); }
.hamburger-btn span {
    display: block; width: 18px; height: 2px;
    border-radius: 1px; background: #fff;
}

/* ===== 页面系统 ===== */
.pages-container {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; position: relative;
}
.page { display: none; animation: pageIn 0.35s ease; }
.page-active { display: block; }

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

/* ===== 页面头部 ===== */
.page-header {
    padding: 16px 20px 32px;
    color: #fff; border-radius: 0 0 32px 32px;
    position: relative; overflow: hidden;
}
.page-header::after {
    content: ''; position: absolute; top: -40px; right: -30px;
    width: 140px; height: 140px; border-radius: 50%;
    background: rgba(255,255,255,0.12);
}
.page-header::before {
    content: ''; position: absolute; bottom: -70px; left: -30px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

/* 模块专属渐变色 */
.gradient-plan { background: linear-gradient(135deg, var(--plan), var(--plan-dark)); }
.gradient-english { background: linear-gradient(135deg, var(--english), var(--english-dark)); }
.gradient-korean { background: linear-gradient(135deg, var(--korean), var(--korean-dark)); }
.gradient-reading { background: linear-gradient(135deg, var(--reading), var(--reading-dark)); }
.gradient-fitness { background: linear-gradient(135deg, var(--fitness), var(--fitness-dark)); }
.gradient-money { background: linear-gradient(135deg, var(--money), var(--money-dark)); }
.gradient-countdown { background: linear-gradient(135deg, var(--countdown), var(--countdown-dark)); }
.gradient-knowledge { background: linear-gradient(135deg, var(--knowledge), var(--knowledge-dark)); }
.gradient-inspiration { background: linear-gradient(135deg, var(--inspiration), var(--inspiration-dark)); }

.header-content {
    position: relative; z-index: 1;
    display: flex; justify-content: space-between; align-items: flex-start;
    padding-left: 40px;
}
.header-date { font-size: 13px; opacity: 0.85; margin-bottom: 4px; }
.header-title { font-size: 26px; font-weight: 700; letter-spacing: 0.5px; }
.header-subtitle { font-size: 11px; opacity: 0.75; margin-top: 4px; letter-spacing: 0.3px; }
.header-stats { display: flex; gap: 8px; }

.stat-pill {
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(10px);
    border-radius: 14px; padding: 8px 14px;
    text-align: center; min-width: 60px;
}
.stat-num { display: block; font-size: 20px; font-weight: 700; }
.stat-label { font-size: 11px; opacity: 0.85; }

/* ===== 页面主体 ===== */
.page-body { padding: 16px 16px 40px; }

/* ===== 进度条 ===== */
.progress-section {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px; background: var(--card-bg);
    padding: 14px 18px; border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.progress-bar { flex: 1; height: 10px; background: #F0EDF5; border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--plan), #A8D8EA); border-radius: 5px; transition: width 0.6s ease; }
.progress-text { font-size: 13px; color: var(--text-secondary); white-space: nowrap; font-weight: 600; }

/* ===== AI 快捷功能 ===== */
.ai-quick-actions { display: flex; gap: 12px; margin-bottom: 24px; }
.ai-action-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 8px; padding: 16px 8px; background: var(--card-bg);
    border: 2px solid transparent; border-radius: var(--radius);
    box-shadow: var(--shadow); cursor: pointer;
    transition: all 0.25s ease; font-family: inherit;
}
.ai-action-btn:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ai-action-btn:active { transform: scale(0.95); }
.ai-action-icon { font-size: 28px; transition: transform 0.2s; }
.ai-action-btn:active .ai-action-icon { transform: scale(1.2); }
.ai-action-btn span:last-child { font-size: 12px; font-weight: 600; color: var(--text); }

/* ===== 区块标题 ===== */
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; margin-top: 4px;
}
.section-header h2 { font-size: 18px; font-weight: 700; }
.add-btn {
    background: var(--primary); color: #fff; border: none;
    padding: 8px 18px; border-radius: 22px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(168,160,212,0.3);
}
.add-btn:active { transform: scale(0.93); opacity: 0.9; }

/* ===== 任务列表 ===== */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item {
    display: flex; align-items: center; gap: 14px;
    background: var(--card-bg); padding: 14px 16px;
    border-radius: var(--radius); box-shadow: var(--shadow);
    transition: all 0.25s ease;
}
.task-item:active { transform: scale(0.98); }
.task-checkbox {
    width: 26px; height: 26px; border-radius: 50%;
    border: 2.5px solid var(--border); display: flex;
    align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; transition: all 0.3s ease;
}
.task-checkbox.checked { background: var(--fitness-dark); border-color: var(--fitness-dark); }
.task-checkbox.checked::after { content: '✓'; color: #fff; font-size: 15px; font-weight: 700; }
.task-content { flex: 1; min-width: 0; }
.task-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-item.completed .task-title { text-decoration: line-through; color: var(--text-tertiary); }
.task-meta { display: flex; gap: 8px; align-items: center; }
.task-priority { font-size: 11px; padding: 3px 10px; border-radius: 8px; font-weight: 600; }
.priority-high { background: #FFE0E0; color: #E04040; }
.priority-medium { background: #FFF4E0; color: #E0931A; }
.priority-low { background: #E0F7EE; color: #00A886; }
.task-time { font-size: 12px; color: var(--text-secondary); }
.task-delete {
    width: 32px; height: 32px; border: none; background: transparent;
    font-size: 18px; color: var(--text-tertiary); cursor: pointer;
    border-radius: 10px; transition: all 0.2s;
}
.task-delete:active { background: #FFE0E0; color: #E04040; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 44px 20px; color: var(--text-secondary); }
.empty-icon { font-size: 52px; margin-bottom: 12px; opacity: 0.4; animation: float 3s ease infinite; }
.empty-state p { font-size: 15px; margin-bottom: 4px; }
.empty-hint { font-size: 13px !important; color: var(--text-tertiary); }

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

/* ===== 书籍列表 ===== */
.book-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.book-list-horizontal { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.book-list-horizontal::-webkit-scrollbar { display: none; }
.book-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    transition: all 0.25s ease; cursor: pointer;
}
.book-card:active { transform: scale(0.97); }
.book-list-horizontal .book-card { min-width: 144px; flex-shrink: 0; }
.book-cover { width: 100%; aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; font-size: 44px; position: relative; }
.book-cover-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px; background: linear-gradient(transparent, rgba(0,0,0,0.6)); color: #fff; }
.book-progress-ring { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.5); color: #fff; font-size: 11px; padding: 3px 10px; border-radius: 12px; font-weight: 600; }
.book-info { padding: 12px 14px; }
.book-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-author { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-progress-bar { height: 5px; background: #F0EDF5; border-radius: 3px; margin-top: 10px; overflow: hidden; }
.book-progress-fill { height: 100%; background: var(--reading); border-radius: 3px; transition: width 0.5s ease; }

/* ===== 健身分类标签 ===== */
.fitness-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.fitness-tab {
    flex: 1; padding: 14px 8px; border: 2px solid var(--border);
    background: var(--card-bg); border-radius: var(--radius);
    font-size: 14px; font-weight: 600; color: var(--text-secondary);
    cursor: pointer; font-family: inherit; transition: all 0.25s ease;
}
.fitness-tab.active { border-color: var(--fitness); color: var(--fitness-dark); background: #E8FBF3; }

/* ===== 运动列表 ===== */
.exercise-list { display: flex; flex-direction: column; gap: 14px; }
.exercise-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    transition: all 0.25s ease; cursor: pointer;
}
.exercise-card:active { transform: scale(0.98); }
.exercise-thumb { width: 100%; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.exercise-thumb-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 60px; }
.exercise-play {
    position: relative; z-index: 1; width: 60px; height: 60px;
    border-radius: 50%; background: rgba(255,255,255,0.9);
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transition: transform 0.2s;
}
.exercise-card:active .exercise-play { transform: scale(1.1); }
.exercise-play::after { content: '▶'; font-size: 22px; color: var(--text); margin-left: 4px; }
.exercise-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 8px; font-weight: 600; z-index: 1; }
.exercise-info { padding: 14px 16px; }
.exercise-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.exercise-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }
.exercise-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.exercise-tag { font-size: 11px; padding: 4px 10px; border-radius: 8px; background: #F0EDF5; color: var(--text-secondary); font-weight: 500; }
.exercise-tag.difficulty-easy { background: #E0F7EE; color: #00A886; }
.exercise-tag.difficulty-medium { background: #FFF4E0; color: #E0931A; }
.exercise-tag.difficulty-hard { background: #FFE0E0; color: #E04040; }

/* ===== 运动记录 ===== */
.workout-log { display: flex; flex-direction: column; gap: 8px; }
.workout-log-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card-bg); padding: 12px 16px;
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.workout-log-item:active { transform: scale(0.98); }
.workout-log-icon { width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.workout-log-info { flex: 1; }
.workout-log-name { font-size: 14px; font-weight: 600; }
.workout-log-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.workout-log-cal { font-size: 14px; font-weight: 700; color: var(--fitness-dark); }

/* ===== 语言学习区域 ===== */
.lang-progress-section { display: flex; gap: 10px; margin-bottom: 20px; }
.lang-progress-item {
    flex: 1; display: flex; align-items: center; gap: 12px;
    background: var(--card-bg); padding: 16px;
    border-radius: var(--radius); box-shadow: var(--shadow);
    transition: all 0.25s ease;
}
.lang-progress-item.done { cursor: pointer; }
.lang-progress-item.done:active { transform: scale(0.96); }
.lang-progress-item.completed { background: #E8FBF3; border: 2px solid var(--fitness); }
.lang-progress-icon { font-size: 30px; flex-shrink: 0; }
.lang-progress-info { display: flex; flex-direction: column; }
.lang-progress-label { font-size: 12px; color: var(--text-secondary); }
.lang-progress-value { font-size: 18px; font-weight: 700; }

.lang-daily-content { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.lang-lesson-card {
    padding: 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: flex-start; gap: 14px;
    cursor: pointer; transition: all 0.2s;
}
.lang-lesson-card:last-child { border-bottom: none; }
.lang-lesson-card:active { background: #F8F5FF; transform: scale(0.99); }
.lang-lesson-icon { width: 40px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.lang-lesson-info { flex: 1; }
.lang-lesson-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.lang-lesson-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

/* ===== 生词本 ===== */
.word-list { display: flex; flex-direction: column; gap: 8px; }
.word-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card-bg); padding: 14px;
    border-radius: var(--radius); box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.word-item:active { transform: scale(0.99); }
.word-item .word-text { font-size: 17px; font-weight: 700; }
.word-item .word-meaning { font-size: 14px; color: var(--text-secondary); margin-left: auto; margin-right: 8px; }
.word-item .word-delete { width: 30px; height: 30px; border: none; background: transparent; font-size: 14px; color: var(--text-tertiary); cursor: pointer; border-radius: 8px; flex-shrink: 0; }
.word-item .word-delete:active { background: #FFE0E0; color: #E04040; }

/* ===== 每日记录列表 ===== */
.daily-log-list { display: flex; flex-direction: column; gap: 8px; }
.daily-log-item {
    background: var(--card-bg); padding: 14px 16px;
    border-radius: var(--radius); box-shadow: var(--shadow);
    display: flex; gap: 10px; transition: transform 0.2s;
}
.daily-log-item:active { transform: scale(0.99); }
.daily-log-time { font-size: 11px; color: var(--text-tertiary); flex-shrink: 0; padding-top: 2px; min-width: 36px; }
.daily-log-text { font-size: 14px; color: var(--text); line-height: 1.5; flex: 1; }
.daily-log-delete { width: 30px; height: 30px; border: none; background: transparent; font-size: 14px; color: var(--text-tertiary); cursor: pointer; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.daily-log-delete:active { background: #FFE0E0; color: #E04040; }

/* ================================
   记账模块
   ================================ */
.money-summary {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    margin-bottom: 20px;
}
.money-summary-item {
    background: var(--card-bg); padding: 14px 12px;
    border-radius: var(--radius); box-shadow: var(--shadow);
    text-align: center; transition: transform 0.2s;
}
.money-summary-item:active { transform: scale(0.97); }
.money-summary-icon { font-size: 24px; margin-bottom: 4px; }
.money-summary-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 2px; }
.money-summary-value { font-size: 17px; font-weight: 700; }
.money-summary-value.income { color: #00A886; }
.money-summary-value.expense { color: #E04040; }
.money-summary-value.balance { color: var(--primary-dark); }

/* 分类快捷记账 */
.category-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-bottom: 20px;
}
.category-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 8px; background: var(--card-bg);
    border-radius: var(--radius); box-shadow: var(--shadow);
    cursor: pointer; border: 2px solid transparent;
    font-family: inherit; transition: all 0.25s ease;
}
.category-btn:hover { border-color: var(--primary); transform: translateY(-2px); }
.category-btn:active { transform: scale(0.93); }
.category-btn .cat-icon { font-size: 28px; }
.category-btn .cat-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); }

/* 交易列表 */
.transaction-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.transaction-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card-bg); padding: 14px 16px;
    border-radius: var(--radius); box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.transaction-item:active { transform: scale(0.99); }
.txn-icon {
    width: 42px; height: 42px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.txn-info { flex: 1; }
.txn-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.txn-meta { font-size: 12px; color: var(--text-secondary); }
.txn-amount { font-size: 16px; font-weight: 700; }
.txn-amount.in { color: #00A886; }
.txn-amount.out { color: #E04040; }
.txn-delete {
    width: 30px; height: 30px; border: none; background: transparent;
    font-size: 14px; color: var(--text-tertiary); cursor: pointer;
    border-radius: 8px; flex-shrink: 0;
}
.txn-delete:active { background: #FFE0E0; color: #E04040; }

/* 预算进度条 */
.budget-section { margin-bottom: 20px; }
.budget-item {
    background: var(--card-bg); padding: 14px 16px;
    border-radius: var(--radius); box-shadow: var(--shadow);
    margin-bottom: 10px;
}
.budget-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.budget-name { font-size: 14px; font-weight: 600; }
.budget-amount { font-size: 13px; color: var(--text-secondary); }
.budget-bar { height: 8px; background: #F0EDF5; border-radius: 4px; overflow: hidden; }
.budget-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.budget-fill.safe { background: var(--fitness); }
.budget-fill.warning { background: var(--reading); }
.budget-fill.danger { background: var(--korean); }

/* ================================
   倒计时模块
   ================================ */
.countdown-list { display: flex; flex-direction: column; gap: 14px; }

.countdown-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    transition: all 0.25s ease;
    position: relative;
}
.countdown-card:active { transform: scale(0.98); }

.countdown-card-header {
    padding: 16px 18px 12px;
    display: flex; justify-content: space-between; align-items: center;
}
.countdown-card-type {
    font-size: 11px; padding: 4px 12px;
    border-radius: 10px; font-weight: 600;
}
.countdown-type-birthday { background: #FFE0F0; color: #D4689A; }
.countdown-type-anniversary { background: #FFE8E0; color: #E08060; }
.countdown-type-deadline { background: #E0E8FF; color: #6878C0; }
.countdown-type-custom { background: #E8F0E8; color: #609868; }

.countdown-card-delete {
    width: 30px; height: 30px; border: none; background: transparent;
    font-size: 15px; color: var(--text-tertiary); cursor: pointer;
    border-radius: 8px;
}
.countdown-card-delete:active { background: #FFE0E0; color: #E04040; }

.countdown-card-body {
    padding: 0 18px 16px;
}
.countdown-event-name {
    font-size: 18px; font-weight: 700;
    margin-bottom: 4px; color: var(--text);
}
.countdown-event-date {
    font-size: 13px; color: var(--text-secondary);
    margin-bottom: 14px;
}

.countdown-display {
    display: flex; gap: 8px;
    justify-content: center;
    padding: 6px 0;
}
.countdown-unit {
    text-align: center; min-width: 56px;
}
.countdown-unit-value {
    font-size: 28px; font-weight: 800;
    background: #F8F5FF;
    border-radius: 14px;
    padding: 8px 4px;
    line-height: 1;
    color: var(--primary-dark);
}
.countdown-unit-label {
    font-size: 11px; color: var(--text-secondary);
    margin-top: 4px; font-weight: 600;
}
.countdown-divider {
    font-size: 24px; font-weight: 700;
    color: var(--text-tertiary);
    align-self: center; padding-bottom: 18px;
}

/* 倒计时装饰条 */
.countdown-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 4px;
}
.countdown-card.birthday::before { background: linear-gradient(90deg, #FF9AA2, #FFB7B2); }
.countdown-card.anniversary::before { background: linear-gradient(90deg, #FFCBA4, #FFDAC1); }
.countdown-card.deadline::before { background: linear-gradient(90deg, #B8A9D4, #C3B1E1); }
.countdown-card.custom::before { background: linear-gradient(90deg, #A0DFC8, #B5EAD7); }

/* ===== AI 助手浮层 ===== */
.ai-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: flex-end; justify-content: center;
    background: rgba(45,43,61,0.4);
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.ai-panel {
    width: 100%; max-width: 430px; height: 85vh;
    background: var(--bg); border-radius: 28px 28px 0 0;
    display: flex; flex-direction: column;
    animation: slideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.ai-panel-header { display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: var(--card-bg); border-bottom: 1px solid var(--border); }
.ai-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #D4C5F0); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.ai-panel-header h3 { font-size: 16px; font-weight: 700; }
.ai-status { font-size: 12px; color: var(--fitness-dark); }
.ai-close { margin-left: auto; width: 36px; height: 36px; border: none; background: #F0EDF5; border-radius: 50%; font-size: 16px; cursor: pointer; color: var(--text-secondary); }
.ai-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; -webkit-overflow-scrolling: touch; }
.ai-msg { max-width: 85%; padding: 14px 18px; border-radius: 20px; font-size: 14px; line-height: 1.7; animation: msgIn 0.3s ease; white-space: pre-wrap; word-break: break-word; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.ai-msg.ai-bot { align-self: flex-start; background: var(--card-bg); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.ai-msg.ai-user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 6px; }
.ai-typing { align-self: flex-start; background: var(--card-bg); padding: 16px; border-radius: 20px; border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.ai-typing-dots { display: flex; gap: 5px; }
.ai-typing-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--text-tertiary); animation: typingDot 1.4s ease infinite; }
.ai-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%,60%,100% { transform: scale(1); opacity: 0.4; } 30% { transform: scale(1.3); opacity: 1; } }
.ai-input-area { display: flex; gap: 8px; padding: 14px 16px; background: var(--card-bg); border-top: 1px solid var(--border); padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
#aiInput { flex: 1; height: 42px; padding: 0 18px; border: 2px solid var(--border); border-radius: 22px; font-size: 15px; outline: none; font-family: inherit; transition: border-color 0.2s; background: var(--bg); color: var(--text); }
#aiInput:focus { border-color: var(--primary); }
.ai-send { width: 42px; height: 42px; border: none; background: var(--primary); color: #fff; border-radius: 50%; font-size: 16px; cursor: pointer; flex-shrink: 0; transition: transform 0.2s; box-shadow: 0 4px 12px rgba(168,160,212,0.4); }
.ai-send:active { transform: scale(0.88); }

/* ===== 模态框 ===== */
.modal {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.25s ease;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(45,43,61,0.5); }
.modal-content {
    position: relative; width: calc(100% - 40px); max-width: 380px;
    max-height: 85vh; background: var(--card-bg);
    border-radius: var(--radius-lg); overflow: hidden;
    display: flex; flex-direction: column;
    animation: modalIn 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.88) translateY(30px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { width: 34px; height: 34px; border: none; background: #F0EDF5; border-radius: 50%; font-size: 15px; cursor: pointer; color: var(--text-secondary); }
.modal-body { padding: 20px; overflow-y: auto; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select {
    width: 100%; height: 46px; padding: 0 16px;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    font-size: 15px; outline: none; font-family: inherit;
    transition: border-color 0.2s; background: var(--bg); color: var(--text);
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }
.form-group textarea { outline: none; transition: border-color 0.2s; }
.form-group textarea:focus { border-color: var(--primary) !important; }

.priority-selector { display: flex; gap: 8px; }
.priority-btn {
    flex: 1; height: 40px; border: 2px solid var(--border);
    background: var(--card-bg); border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: all 0.2s; color: var(--text-secondary);
}
.priority-btn.active { border-color: var(--primary); background: #F0EDFF; color: var(--primary-dark); }

.modal-submit-btn {
    width: 100%; height: 50px; border: none;
    background: linear-gradient(135deg, var(--primary), #C3B1E1);
    color: #fff; border-radius: var(--radius-sm);
    font-size: 16px; font-weight: 700; cursor: pointer;
    font-family: inherit; margin-top: 8px;
    transition: all 0.2s; box-shadow: 0 4px 16px rgba(168,160,212,0.35);
}
.modal-submit-btn:active { transform: scale(0.96); opacity: 0.9; }

/* ===== 交易类型切换 ===== */
.type-selector { display: flex; gap: 0; margin-bottom: 16px; }
.type-btn {
    flex: 1; height: 42px; border: 2px solid var(--border);
    background: var(--card-bg); font-size: 15px; font-weight: 600;
    cursor: pointer; font-family: inherit; transition: all 0.2s;
    color: var(--text-secondary);
}
.type-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.type-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.type-btn.active.income { border-color: var(--fitness-dark); background: #E8FBF3; color: var(--fitness-dark); }
.type-btn.active.expense { border-color: var(--korean-dark); background: #FFE8EC; color: var(--korean-dark); }

/* ===== 视频模态框 ===== */
.video-modal-content { position: relative; width: 100%; max-width: 430px; max-height: 90vh; background: var(--card-bg); border-radius: 0; display: flex; flex-direction: column; animation: modalIn 0.3s ease; overflow: hidden; }
.video-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #1A1A1A; color: #fff; }
.video-header h3 { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-close { width: 32px; height: 32px; border: none; background: rgba(255,255,255,0.15); border-radius: 50%; font-size: 14px; cursor: pointer; color: #fff; flex-shrink: 0; margin-left: 12px; }
.video-wrapper { width: 100%; aspect-ratio: 16/9; background: #000; }
.video-wrapper iframe { width: 100%; height: 100%; border: none; }
.video-info { padding: 16px; overflow-y: auto; flex: 1; }
.video-info p { font-size: 14px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 12px; }
.video-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.video-complete-btn { margin: 0 16px 20px; height: 50px; border: none; background: linear-gradient(135deg, var(--fitness), var(--fitness-dark)); color: #fff; border-radius: var(--radius-sm); font-size: 16px; font-weight: 700; cursor: pointer; font-family: inherit; transition: transform 0.2s; box-shadow: 0 4px 16px rgba(125,207,179,0.35); }
.video-complete-btn:active { transform: scale(0.96); }
.video-bilibili-btn { margin: 0 16px 8px; height: 44px; border: 2px solid var(--bili-pink, #FB7299); background: #fff; color: var(--bili-pink, #FB7299); border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; transition: transform 0.2s, background 0.2s; }
.video-bilibili-btn:active { transform: scale(0.96); background: #FFF0F5; }

.exercise-meta-row { display: flex; gap: 12px; margin-bottom: 4px; font-size: 12px; color: var(--text-tertiary); }
.exercise-author { color: var(--text-secondary); }
.exercise-plays { color: var(--bili-pink, #FB7299); font-weight: 600; }

/* ===== Toast ===== */
.toast {
    position: fixed; bottom: 60px; left: 50%;
    transform: translateX(-50%);
    background: rgba(45,43,61,0.88); color: #fff;
    padding: 14px 28px; border-radius: 28px;
    font-size: 14px; z-index: 3000;
    animation: toastIn 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    white-space: nowrap; backdrop-filter: blur(10px);
    font-weight: 600;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(24px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ===== 滚动条 ===== */
.pages-container::-webkit-scrollbar { display: none; }
.pages-container { scrollbar-width: none; }

/* ===== 公共知识模块 ===== */
.knowledge-page-body { background: #F5F7F3; min-height: calc(100vh - 180px); }

.knowledge-update-banner {
    display: flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, #E8F0E6, #DDE9DA);
    border-radius: 14px; padding: 10px 16px;
    margin-bottom: 14px;
    border-left: 3px solid var(--knowledge);
    animation: fadeSlideUp 0.5s ease;
}
.knowledge-update-banner .banner-icon { font-size: 18px; }
.knowledge-update-banner .banner-text { font-size: 12px; color: #4A6B4E; font-weight: 600; }

/* 领域标签网格 */
.domain-chips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.domain-chip {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 14px 6px;
    background: #fff;
    border: 2px solid #E0E8DC;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    animation: fadeSlideUp 0.4s ease;
}
.domain-chip:active { transform: scale(0.95); }
.domain-chip .chip-icon { font-size: 24px; }
.domain-chip .chip-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.domain-chip.active {
    background: var(--chip-color, var(--knowledge));
    border-color: var(--chip-color, var(--knowledge));
    box-shadow: 0 4px 14px rgba(91,124,95,0.25);
}
.domain-chip.active .chip-name { color: #fff; }

/* 知识卡片 */
.knowledge-list { display: flex; flex-direction: column; gap: 14px; }

.knowledge-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 3px 14px rgba(74,107,78,0.07);
    border-left: 4px solid var(--card-accent, var(--knowledge));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeSlideUp 0.5s ease;
    position: relative;
    overflow: hidden;
}
.knowledge-card:active { transform: scale(0.98); }
.knowledge-card-top { margin-bottom: 10px; }
.knowledge-domain-badge {
    display: inline-flex; align-items: center; gap: 4px;
    color: #fff; font-size: 11px; font-weight: 700;
    padding: 4px 12px; border-radius: 16px;
    background: var(--card-accent, var(--knowledge));
    letter-spacing: 0.5px;
}
.knowledge-card-title {
    font-size: 17px; font-weight: 700; color: var(--text);
    margin-bottom: 10px; line-height: 1.4;
}
.knowledge-card-content {
    font-size: 14px; line-height: 1.75; color: var(--text-secondary);
    text-align: justify;
}
.knowledge-card-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #DDE5D8, transparent);
    margin: 14px 0 10px;
}
.knowledge-card-source {
    font-size: 12px; color: #7A8E6E;
    font-style: italic;
    margin-bottom: 8px;
}
.knowledge-card-resources {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.knowledge-card-resources .resources-label {
    font-size: 11px; color: var(--text-tertiary); font-weight: 600;
}
.resource-tag {
    display: inline-block;
    font-size: 11px; font-weight: 500;
    padding: 3px 10px; border-radius: 12px;
    background: #EEF3EB; color: #5A7D4E;
}

/* ===== 写作灵感模块 ===== */
.inspiration-page-body { background: #F5F7F3; min-height: calc(100vh - 180px); }

.inspire-list { display: flex; flex-direction: column; gap: 14px; }

.inspire-card {
    background: #fff;
    border-radius: 20px;
    padding: 22px 20px;
    box-shadow: 0 3px 14px rgba(74,107,78,0.07);
    border-left: 4px solid var(--inspiration);
    animation: fadeSlideUp 0.5s ease;
    position: relative;
    overflow: hidden;
}
.inspire-card:active { transform: scale(0.98); }
.inspire-card::before {
    content: '';
    position: absolute; top: -20px; right: -20px;
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(107,142,94,0.06);
}
.inspire-card-tag {
    display: inline-block;
    font-size: 11px; font-weight: 600;
    padding: 4px 12px; border-radius: 14px;
    background: #EEF3EB; color: #5A7D4E;
    margin-bottom: 12px;
}
.inspire-card-title {
    font-size: 17px; font-weight: 700; color: var(--text);
    margin-bottom: 12px; line-height: 1.4;
    position: relative; z-index: 1;
}
.inspire-card-body {
    display: flex; gap: 6px;
    background: linear-gradient(135deg, #F5F8F2, #EEF3EB);
    border-radius: 14px;
    padding: 16px 16px 16px 14px;
    margin-bottom: 12px;
    position: relative; z-index: 1;
}
.inspire-quote-mark {
    font-size: 32px; font-family: Georgia, serif;
    color: var(--inspiration);
    line-height: 0.8; opacity: 0.5;
    flex-shrink: 0;
}
.inspire-card-text {
    font-size: 14px; line-height: 1.8; color: var(--text);
    font-weight: 500;
    text-align: justify;
}
.inspire-card-meta {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 10px;
    position: relative; z-index: 1;
}
.inspire-author {
    font-size: 13px; font-weight: 600; color: var(--text);
}
.inspire-source {
    font-size: 12px; color: var(--text-tertiary);
    font-style: italic;
}
.inspire-card-resources {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding-top: 8px;
    border-top: 1px dashed #DDE5D8;
}
.inspire-card-resources .resources-label {
    font-size: 11px; color: var(--text-tertiary); font-weight: 600;
}

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