/* ==================== CSS变量 - 浅色主题 ==================== */
:root {
    --primary: #667eea;
    --primary-light: #764ba2;
    --secondary: #f093fb;
    --success: #4facfe;
    --warning: #fa709a;
    --danger: #f5576c;
    
    --bg-primary: #f5f7fa;
    --bg-card: #ffffff;
    --bg-secondary: #f8f9fc;
    --bg-input: #f0f2f5;
    
    --text-primary: #2c3e50;
    --text-secondary: #606c88;
    --text-muted: #95a5a6;
    --text-inverse: #ffffff;
    
    --border-color: #e8ecf1;
    --shadow-sm: 0 2px 8px rgba(102, 126, 234, 0.08);
    --shadow-md: 0 4px 16px rgba(102, 126, 234, 0.12);
    --shadow-lg: 0 8px 24px rgba(102, 126, 234, 0.16);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --header-height: 56px;
    --nav-height: 64px;
    --status-bar-height: env(safe-area-inset-top);
}

/* ==================== CSS变量 - 深色主题 ==================== */
[data-theme="dark"] {
    --primary: #7c8ff7;
    --primary-light: #8b5cf6;
    --secondary: #a855f7;
    --success: #3b82f6;
    --warning: #ec4899;
    --danger: #ef4444;
    
    --bg-primary: #0f172a;
    --bg-card: #1e293b;
    --bg-secondary: #334155;
    --bg-input: #475569;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --border-color: #334155;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ==================== 重置样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ==================== 应用容器 ==================== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    padding-bottom: calc(var(--nav-height) + 20px);
    box-shadow: var(--shadow-lg);
}

/* ==================== 顶部状态栏 ==================== */
.app-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--header-height);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-date {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.icon-btn:active {
    transform: scale(0.92);
    background: var(--bg-input);
}

.icon-btn svg {
    width: 22px;
    height: 22px;
}

#themeToggle .icon-moon { display: none; }
[data-theme="dark"] #themeToggle .icon-sun { display: none; }
[data-theme="dark"] #themeToggle .icon-moon { display: block; }

/* ==================== 主内容区 ==================== */
.main-content {
    padding-top: calc(var(--header-height) + 10px);
    min-height: calc(100vh - var(--header-height) - var(--nav-height));
}

.tab-content {
    display: none;
    padding: 16px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== 底部导航 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--nav-height);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
    transition: background-color 0.3s ease;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px 4px;
    position: relative;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    transition: all 0.2s ease;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active svg {
    transform: scale(1.1);
}

.nav-item:active {
    transform: scale(0.95);
}

/* ==================== 卡片样式 ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}

.card-action {
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.card-action:active {
    background: var(--bg-input);
}

/* ==================== 日期信息卡片 ==================== */
.date-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-inverse);
    padding: 20px;
    border-radius: var(--radius-xl);
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

.date-card .date-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.date-card .date-day {
    font-size: 2.5rem;
    font-weight: 700;
}

.date-card .date-ym {
    font-size: 1rem;
    opacity: 0.9;
}

.date-card .date-week {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 12px;
}

.date-card .date-lunar {
    font-size: 0.85rem;
    opacity: 0.9;
}

.date-card .date-huangli {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.date-card .huangli-item {
    font-size: 0.8rem;
}

.date-card .huangli-label {
    opacity: 0.7;
    margin-right: 4px;
}

/* ==================== 天气卡片 ==================== */
.weather-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: var(--text-inverse);
    padding: 20px;
    border-radius: var(--radius-xl);
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .weather-card {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.weather-temp {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.weather-info {
    text-align: right;
}

.weather-condition {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.weather-city {
    font-size: 0.85rem;
    opacity: 0.8;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.weather-detail-item {
    text-align: center;
}

.weather-detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.weather-detail-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 2px;
}

.weather-tips {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    line-height: 1.5;
}

.weather-tips-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.weather-tips-item {
    margin-bottom: 2px;
}

/* ==================== 待办清单 ==================== */
.todo-input-area {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.todo-input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.todo-input:focus {
    background: var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary);
}

.todo-priority {
    width: 44px;
    height: 44px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.todo-priority[data-priority="high"] { color: var(--danger); }
.todo-priority[data-priority="medium"] { color: var(--warning); }
.todo-priority[data-priority="low"] { color: var(--success); }

.todo-add-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-md);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.todo-add-btn:active {
    transform: scale(0.92);
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: grab;
}

.todo-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.todo-item.drag-over {
    border-top: 2px solid var(--primary);
}

.todo-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.todo-item.completed .todo-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.todo-item.completed .todo-checkbox::after {
    content: '✓';
    color: white;
    font-size: 14px;
}

.todo-content {
    flex: 1;
    min-width: 0;
}

.todo-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    word-break: break-all;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.priority-badge {
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.priority-badge.high { background: rgba(245, 87, 108, 0.15); color: var(--danger); }
.priority-badge.medium { background: rgba(250, 112, 154, 0.15); color: var(--warning); }
.priority-badge.low { background: rgba(79, 172, 254, 0.15); color: var(--success); }

.todo-actions {
    display: flex;
    gap: 4px;
}

.todo-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.todo-action-btn:active {
    background: var(--bg-input);
    color: var(--text-primary);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.9rem;
}

/* ==================== 习惯打卡 ==================== */
.habit-section {
    margin-bottom: 16px;
}

.habit-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.habit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.habit-name {
    font-weight: 600;
    color: var(--text-primary);
}

.habit-progress {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.water-tracker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.water-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.water-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.water-btn:active {
    transform: scale(0.95);
}

.water-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.water-goal {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.water-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.water-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.water-undo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 8px;
}

.water-undo:active {
    color: var(--primary);
}

.wash-habit-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wash-habit-item {
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.wash-habit-item.completed {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-inverse);
}

.wash-habit-item:active {
    transform: scale(0.95);
}

/* ==================== 快捷入口 ==================== */
.quick-entries {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.quick-entry:active {
    transform: scale(0.95);
    background: var(--bg-input);
}

.quick-entry-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
}

.quick-entry-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ==================== 每日一句 ==================== */
.daily-quote {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: var(--radius-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .daily-quote {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
}

.daily-quote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 4rem;
    color: rgba(102, 126, 234, 0.2);
    font-family: Georgia, serif;
}

.daily-quote-content {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 8px;
    font-weight: 500;
}

.daily-quote-author {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== 工具板块 ==================== */
.tool-section {
    margin-bottom: 20px;
}

.tool-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.tool-section-header:active {
    transform: scale(0.99);
}

.tool-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tool-section-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.tool-section-arrow {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.tool-section.expanded .tool-section-arrow {
    transform: rotate(180deg);
}

.tool-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.tool-section.expanded .tool-section-content {
    max-height: 2000px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 0;
}

.tool-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.tool-item:active {
    transform: scale(0.98);
    background: var(--bg-secondary);
}

.tool-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tool-item-info {
    flex: 1;
    min-width: 0;
}

.tool-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tool-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== 通用按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-inverse);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--warning));
    color: var(--text-inverse);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    background: var(--bg-card);
    box-shadow: 0 0 0 2px var(--primary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ==================== 统计卡片 ==================== */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.chart-container {
    width: 100%;
    height: 200px;
    margin-top: 12px;
}

/* ==================== 设置项 ==================== */
.settings-group {
    margin-bottom: 20px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}

.settings-label {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.settings-value {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 开关组件 */
.switch {
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.switch.active {
    background: var(--primary);
}

.switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch.active::after {
    transform: translateX(20px);
}

/* ==================== Toast提示 ==================== */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: auto;
    max-width: 300px;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { background: rgba(47, 193, 103, 0.95); }
.toast.error { background: rgba(231, 76, 60, 0.95); }
.toast.warning { background: rgba(241, 196, 15, 0.95); }

/* ==================== 模态框 ==================== */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-container.show {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.modal-close:active {
    background: var(--bg-input);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ==================== 骨架屏 ==================== */
.skeleton-container {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 2000;
    display: none;
    padding: calc(var(--header-height) + 16px) 16px;
    overflow-y: auto;
}

.skeleton-container.show {
    display: block;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--border-color) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== 日历弹窗 ==================== */
.calendar {
    padding: 16px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.calendar-nav:active {
    background: var(--bg-input);
}

.calendar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 8px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.calendar-day:active {
    background: var(--bg-input);
}

.calendar-day.other-month {
    color: var(--text-muted);
    opacity: 0.5;
}

.calendar-day.today {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.calendar-day.selected {
    background: var(--primary-light);
    color: white;
}

.calendar-day.has-data::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: var(--success);
    border-radius: 50%;
}

/* ==================== 计算器 ==================== */
.calculator {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.calc-display {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    text-align: right;
}

.calc-expression {
    font-size: 1rem;
    color: var(--text-muted);
    min-height: 24px;
    margin-bottom: 8px;
    word-break: break-all;
}

.calc-result {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calc-btn {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.calc-btn:active {
    transform: scale(0.95);
    background: var(--bg-input);
}

.calc-btn.operator {
    background: var(--primary);
    color: white;
}

.calc-btn.function {
    background: var(--bg-input);
    color: var(--secondary);
}

.calc-btn.equal {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

/* ==================== 收支记录 ==================== */
.balance-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-inverse);
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 16px;
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.balance-title {
    font-size: 0.9rem;
    opacity: 0.9;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
}

.balance-detail {
    display: flex;
    justify-content: space-around;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.balance-item {
    text-align: center;
}

.balance-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.balance-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-category {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.transaction-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.transaction-amount {
    font-size: 1.1rem;
    font-weight: 600;
}

.transaction-amount.income { color: var(--success); }
.transaction-amount.expense { color: var(--danger); }

/* ==================== 日记列表 ==================== */
.diary-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.diary-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.diary-content {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 8px;
    word-break: break-all;
}

.diary-images {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.diary-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.diary-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.diary-tag {
    padding: 4px 10px;
    background: var(--bg-input);
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ==================== 图表 ==================== */
.chart-bar {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 150px;
    padding: 10px 0;
}

.chart-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.chart-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.chart-bar-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chart-line {
    width: 100%;
    height: 150px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 360px) {
    html { font-size: 13px; }
    .quick-entries { grid-template-columns: repeat(3, 1fr); }
    .stat-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 481px) {
    .app-container {
        border-radius: 0;
    }
}

/* ==================== 动效 ==================== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.animate-pulse { animation: pulse 2s infinite; }
.animate-bounce { animation: bounce 0.5s ease; }

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* ==================== 选择日期按钮 ==================== */
.date-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.date-picker-btn:active {
    background: var(--border-color);
}

/* ==================== 分类标签 ==================== */
.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-input);
    color: var(--text-secondary);
}

.category-tag.selected {
    background: var(--primary);
    color: white;
}

.category-tag:active {
    transform: scale(0.95);
}

/* ==================== 分割线 ==================== */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 16px 0;
}

/* ==================== 提示文字 ==================== */
.hint-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==================== 标签页标题 ==================== */
.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}