/* ==================== CSS变量 - 浅色主题 ==================== */
:root {
    --primary: #1abc9c;
    --primary-light: #2ee0bf;
    --calendar-purple: #8b7cf7;
    --todo-green: #52c8a0;
    --health-cyan: #4ec5c1;
    --diary-orange: #f5a623;
    --dream-purple: #a78bfa;
    --expense-red: #ef4444;
    --income-green: #10b981;
    
    --bg-page: #f7f8fa;
    --bg-sidebar: #f1f3f7;
    --bg-card: #ffffff;
    --bg-secondary: #f5f6fa;
    --bg-input: #ffffff;
    
    --text-primary: #1a1d24;
    --text-secondary: #5a6070;
    --text-muted: #8a90a0;
    --text-inverse: #ffffff;
    
    --border-color: #e5e8ef;
    --border-light: #eef1f6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    
    --header-height: 52px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 60px;
}

/* ==================== CSS变量 - 深色主题 ==================== */
[data-theme="dark"] {
    --bg-page: #151820;
    --bg-sidebar: #11141a;
    --bg-card: #1e222c;
    --bg-secondary: #262b36;
    --bg-input: #2a303c;
    
    --text-primary: #f0f2f5;
    --text-secondary: #b0b6c2;
    --text-muted: #6e7686;
    --text-inverse: #1a1d24;
    
    --border-color: #2e3440;
    --border-light: #262b36;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ==================== 重置样式 ==================== */
* {
    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-page);
    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;
}

/* ==================== 工作台布局 ==================== */
.workspace {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, transform 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-nav-item span,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sd-month,
.sidebar.collapsed .sd-week,
.sidebar.collapsed .sd-lunar,
.sidebar.collapsed .sd-huangli,
.sidebar.collapsed .overview-card,
.sidebar.collapsed .sidebar-date-card .date-info {
    display: none;
}

.sidebar.collapsed .sidebar-date-card {
    padding: 12px 8px;
}

.sidebar.collapsed .sd-day {
    font-size: 1.5rem;
    text-align: center;
}

/* 侧边栏头部 */
.sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.brand-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.brand-text {
    overflow: hidden;
    white-space: nowrap;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

/* 侧边栏内容 */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

/* 侧边栏分区 */
.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding: 0 8px;
}

/* 日期卡片 - 白色背景，不使用彩色渐变 */
.sidebar-date-card {
    background: var(--bg-card);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.sd-date-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.sd-day {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.sd-month {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sd-week {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.sd-lunar {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.sd-huangli {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sd-huangli b {
    font-weight: 600;
    color: var(--text-secondary);
}

/* 导航菜单 - 移除彩色长条，使用简约列表 */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 500;
}

.sidebar-nav-item.active .nav-indicator {
    opacity: 1;
}

.sidebar-nav-item .nav-indicator {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 导航项图标颜色 - 使用低饱和区分色 */
.nav-icon-calendar { color: var(--calendar-purple); }
.nav-icon-tools { color: var(--primary); }
.nav-icon-stats { color: var(--todo-green); }
.nav-icon-settings { color: var(--health-cyan); }

.sidebar-nav-item span {
    font-size: 0.88rem;
    white-space: nowrap;
}

/* 概览卡片 */
.overview-card {
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.overview-item {
    margin-bottom: 10px;
}

.overview-item:last-child {
    margin-bottom: 0;
}

.overview-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.overview-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0;
}

.progress-fill.water {
    background: var(--primary-light);
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: right;
}

.overview-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== 主内容区 ==================== */
.main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.workspace.sidebar-collapsed .main-area {
    margin-left: var(--sidebar-collapsed-width);
}

/* 顶部工具栏 */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    background: var(--bg-page);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.header-menu-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.header-menu-btn svg {
    width: 22px;
    height: 22px;
}

.current-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.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:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.icon-btn:active {
    transform: scale(0.92);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

#themeToggle .icon-moon { display: none; }
[data-theme="dark"] #themeToggle .icon-sun { display: none; }
[data-theme="dark"] #themeToggle .icon-moon { display: block; }

/* 应用容器 */
.app-container {
    flex: 1;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 16px 16px 40px;
}

/* 主内容区 */
.main-content {
    min-height: calc(100vh - var(--header-height));
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==================== 分组标题 ==================== */
.section-group {
    margin-bottom: 28px;
}

.section-group-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 0 4px;
    letter-spacing: 0.3px;
}

/* ==================== 卡片样式 ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title-icon {
    font-size: 1.1rem;
}

.card-title-icon.calendar { color: var(--calendar-purple); }
.card-title-icon.todo { color: var(--todo-green); }
.card-title-icon.health { color: var(--health-cyan); }
.card-title-icon.diary { color: var(--diary-orange); }
.card-title-icon.dream { color: var(--dream-purple); }
.card-title-icon.expense { color: var(--expense-red); }
.card-title-icon.income { color: var(--income-green); }
.card-title-icon.tools { color: var(--primary); }

.card-action {
    color: var(--primary);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.card-action:hover {
    background: var(--bg-secondary);
}

/* ==================== 日期信息卡片 ==================== */
.date-card {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}

.date-card .date-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.date-card .date-day {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.date-card .date-ym {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.date-card .date-week {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.date-card .date-lunar {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.date-card .date-huangli {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.date-card .huangli-item {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.date-card .huangli-label {
    margin-right: 4px;
}

/* ==================== 待办清单 ==================== */
.todo-input-area {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.todo-input {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.todo-input:focus {
    background: var(--bg-card);
    border: 1px solid var(--primary);
}

.todo-priority {
    width: 42px;
    height: 42px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.todo-priority[data-priority="high"] { color: var(--expense-red); }
.todo-priority[data-priority="medium"] { color: var(--diary-orange); }
.todo-priority[data-priority="low"] { color: var(--todo-green); }

.todo-add-btn {
    width: 42px;
    height: 42px;
    background: var(--primary);
    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: 6px;
}

/* ==================== 侧边栏遮罩 ==================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* ==================== Toast提示 ==================== */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 0.88rem;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s forwards;
}

.toast.success { background: var(--income-green); color: white; }
.toast.error { background: var(--expense-red); color: white; }
.toast.warning { background: var(--diary-orange); color: white; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-20px); }
}

/* ==================== 模态框 ==================== */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.modal-container.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 380px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.modal-body {
    padding: 18px 20px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
}

.modal-footer .btn {
    flex: 1;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 188, 156, 0.25);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-input);
}

.btn-danger {
    background: var(--expense-red);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
    line-height: 1.5;
}

/* ==================== 单位切换器 ==================== */
.unit-switch {
    display: inline-flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.unit-option {
    padding: 5px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: calc(var(--radius-sm) - 2px);
    transition: all 0.2s ease;
    user-select: none;
}

.unit-option:hover {
    color: var(--text-primary);
}

.unit-option.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 6px rgba(26, 188, 156, 0.3);
}

/* ==================== 列表条目样式 ==================== */
.list-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.list-item:hover {
    border-color: var(--border-color);
}

.list-item-main {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.list-item-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.list-item-action {
    flex-shrink: 0;
    margin-left: 10px;
}

/* 待办项 */
.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    margin-bottom: 6px;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: #fff;
}

.todo-item.completed .todo-checkbox {
    background: var(--primary);
    border-color: var(--primary);
}

.todo-item.completed .todo-checkbox::before {
    content: '✓';
}

.todo-text {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.todo-priority-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.todo-priority-tag.high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--expense-red);
}

.todo-priority-tag.medium {
    background: rgba(245, 166, 35, 0.1);
    color: var(--diary-orange);
}

.todo-priority-tag.low {
    background: rgba(82, 200, 160, 0.1);
    color: var(--todo-green);
}

/* ==================== 习惯打卡 ==================== */
.habit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.habit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 6px;
}

.habit-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.habit-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.habit-name {
    font-size: 0.88rem;
    color: var(--text-primary);
    font-weight: 500;
}

.habit-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.habit-check {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.habit-check.done {
    background: var(--todo-green);
    border-color: var(--todo-green);
    color: white;
}

/* ==================== 统一复选方框 ==================== */
.check-box {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: #fff;
    background: transparent;
}

.check-box.checked {
    background: var(--primary);
    border-color: var(--primary);
}

/* ==================== 洗漱打卡 ==================== */
.wash-habit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wash-habit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
}

.wash-habit-item:hover {
    background: var(--bg-secondary);
}

.wash-habit-item.completed {
    opacity: 0.6;
}

.wash-habit-item.completed .wash-habit-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.wash-habit-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.wash-habit-name {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-primary);
}

/* ==================== 家务打卡 ==================== */
.housework-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.house-task {
    position: relative;
    padding: 14px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.house-task:hover {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.house-task.done {
    background: rgba(82, 200, 160, 0.08);
    border-color: var(--todo-green);
}

.house-task-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.house-task-name {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 500;
}

.house-task-status {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.house-task.done .house-task-status {
    color: var(--todo-green);
}

.house-task-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--expense-red);
    color: #fff;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

/* ==================== 饮水记录 ==================== */
.water-tracker {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.water-display {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.water-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.water-unit {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.water-goal {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.water-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.water-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.water-btn:active {
    background: var(--primary);
    color: white;
}

.water-btn span {
    font-size: 1.2rem;
}

.water-btn small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-card {
    background: var(--bg-card);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 768px) {
    :root {
        --header-height: 48px;
    }
    
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-area {
        margin-left: 0;
    }
    
    .workspace.sidebar-collapsed .main-area {
        margin-left: 0;
    }
    
    .header-menu-btn {
        display: flex;
    }
    
    .app-container {
        max-width: 100%;
        padding: 12px 14px 32px;
    }
    
    .current-date {
        font-size: 0.82rem;
    }
    
    .card {
        padding: 14px;
        margin-bottom: 10px;
    }
    
    .card-title {
        font-size: 0.95rem;
    }
    
    .date-card .date-day {
        font-size: 1.8rem;
    }
    
    .water-amount {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .list-item, .todo-item, .habit-item {
        padding: 10px 12px;
    }
    
    .list-item-title, .todo-text, .habit-name {
        font-size: 0.85rem;
    }
    
    .list-item-desc, .habit-desc {
        font-size: 0.72rem;
    }
    
    .section-group-title {
        font-size: 0.78rem;
        margin-bottom: 8px;
    }
}

/* 平板尺寸 */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    :root {
        --sidebar-width: 220px;
    }
    
    .app-container {
        max-width: 100%;
    }
}

/* 大屏优化 */
@media (min-width: 1440px) {
    .app-container {
        max-width: 760px;
    }
}

/* ==================== 工具合集页样式 ==================== */
.tool-section {
    margin-bottom: 16px;
}

.tool-section-header {
    background: transparent;
    padding: 6px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    border-radius: var(--radius-md);
}

.tool-section-header:hover {
    opacity: 0.8;
}

.tool-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.tool-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.tool-section-title span {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

/* 侧边栏日期卡片强制白色背景 */
#sidebarDateCard {
    background-color: #ffffff !important;
}

/* 特定板块样式调整 */
#section-bills .tool-section-title span,
#section-health .tool-section-title span,
#section-diary .tool-section-title span,
#section-study .tool-section-title span,
#section-life .tool-section-title span {
    font-size: 16px !important;
}

/* 板块标题背景色 */
#section-bills .tool-section-title {
    background-color: rgba(234, 179, 8, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0;
}

#section-health .tool-section-title {
    background-color: rgba(34, 197, 94, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0;
}

#section-diary .tool-section-title {
    background-color: rgba(239, 68, 68, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0;
}

#section-study .tool-section-title {
    background-color: rgba(168, 85, 247, 0.5);
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0;
}

#section-life .tool-section-title {
    background-color: #a0c0ac;
    padding: 4px 10px;
    border-radius: 6px;
    margin: 0;
}

#section-study .tool-section-header {
    font-size: 13px;
}

.tool-section-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    padding-right: 4px;
}

.tool-section.expanded .tool-section-arrow {
    transform: rotate(180deg);
}

.tool-section-content {
    display: none;
    padding: 4px 0 0 0;
}

.tool-section.expanded .tool-section-content {
    display: block;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.tool-item {
    background: var(--bg-card);
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.tool-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.tool-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.tool-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tool-item-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.tool-item-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: left;
}

/* 移动端工具网格 */
@media (max-width: 480px) {
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .tool-section-icon {
        width: 28px;
        height: 28px;
        font-size: 0.95rem;
    }
    .tool-item {
        padding: 14px 14px;
        gap: 10px;
    }
    .tool-item-icon {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }
    .tool-item-name {
        font-size: 0.88rem;
    }
    .tool-item-desc {
        font-size: 0.72rem;
    }
}

/* ==================== 记录页样式 ==================== */
.record-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}

.record-tab {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-align: center;
}

.record-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ==================== 设置页样式 ==================== */
.settings-section {
    margin-bottom: 20px;
}

.settings-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s ease;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background: var(--bg-secondary);
}

.settings-item-icon {
    font-size: 1.2rem;
    margin-right: 12px;
}

.settings-item-main {
    flex: 1;
}

.settings-item-title {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.settings-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.settings-item-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== 数据清理页样式 ==================== */
.cleanup-stats {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.cleanup-stat {
    text-align: center;
}

.cleanup-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.cleanup-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.cleanup-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
}

.cleanup-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}

.cleanup-option-title {
    font-size: 0.88rem;
    color: var(--text-primary);
}

.cleanup-option-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cleanup-option-count {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 500;
}

/* 复选框样式 */
.custom-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox input[type="checkbox"] {
    display: none;
}

.custom-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.custom-checkbox.indeterminate {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox.indeterminate::after {
    content: '−';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.list-item.selected {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

/* ==================== 标签检索样式 ==================== */
.tag-search {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.tag-search input {
    flex: 1;
    height: 40px;
    padding: 0 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-item {
    padding: 4px 12px;
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-item.active,
.tag-item:hover {
    background: var(--primary);
    color: white;
}

/* ==================== 骨架屏 ==================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-light) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 80%;
    margin-bottom: 0;
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* ==================== 空状态 ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: 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.88rem;
}

.empty-state-action {
    margin-top: 16px;
}

/* ==================== 生理期月历视图 ==================== */
.period-card {
    padding: 16px;
}

.period-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.summary-item {
    flex: 1;
    text-align: center;
}

.summary-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.summary-unit {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 2px;
}

.summary-sub {
    font-size: 0.7rem;
    color: var(--primary);
    margin-top: 2px;
}

.summary-divider {
    width: 1px;
    height: 32px;
    background: var(--border-light);
}

.period-range {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.range-values {
    color: var(--text-secondary);
    font-weight: 500;
}

/* 月历导航 */
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cal-nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cal-nav-btn:active {
    background: var(--bg-secondary);
}

.cal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 日历网格 */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-weekday {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 6px 0;
    font-weight: 500;
}

.cal-cell {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
    background: var(--bg-secondary);
    min-height: 40px;
}

.cal-cell.empty {
    background: transparent;
    cursor: default;
}

.cal-cell:active {
    background: var(--bg-hover, rgba(0, 0, 0, 0.05));
}

.cal-day {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1;
}

.cal-cell.today {
    background: var(--primary);
}

.cal-cell.today .cal-day {
    color: white;
    font-weight: 600;
}

.cal-cell.period {
    background: rgba(220, 100, 100, 0.12);
}

.cal-cell.period .cal-day {
    color: #c85a5a;
}

.cal-cell.predicted {
    background: rgba(220, 100, 100, 0.05);
    border: 1px dashed rgba(220, 100, 100, 0.3);
}

/* 日历圆点标记 */
.cal-dot {
    position: absolute;
    bottom: 4px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.cal-dot.period {
    background: #d4646a;
    left: 50%;
    transform: translateX(-50%);
}

.cal-dot.symptom {
    background: var(--calendar-purple, #8b7cf7);
    right: 6px;
}

/* 图例 */
.period-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.period-dot {
    background: #d4646a;
}

.legend-dot.symptom-dot {
    background: var(--calendar-purple, #8b7cf7);
}

.legend-dot.predicted-dot {
    background: transparent;
    border: 1px dashed rgba(220, 100, 100, 0.4);
}

/* 日期弹窗 */
.period-day-modal {
    padding: 4px 0;
}

.period-day-section {
    margin-bottom: 18px;
}

.period-day-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.period-day-actions {
    display: flex;
    gap: 8px;
}

.period-tag-info {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #c85a5a;
}

.symptom-list-mini {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.symptom-item-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.symptom-part {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.symptom-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.symptom-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 8px 0;
}

/* 手机端适配 */
@media (max-width: 768px) {
    .period-summary {
        padding: 12px 8px;
    }

    .summary-value {
        font-size: 1rem;
    }

    .cal-cell {
        min-height: 38px;
    }

    .cal-day {
        font-size: 0.78rem;
    }

    .period-legend {
        gap: 14px;
    }
}

/* ==================== 开关组件 ==================== */
.toggle-switch {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--border-light, #ccc);
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch.on {
    background: var(--primary);
}

.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch.on .toggle-knob {
    transform: translateX(20px);
}

.period-reminder-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.period-reminder-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== 艾宾浩斯复习曲线 ==================== */
.ebh-curve-section {
    margin-bottom: 16px;
}

.ebh-section {
    margin-bottom: 16px;
}

.ebh-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.ebh-curve-chart {
    position: relative;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px;
}

.ebh-curve-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.ebh-curve-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--primary);
    margin-top: 2px;
}

.ebh-today-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ebh-today-item {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.ebh-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 24px 12px;
}

.ebh-module-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.ebh-module-info {
    flex: 1;
}

.ebh-module-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.ebh-module-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.ebh-del {
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
}

/* ==================== 日期选择器日历 ==================== */
.calendar {
    padding: 4px 0;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.calendar-nav {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    transition: background 0.2s ease;
}

.calendar-nav:active {
    background: var(--bg-secondary);
}

.calendar-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 8px;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 4px 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.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
    background: var(--bg-secondary);
    min-height: 38px;
}

.calendar-day.other-month {
    background: transparent;
    cursor: default;
}

.calendar-day:active {
    background: var(--bg-hover, rgba(0, 0, 0, 0.08));
}

.calendar-day.today {
    background: rgba(26, 188, 156, 0.12);
    color: var(--primary);
    font-weight: 600;
}

.calendar-day.selected {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* ==================== 通用标签 ==================== */
.category-tag {
    padding: 6px 14px;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    user-select: none;
}

.category-tag:active {
    opacity: 0.7;
}

.category-tag.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ==================== 计算器 ==================== */
.calculator {
    margin-bottom: 16px;
}

.calc-display {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    text-align: right;
    margin-bottom: 12px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.calc-expression {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 18px;
    margin-bottom: 4px;
    word-break: break-all;
}

.calc-result {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    word-break: break-all;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.calc-btn {
    aspect-ratio: 1;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: opacity 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.calc-btn:active {
    opacity: 0.7;
    transform: scale(0.95);
}

.calc-btn.function {
    background: var(--bg-hover, rgba(0, 0, 0, 0.06));
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.calc-btn.operator {
    background: rgba(26, 188, 156, 0.1);
    color: var(--primary);
    font-size: 1.2rem;
}

.calc-btn.equal {
    background: var(--primary);
    color: #fff;
    font-size: 1.3rem;
}

.calc-history-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.calc-history-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.calc-history-list {
    max-height: 150px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.calc-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s ease;
}

.calc-history-item:active {
    background: var(--bg-secondary);
}

.calc-history-expr {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.calc-history-res {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.85rem;
}

.calc-history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 16px;
    font-size: 0.85rem;
}

/* ==================== 快递备忘 ==================== */
.express-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.express-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.express-company {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.express-number {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-top: 2px;
}

.exp-del {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
}

.express-image {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-top: 10px;
}

.express-note {
    margin-top: 8px;
    padding: 8px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==================== 账单图表弹窗 ==================== */
.bill-chart-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.bill-chart-summary {
    display: flex;
    justify-content: space-around;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.bill-chart-item {
    text-align: center;
}

.bill-chart-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.bill-chart-value.income {
    color: var(--income-green, #1dd1a1);
}

.bill-chart-value.expense {
    color: var(--expense-red, #f5576c);
}

.bill-chart-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.bill-chart-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ==================== 账单收支卡片 ==================== */
.balance-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.balance-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.date-picker-btn {
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    text-align: center;
}

.balance-detail {
    display: flex;
    justify-content: space-around;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.balance-item {
    text-align: center;
}

.balance-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.balance-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.transaction-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;
}

.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);
    margin-top: 2px;
}

.transaction-amount {
    font-size: 0.95rem;
    font-weight: 600;
    flex-shrink: 0;
}

.transaction-amount.income {
    color: var(--income-green, #1dd1a1);
}

.transaction-amount.expense {
    color: var(--expense-red, #f5576c);
}

/* ==================== 图表柱状图 ==================== */
.chart-bar {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 120px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.chart-bar-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.chart-bar-fill {
    width: 100%;
    max-width: 12px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}

.chart-bar-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==================== 分页/加载更多 ==================== */
.load-more {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.load-more:hover {
    color: var(--primary);
}

/* ==================== 标签/分类选择器 ==================== */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.chip {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip.active {
    background: var(--primary);
    color: white;
}

.chip:hover:not(.active) {
    background: var(--bg-input);
}
