/* ============================================
   吱野 AI工作台 · 样式系统
   配色：奶黄底 / 浅蓝绿侧栏 / 墨绿强调 / 暖橘点缀
   ============================================ */

:root {
  --bg-main: #FAF6E9;
  --bg-sidebar: #D4E9E4;
  --accent: #5A8B82;
  --accent-light: #7BAEB0;
  --accent-dark: #456B64;
  --secondary: #FFD89E;
  --secondary-dark: #F5C068;
  --text-main: #4A4A4A;
  --text-light: #8a8a8a;
  --text-white: #FFFFFF;
  --card-bg: #FFFFFF;
  --card-shadow: 0 2px 12px rgba(90, 139, 130, 0.08);
  --card-shadow-hover: 0 6px 24px rgba(90, 139, 130, 0.16);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --sidebar-w: 230px;
  --topbar-h: 64px;
  --danger: #E8787A;
  --success: #6BBF7E;
  --warning: #F5C068;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  /* 主题辅助变量（供各主题覆盖） */
  --input-bg: #FFFFFF;
  --border-color: #E8E4D8;
  --hover-bg: rgba(255,255,255,0.55);
  --auth-grad: linear-gradient(135deg, #FAF6E9 0%, #D4E9E4 100%);
  --accent-glow: rgba(90,139,130,0.35);
  --glass-bg: rgba(255,255,255,0.7);
  --accent-soft: rgba(90,139,130,0.10);

  /* ---------- 语义色（含柔和底色，供状态块/标签使用） ---------- */
  --danger-soft: rgba(232,120,122,0.12);
  --success-soft: rgba(107,191,126,0.14);
  --warning-soft: rgba(245,192,104,0.18);
  --info: #6C9BD2;
  --info-soft: rgba(108,155,210,0.14);

  /* ---------- 表面层次（叠加色，深浅主题通用） ---------- */
  --surface-2: rgba(0,0,0,0.03);
  --surface-3: rgba(0,0,0,0.06);
  --overlay-bg: rgba(0,0,0,0.42);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);

  /* ---------- 间距刻度 ---------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

  /* ---------- 字号刻度 ---------- */
  --fs-xs: 11px; --fs-sm: 12px; --fs-base: 13px; --fs-md: 14px;
  --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px;

  --radius-full: 999px;

  /* ---------- 图表配色（跟随主题） ---------- */
  --chart-1: #5A8B82;
  --chart-2: #7BAEB0;
  --chart-3: #F5C068;
  --chart-4: #C97B4F;
  --chart-5: #7B6CA8;
  --chart-grid: rgba(90,139,130,0.12);
}

/* ============ 主题：水墨风（国画山水·留白） ============ */
/* 灵感：纯白宣纸 + 淡墨晕染山峦 + 飞鸟 + 印章朱红点睛 */
body[data-theme="ink"] {
  --bg-main: #FFFFFF;        /* 纯白宣纸·大量留白 */
  --bg-sidebar: #FAFAF7;     /* 极淡米色侧栏 */
  --accent: #3D3530;         /* 淡墨·主调（避免太重压住画面） */
  --accent-light: #8A857E;   /* 更淡的墨 */
  --accent-dark: #1A1A1A;    /* 浓墨·用于点睛 */
  --secondary: #C2BFB7;
  --secondary-dark: #918D85;
  --text-main: #2A2620;      /* 墨色正文 */
  --text-light: #8F8A82;
  --card-bg: rgba(255,255,255,0.78);  /* 卡片半透，留白感 */
  --card-shadow: 0 4px 18px rgba(0,0,0,0.06);
  --card-shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
  --danger: #A93226;         /* 朱砂红（印章色） */
  --success: #3E5A44;
  --warning: #8A7320;
  --input-bg: #FFFFFF;
  --border-color: rgba(60,50,40,0.10);  /* 极淡边 */
  --hover-bg: rgba(60,50,40,0.05);
  --auth-grad: linear-gradient(180deg, #FFFFFF 0%, #F7F5F0 100%);
  --accent-glow: rgba(60,50,40,0.20);
  --glass-bg: rgba(255,255,255,0.82);
  --accent-soft: rgba(60,50,40,0.05);
  --seal-red: #A93226;       /* 印章红·专用于点缀 */

  /* 语义色 · 水墨：取自印章朱红与山峦墨青 */
  --danger-soft: rgba(169,50,38,0.10);
  --success-soft: rgba(62,90,68,0.12);
  --warning-soft: rgba(138,115,32,0.14);
  --info: #6B7A8F;
  --info-soft: rgba(107,122,143,0.12);
  --surface-2: rgba(60,50,40,0.024);
  --surface-3: rgba(60,50,40,0.05);
  --overlay-bg: rgba(30,25,20,0.45);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --chart-1: #3D3530; --chart-2: #7A736A; --chart-3: #A93226;
  --chart-4: #B9B2A6; --chart-5: #5C6672;
  --chart-grid: rgba(60,50,40,0.10);
}
/* 全站字体：楷体+仿宋（古书卷感） */
body[data-theme="ink"] .app-shell,
body[data-theme="ink"] .content,
body[data-theme="ink"] .topbar,
body[data-theme="ink"] .sidebar,
body[data-theme="ink"] button,
body[data-theme="ink"] input,
body[data-theme="ink"] textarea,
body[data-theme="ink"] select {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "FangSong", "STFangsong", "仿宋", "PingFang SC", "Microsoft YaHei", serif;
  letter-spacing: 0.02em;
}
/* 标题字号微调·更具古韵 */
body[data-theme="ink"] h1, body[data-theme="ink"] h2, body[data-theme="ink"] h3 {
  font-weight: 600;
  letter-spacing: 0.08em;
}
/* 卡片：极淡边、留白多 */
body[data-theme="ink"] .card {
  border: 1px solid rgba(60,50,40,0.08);
  border-radius: 4px;
  background: var(--card-bg);
  backdrop-filter: blur(2px);
}
/* 顶栏、侧栏：极简线条 */
body[data-theme="ink"] .topbar { box-shadow: 0 1px 0 rgba(60,50,40,0.10); background: rgba(255,255,255,0.85); }
body[data-theme="ink"] .sidebar { border-right: 1px solid rgba(60,50,40,0.08); background: var(--bg-sidebar); }
/* 选中导航：淡墨底+左侧朱红竖线（印章红点睛） */
body[data-theme="ink"] .nav-item {
  position: relative;
  color: #4A4540;
  border-radius: 2px;
}
body[data-theme="ink"] .nav-item:hover { background: rgba(60,50,40,0.06); color: #1A1A1A; }
body[data-theme="ink"] .nav-item.active {
  background: rgba(60,50,40,0.08);
  color: #1A1A1A;
  font-weight: 600;
}
body[data-theme="ink"] .nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--seal-red);
  border-radius: 2px;
}
/* 主按钮：淡墨+边框（不是大块黑） */
body[data-theme="ink"] .btn-primary,
body[data-theme="ink"] .auth-submit-btn {
  background: #FFFFFF;
  color: #1A1A1A;
  border: 1.5px solid #1A1A1A;
  font-weight: 600;
  border-radius: 2px;
  letter-spacing: 0.1em;
}
body[data-theme="ink"] .btn-primary:hover,
body[data-theme="ink"] .auth-submit-btn:hover {
  background: #1A1A1A;
  color: #FFFFFF;
}
/* 印章按钮：纯朱砂红+白字·用于关键操作 */
body[data-theme="ink"] .btn-seal,
body[data-theme="ink"] .btn-seal:visited {
  background: var(--seal-red);
  color: #FFFFFF;
  border: 1.5px solid var(--seal-red);
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.1em;
}
body[data-theme="ink"] .btn-seal:hover { background: #8B2A20; border-color: #8B2A20; }
/* AI 浮动按钮：白底+朱红描边（点睛） */
body[data-theme="ink"] .ai-fab {
  background: #FFFFFF;
  color: var(--seal-red);
  border: 2px solid var(--seal-red);
  box-shadow: 0 4px 12px rgba(169,50,38,0.18);
}
body[data-theme="ink"] .ai-fab:hover {
  background: var(--seal-red);
  color: #FFFFFF;
}
/* 输入框：极淡边、留白 */
body[data-theme="ink"] input, body[data-theme="ink"] textarea, body[data-theme="ink"] select {
  border: 1px solid rgba(60,50,40,0.15);
  background: #FFFFFF;
  border-radius: 2px;
}
body[data-theme="ink"] input:focus, body[data-theme="ink"] textarea:focus, body[data-theme="ink"] select:focus {
  border-color: var(--seal-red);
  box-shadow: 0 0 0 3px rgba(169,50,38,0.10);
  outline: none;
}
/* 顶栏右上角按钮：极简线条 */
body[data-theme="ink"] .theme-btn,
body[data-theme="ink"] .user-box,
body[data-theme="ink"] .auth-toggle-btn {
  border: 1px solid rgba(60,50,40,0.15);
  background: #FFFFFF;
  color: #2A2620;
  border-radius: 2px;
}
body[data-theme="ink"] .theme-btn:hover,
body[data-theme="ink"] .user-box:hover,
body[data-theme="ink"] .auth-toggle-btn:hover {
  border-color: var(--seal-red);
  color: var(--seal-red);
}

/* ============================================================
   水墨山水背景层（核心装饰）
   - 远山：极淡墨·大块面·朦胧
   - 中山：中等浓度·有山形细节
   - 近山：浓墨·飞白笔触
   - 飞鸟：V 字剪影飘于山顶
   - 印章：一枚朱红方印
   ============================================================ */
body[data-theme="ink"]::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    /* 远山（最淡） */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 900' preserveAspectRatio='xMidYMax slice'><defs><filter id='blur1'><feGaussianBlur stdDeviation='3'/></filter><filter id='blur2'><feGaussianBlur stdDeviation='1.5'/></filter><filter id='ink' color-interpolation-filters='sRGB'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.15 0 0 0 0 0.13 0 0 0 0 0.10 0 0 0 0.55 0'/><feComposite in2='SourceGraphic' operator='in'/></filter></defs><g filter='url(%23blur1)' opacity='0.18'><path d='M0 480 Q 180 340 360 410 T 720 380 T 1080 400 T 1440 360 L 1440 900 L 0 900 Z' fill='%233D3530'/><path d='M0 540 Q 240 420 480 470 T 920 440 T 1440 460 L 1440 900 L 0 900 Z' fill='%233D3530' opacity='0.7'/></g><g filter='url(%23blur2)' opacity='0.32'><path d='M0 620 Q 200 510 460 580 T 880 540 T 1280 570 L 1440 555 L 1440 900 L 0 900 Z' fill='%23262020'/><path d='M0 700 Q 280 580 580 640 T 1140 600 L 1440 620 L 1440 900 L 0 900 Z' fill='%23262020' opacity='0.8'/></g><g opacity='0.42'><path d='M0 790 Q 220 700 480 760 T 960 720 T 1440 740 L 1440 900 L 0 900 Z' fill='%231A1715'/><path d='M0 850 Q 320 780 640 820 T 1280 800 L 1440 810 L 1440 900 L 0 900 Z' fill='%231A1715' opacity='0.7'/></g></svg>"),
    /* 飞鸟剪影 */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 900' preserveAspectRatio='xMidYMax slice'><g fill='%231A1715' opacity='0.55'><path d='M180 280 q 6 -8 12 0 q 6 -8 12 0' fill='none' stroke='%231A1715' stroke-width='1.5' stroke-linecap='round'/><path d='M220 250 q 5 -7 10 0 q 5 -7 10 0' fill='none' stroke='%231A1715' stroke-width='1.5' stroke-linecap='round'/><path d='M260 290 q 5 -6 10 0 q 5 -6 10 0' fill='none' stroke='%231A1715' stroke-width='1.4' stroke-linecap='round'/><path d='M300 265 q 5 -7 10 0 q 5 -7 10 0' fill='none' stroke='%231A1715' stroke-width='1.4' stroke-linecap='round'/><path d='M1200 380 q 6 -8 12 0 q 6 -8 12 0' fill='none' stroke='%231A1715' stroke-width='1.5' stroke-linecap='round'/><path d='M1240 350 q 5 -7 10 0 q 5 -7 10 0' fill='none' stroke='%231A1715' stroke-width='1.4' stroke-linecap='round'/><path d='M1280 390 q 5 -6 10 0 q 5 -6 10 0' fill='none' stroke='%231A1715' stroke-width='1.4' stroke-linecap='round'/></g></svg>"),
    /* 留白宣纸纯白底 */
    #FFFFFF;
  background-size: cover, cover, auto;
  background-position: center bottom, center 30%, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
}
/* 右上角印章（朱红方印，淡淡"栖"或"野"字） */
body[data-theme="ink"]::after {
  content: '栖';
  position: fixed;
  top: 78px;
  right: 28px;
  z-index: 1;
  pointer-events: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--seal-red);
  color: #FFFFFF;
  font-family: "STKaiti", "KaiTi", "Kaiti SC", serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(169,50,38,0.30);
  opacity: 0.92;
  letter-spacing: 0;
  /* 不规则印章毛边效果 */
  filter: contrast(1.05);
}

/* ============ 主题：卡通风 ============ */
body[data-theme="cartoon"] {
  --bg-main: #FFF7E8;
  --bg-sidebar: #FFE3C7;
  --accent: #FF8C42;
  --accent-light: #FFB26B;
  --accent-dark: #E0702E;
  --secondary: #8ED0FF;
  --secondary-dark: #5FB4F0;
  --text-main: #5B4A3A;
  --text-light: #A08A72;
  --card-bg: #FFFFFF;
  --card-shadow: 0 4px 14px rgba(255, 140, 66, 0.14);
  --card-shadow-hover: 0 8px 28px rgba(255, 140, 66, 0.24);
  --danger: #FF6B6B;
  --success: #7ED98B;
  --warning: #FFC24B;
  --input-bg: #FFFDF7;
  --border-color: #FFE0B2;
  --hover-bg: rgba(255,140,66,0.08);
  --auth-grad: linear-gradient(135deg, #FFF7E8 0%, #FFE3C7 100%);
  --accent-glow: rgba(255,140,66,0.35);
  --glass-bg: rgba(255,255,255,0.75);
  --accent-soft: rgba(255,140,66,0.10);

  /* 语义色 · 卡通：高饱和马卡龙 */
  --danger-soft: rgba(255,107,107,0.14);
  --success-soft: rgba(126,217,139,0.18);
  --warning-soft: rgba(255,194,75,0.20);
  --info: #5FB4F0;
  --info-soft: rgba(142,208,255,0.20);
  --surface-2: rgba(255,140,66,0.05);
  --surface-3: rgba(255,140,66,0.10);
  --overlay-bg: rgba(91,74,58,0.42);
  --shadow-sm: 0 1px 3px rgba(255,140,66,0.10);
  --chart-1: #FF8C42; --chart-2: #8ED0FF; --chart-3: #FFC24B;
  --chart-4: #7ED98B; --chart-5: #FF6B9D;
  --chart-grid: rgba(255,140,66,0.14);
}
body[data-theme="cartoon"] .card { border: 2.5px solid #FFE0B2; border-radius: 22px; }
body[data-theme="cartoon"] .btn,
body[data-theme="cartoon"] .clock-btn,
body[data-theme="cartoon"] .auth-submit-btn { border-radius: 999px; }
body[data-theme="cartoon"] .nav-item.active { box-shadow: 0 4px 14px rgba(255,140,66,0.4); }
body[data-theme="cartoon"] .ai-fab { box-shadow: 0 6px 20px rgba(255,140,66,0.45); }

/* ============ 主题：赛博风 ============ */
body[data-theme="cyber"] {
  --bg-main: #0B0F19;
  --bg-sidebar: #101828;
  --accent: #00E5FF;
  --accent-light: #4DDBFF;
  --accent-dark: #00B8D4;
  --secondary: #9D4EDD;
  --secondary-dark: #7B2CBF;
  --text-main: #E6F1FF;
  --text-light: #7B8BA3;
  --card-bg: #151D33;
  --card-shadow: 0 2px 14px rgba(0, 229, 255, 0.12);
  --card-shadow-hover: 0 8px 30px rgba(0, 229, 255, 0.22);
  --danger: #FF6B8A;
  --success: #4ADE80;
  --warning: #FFD166;
  --input-bg: #0D1326;
  --border-color: rgba(0,229,255,0.22);
  --hover-bg: rgba(0,229,255,0.07);
  --auth-grad: linear-gradient(135deg, #0B0F19 0%, #101828 100%);
  --accent-glow: rgba(0,229,255,0.45);
  --glass-bg: rgba(13,19,38,0.85);
  --accent-soft: rgba(0,229,255,0.08);

  /* 语义色 · 赛博：霓虹暗夜（深底用浅色叠加） */
  --danger-soft: rgba(255,107,138,0.16);
  --success-soft: rgba(74,222,128,0.14);
  --warning-soft: rgba(255,209,102,0.14);
  --info: #4DD0E1;
  --info-soft: rgba(77,208,225,0.12);
  --surface-2: rgba(255,255,255,0.04);
  --surface-3: rgba(255,255,255,0.08);
  --overlay-bg: rgba(0,0,0,0.65);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.40);
  --chart-1: #00E5FF; --chart-2: #9D4EDD; --chart-3: #FFD166;
  --chart-4: #4ADE80; --chart-5: #FF6B8A;
  --chart-grid: rgba(0,229,255,0.14);
}
body[data-theme="cyber"] .card,
body[data-theme="cyber"] .sidebar,
body[data-theme="cyber"] .topbar,
body[data-theme="cyber"] .modal,
body[data-theme="cyber"] .ai-panel { border: 1px solid rgba(0,229,255,0.15); }
body[data-theme="cyber"] .nav-item.active,
body[data-theme="cyber"] .btn-primary,
body[data-theme="cyber"] .ai-fab,
body[data-theme="cyber"] .auth-submit-btn { box-shadow: 0 0 16px rgba(0,229,255,0.45); text-shadow: 0 0 8px rgba(0,229,255,0.6); }
body[data-theme="cyber"] .nav-item:hover,
body[data-theme="cyber"] .add-column-btn:hover { box-shadow: 0 0 10px rgba(0,229,255,0.2); }
body[data-theme="cyber"] .topbar { box-shadow: 0 1px 12px rgba(0,229,255,0.15); }
body[data-theme="cyber"] .search-box input,
body[data-theme="cyber"] input,
body[data-theme="cyber"] textarea { color: #E6F1FF; }
body[data-theme="cyber"] ::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.4); }

/* 主题切换过渡 */
body { transition: background var(--transition), color var(--transition); }
body *, body *::before, body *::after { transition-property: background-color, border-color, box-shadow, color; transition-duration: 0.25s; }

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

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

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; outline: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--accent-light); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 顶部栏 ============ */
.topbar {
  height: var(--topbar-h);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 1px 8px var(--accent-soft);
  position: relative;
  z-index: 100;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.menu-toggle { display: none; color: var(--accent); padding: 6px; border-radius: var(--radius-sm); }
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border-radius: var(--radius-xl);
  padding: 8px 16px;
  width: 100%;
  max-width: 360px;
  border: 1.5px solid transparent;
  transition: var(--transition);
}
.search-box:focus-within { border-color: var(--accent-light); background: var(--input-bg); }
.search-icon { color: var(--text-light); flex-shrink: 0; }
.search-box input {
  border: none; background: none; margin-left: 8px;
  width: 100%; font-size: 14px; color: var(--text-main);
}
/* 移动端搜索入口按钮 / 关闭按钮：桌面端不显示 */
.search-toggle { display: none; color: var(--accent); padding: 6px; border-radius: var(--radius-sm); }
.search-close { display: none; color: var(--text-light); font-size: 15px; padding: 4px 6px; flex-shrink: 0; }
.search-results {
  position: absolute; top: 110%; left: 0; right: 0;
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--card-shadow-hover); max-height: 320px;
  overflow-y: auto; display: none; z-index: 200;
}
.search-results.show { display: block; }
.search-result-item {
  padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--border-color);
  font-size: 14px; transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg-main); }
.search-result-item .sr-type { font-size: 11px; color: var(--accent); margin-right: 6px; }
.topbar-center { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.current-time { font-size: 20px; font-weight: 700; color: var(--accent); letter-spacing: 1px; }
.current-date { font-size: 12px; color: var(--text-light); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }
.clock-btn {
  background: var(--bg-main); color: var(--accent);
  padding: 8px 14px; border-radius: var(--radius-xl);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: var(--transition); border: 1.5px solid transparent;
  display: flex; align-items: center; gap: 4px;
}
.clock-btn:hover { background: var(--accent); color: #fff; }
.clock-btn.done { background: var(--accent); color: #fff; }
.clock-btn .clock-icon { font-size: 11px; }
.motivation-text {
  font-style: italic; color: var(--text-light); font-size: 13px;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 提醒横幅 */
.reminder-banner {
  background: linear-gradient(90deg, var(--secondary), var(--secondary-dark));
  color: var(--text-main); padding: 8px 20px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 13px; font-weight: 600; position: relative; z-index: 99;
}
.reminder-close { color: var(--text-main); font-size: 16px; padding: 2px 6px; }

/* ============ 布局 ============ */
.layout { display: flex; height: calc(100vh - var(--topbar-h)); }

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w); background: var(--bg-sidebar);
  display: flex; flex-direction: column; padding: 16px 12px;
  flex-shrink: 0; overflow-y: auto; transition: transform var(--transition);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 20px; font-weight: 700; font-size: 18px; color: var(--accent);
}
.app-icon-wrap {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--card-bg); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--card-shadow); flex-shrink: 0;
  overflow: hidden;
}
.app-icon { font-size: 22px; }
.app-icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.nav-list { flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius);
  font-size: 14px; color: var(--text-main); margin-bottom: 3px;
  transition: var(--transition); cursor: pointer; font-weight: 500;
}
.nav-item:hover { background: var(--hover-bg); }
.nav-item.active { background: var(--accent); color: #fff; box-shadow: 0 3px 10px var(--accent-glow); }
.nav-icon { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-divider { height: 1px; background: var(--border-color); margin: 8px 12px; }
.nav-item .nav-delete { margin-left: auto; opacity: 0; font-size: 14px; color: var(--danger); transition: opacity var(--transition); }
.nav-item:hover .nav-delete { opacity: 0.6; }
.nav-item .nav-delete:hover { opacity: 1; }
.add-column-btn {
  margin-top: 8px; padding: 10px; border: 2px dashed var(--accent-light);
  border-radius: var(--radius); color: var(--accent); font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.add-column-btn:hover { background: var(--hover-bg); border-color: var(--accent); }
.nav-manager-btn {
  margin-top: 6px; padding: 10px; border: 1.5px solid var(--border-color);
  border-radius: var(--radius); color: var(--text-main); font-size: 13px; font-weight: 600;
  background: transparent; cursor: pointer; transition: var(--transition); text-align: center;
}
.nav-manager-btn:hover { background: var(--hover-bg); border-color: var(--accent); color: var(--accent); }
.nav-hidden { display: none !important; }
.navm-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--bg-main); border: 1px solid var(--border-color);
  border-radius: var(--radius); margin-bottom: 6px;
}
.navm-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.navm-name { flex: 1; font-size: 14px; font-weight: 500; color: var(--text-main); }
.navm-ops { display: flex; gap: 4px; }
.navm-btn {
  width: 26px; height: 26px; border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); background: transparent; color: var(--text-main);
  font-size: 13px; cursor: pointer; line-height: 1; transition: var(--transition);
}
.navm-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.navm-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.navm-fixed-tag {
  font-size: 11px; padding: 2px 8px; border-radius: var(--radius-xl);
  background: var(--accent-soft); color: var(--accent); flex-shrink: 0;
}
.navm-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.navm-switch input { opacity: 0; width: 0; height: 0; }
.navm-switch-slider {
  position: absolute; inset: 0; background: var(--border-color);
  border-radius: var(--radius-xl); cursor: pointer; transition: var(--transition);
}
.navm-switch-slider::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: var(--transition);
}
.navm-switch input:checked + .navm-switch-slider { background: var(--accent); }
.navm-switch input:checked + .navm-switch-slider::before { transform: translateX(18px); }
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 89;
}

/* 主内容区 */
.content-wrap {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.content {
  flex: 1; overflow-y: auto; padding: 24px 28px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* ============ 通用组件 ============ */
.page-title {
  font-size: 22px; font-weight: 700; color: var(--text-main);
  margin-bottom: 4px; display: flex; align-items: center; gap: 8px;
}
.page-subtitle { font-size: 13px; color: var(--text-light); margin-bottom: 20px; }
.card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--card-shadow);
  transition: var(--transition); margin-bottom: 16px;
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card-title {
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; gap: 6px; color: var(--text-main);
}
.card-title .ct-icon { font-size: 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.btn {
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: var(--secondary); color: var(--text-main); }
.btn-secondary:hover { background: var(--secondary-dark); }
.btn-outline { border: 1.5px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(232,120,122,0.15); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: var(--transition);
}
.btn-icon:hover { background: var(--bg-main); }

input.field, textarea.field, select.field {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border-color);
  border-radius: var(--radius); font-size: 14px; color: var(--text-main);
  background: var(--input-bg); transition: var(--transition);
}
input.field:focus, textarea.field:focus, select.field:focus { border-color: var(--accent-light); }
textarea.field { resize: vertical; min-height: 80px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 5px; display: block; }
.field-group { margin-bottom: 14px; }

.tag {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-xl);
  font-size: 11px; font-weight: 600;
}
.tag-accent { background: var(--accent-soft); color: var(--accent); }
.tag-warn { background: rgba(245,192,104,0.2); color: #C8932E; }
.tag-danger { background: rgba(232,120,122,0.15); color: var(--danger); }
.tag-success { background: rgba(107,191,126,0.15); color: #4A9D5C; }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-light);
}
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* 进度条 */
.progress-bar {
  height: 10px; background: var(--bg-main); border-radius: var(--radius-xl);
  overflow: hidden; position: relative;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-xl); transition: width 0.6s ease;
  position: relative;
}
.progress-avatar {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; box-shadow: 0 2px 6px rgba(0,0,0,0.15); transition: left 0.6s ease;
  z-index: 2;
}

/* ============ 工作台首页 ============ */
.hero-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.countdown-card {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; border-radius: var(--radius-lg); padding: 22px;
  position: relative; overflow: hidden;
}
.countdown-card::after {
  content: '🐑'; position: absolute; right: -10px; bottom: -10px;
  font-size: 80px; opacity: 0.12;
}
.countdown-card .cd-label { font-size: 13px; opacity: 0.85; margin-bottom: 6px; }
.countdown-card .cd-target { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.countdown-card .cd-days { font-size: 48px; font-weight: 800; line-height: 1; }
.countdown-card .cd-unit { font-size: 16px; font-weight: 500; }
.countdown-card .cd-date { font-size: 12px; opacity: 0.8; margin-top: 6px; }

.clock-card {
  background: var(--card-bg); border-radius: var(--radius-lg); padding: 22px;
  box-shadow: var(--card-shadow); text-align: center;
}
.clock-card .big-time { font-size: 42px; font-weight: 800; color: var(--accent); letter-spacing: 2px; }
.clock-card .big-date { font-size: 14px; color: var(--text-light); margin-top: 4px; }
.clock-card .big-week { font-size: 13px; color: var(--accent); margin-top: 2px; font-weight: 600; }

.completion-card {
  background: var(--card-bg); border-radius: var(--radius-lg); padding: 22px;
  box-shadow: var(--card-shadow);
}
.completion-card .cc-percent { font-size: 36px; font-weight: 800; color: var(--accent); }
.completion-card .cc-label { font-size: 13px; color: var(--text-light); margin-bottom: 14px; }

.week-overview { display: flex; gap: 8px; margin-top: 10px; }
.week-day {
  flex: 1; text-align: center; border-radius: var(--radius-sm);
  padding: 10px 4px; background: var(--bg-main); transition: var(--transition);
}
.week-day.checked { background: var(--accent); color: #fff; }
.week-day.today { border: 2px solid var(--secondary-dark); }
.week-day .wd-label { font-size: 11px; opacity: 0.7; }
.week-day .wd-dot { font-size: 16px; margin-top: 2px; }

.quick-entry { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.quick-btn {
  background: var(--bg-main); border-radius: var(--radius); padding: 16px 10px;
  text-align: center; cursor: pointer; transition: var(--transition);
}
.quick-btn:hover { background: var(--bg-sidebar); box-shadow: var(--card-shadow); }
.quick-btn .qb-icon { font-size: 28px; margin-bottom: 6px; }
.quick-btn .qb-label { font-size: 12px; color: var(--text-main); font-weight: 600; }

/* ============ 时政热点 ============ */
.news-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.news-tab {
  padding: 7px 16px; border-radius: var(--radius-xl); font-size: 13px;
  background: var(--card-bg); color: var(--text-light); cursor: pointer;
  transition: var(--transition); box-shadow: var(--card-shadow);
  border-bottom: 3px solid transparent; margin-bottom: 2px;
}
.news-tab.active { background: var(--accent); color: #fff; }
.news-item-link { display: block; margin-bottom: 10px; text-decoration: none; color: inherit; }
.news-item {
  padding: 14px 16px; border-radius: var(--radius); background: var(--card-bg);
  margin-bottom: 0; box-shadow: var(--card-shadow); cursor: pointer;
  transition: var(--transition); display: flex; align-items: flex-start; gap: 4px;
  border-left: 3px solid transparent;
}
.news-item:hover { box-shadow: var(--card-shadow-hover); border-left: 3px solid var(--accent); }
.news-item.top3 { background: linear-gradient(135deg, var(--card-bg) 0%, var(--accent-soft) 100%); }
.news-item .ni-rank {
  display: inline-flex; width: 24px; height: 24px; border-radius: 6px;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  margin-right: 10px; background: var(--bg-main); color: var(--text-light); flex-shrink: 0;
}
.news-item .ni-rank.top { background: var(--secondary); color: var(--text-main); }
.news-item .ni-content { flex: 1; min-width: 0; }
.news-item .ni-title { font-size: 14px; font-weight: 600; }
.news-item .ni-detail { font-size: 12px; color: var(--text-light); margin-top: 6px; }
.news-item .ni-meta {
  display: flex; gap: 12px; align-items: center; margin-top: 6px;
  font-size: 11px; color: var(--text-light); flex-wrap: wrap;
}
.news-item .ni-time { color: var(--text-light); }
.news-item .ni-jump { color: var(--accent); font-weight: 600; margin-left: auto; }

/* ============ 课程/列表通用 ============ */
.list-item {
  background: var(--card-bg); border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px; box-shadow: var(--card-shadow); transition: var(--transition);
  display: flex; align-items: center; gap: 12px;
}
.list-item:hover { box-shadow: var(--card-shadow-hover); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 14px; font-weight: 600; }
.list-item .li-sub { font-size: 12px; color: var(--text-light); margin-top: 3px; }
.list-item .li-actions { display: flex; gap: 4px; flex-shrink: 0; }

.checkbox-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: var(--radius); background: var(--card-bg); margin-bottom: 8px;
  box-shadow: var(--card-shadow); transition: var(--transition); cursor: pointer;
}
.checkbox-item:hover { box-shadow: var(--card-shadow-hover); }
.checkbox-item.done { opacity: 0.55; }
.checkbox-item.done .ci-text { text-decoration: line-through; }
.ci-check {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--accent-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: var(--transition); font-size: 13px; color: #fff;
}
.checkbox-item.done .ci-check { background: var(--accent); border-color: var(--accent); }
.ci-text { flex: 1; font-size: 14px; }
.ci-tag { font-size: 11px; }

/* 优先级 */
.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.priority-high { background: var(--danger); }
.priority-mid { background: var(--warning); }
.priority-low { background: var(--success); }

/* ============ 英语四级打卡 ============ */
.cet4-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }
.cet4-check-btn {
  background: var(--card-bg); border-radius: var(--radius-lg); padding: 18px 12px;
  text-align: center; cursor: pointer; transition: var(--transition);
  box-shadow: var(--card-shadow); border: 2px solid transparent;
}
.cet4-check-btn:hover { box-shadow: var(--card-shadow-hover); border-color: var(--accent-light); }
.cet4-check-btn.done { background: var(--accent); color: #fff; border-color: var(--accent-dark); }
.cet4-check-btn .cb-icon { font-size: 26px; margin-bottom: 6px; }
.cet4-check-btn .cb-name { font-size: 13px; font-weight: 600; }
.cet4-check-btn .cb-time { font-size: 11px; opacity: 0.7; margin-top: 3px; }

/* 词汇列表 */
.vocab-list { display: flex; flex-direction: column; gap: 8px; }
.vocab-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border-radius: var(--radius); background: var(--bg-main); transition: var(--transition);
  border-left: 3px solid transparent;
}
.vocab-item.learned { border-left-color: var(--accent); background: var(--accent-soft); }
.vocab-item:hover { box-shadow: var(--card-shadow); }
.vocab-main { flex: 1; min-width: 0; }
.vocab-word { font-size: 16px; font-weight: 700; color: var(--text-dark); }
.vocab-phonetic { font-size: 13px; color: var(--text-light); font-weight: 400; }
.vocab-meaning { font-size: 13px; color: var(--text-main); margin-top: 2px; }
.vocab-example { font-size: 12px; color: var(--text-light); margin-top: 4px; font-style: italic; }
.vocab-time { font-size: 11px; color: var(--accent); margin-top: 4px; }

/* 学习路径 */
.track-card {
  padding: 18px; border-radius: var(--radius-lg); background: var(--card-bg);
  box-shadow: var(--card-shadow); cursor: pointer; transition: var(--transition);
  border: 2px solid transparent; position: relative; overflow: hidden;
}
.track-card:hover { box-shadow: var(--card-shadow-hover); border-color: var(--accent-light); }
.track-card.active { border-color: var(--accent); }
.track-card .track-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.track-card .track-icon { font-size: 28px; }
.track-card .track-name { font-size: 17px; font-weight: 700; }
.track-card .track-desc { font-size: 12px; color: var(--text-light); }
.track-card .track-date { font-size: 11px; color: var(--text-light); margin-top: 6px; }
.track-badge { position: absolute; top: 10px; right: 10px; background: var(--accent); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 10px; }

.track-task {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px;
  border-radius: var(--radius); background: var(--bg-main); margin-bottom: 10px;
  border-left: 3px solid transparent; transition: var(--transition);
}
.track-task.done { border-left-color: var(--accent); background: var(--accent-soft); }
.track-task .tt-content { flex: 1; }
.track-task .tt-name { font-size: 14px; font-weight: 600; }
.track-task .tt-target { font-size: 12px; color: var(--accent); margin-top: 2px; }
.track-task .tt-duration { font-size: 11px; color: var(--text-light); }
.track-task .tt-desc { font-size: 12px; color: var(--text-light); margin-top: 4px; line-height: 1.5; }
.track-task .tt-time { font-size: 11px; color: var(--accent); margin-top: 4px; }

.stat-row { display: flex; gap: 12px; margin-bottom: 16px; }
.stat-box {
  flex: 1; background: var(--card-bg); border-radius: var(--radius); padding: 16px;
  text-align: center; box-shadow: var(--card-shadow);
}
.stat-box .sb-num { font-size: 28px; font-weight: 800; color: var(--accent); }
.stat-box .sb-label { font-size: 12px; color: var(--text-light); margin-top: 2px; }

.phase-card {
  background: var(--card-bg); border-radius: var(--radius-lg); padding: 18px;
  margin-bottom: 12px; box-shadow: var(--card-shadow); border-left: 4px solid var(--accent);
}

/* ============ 番茄钟 ============ */
.pomodoro-display {
  text-align: center; padding: 30px; background: var(--card-bg);
  border-radius: var(--radius-xl); box-shadow: var(--card-shadow); margin-bottom: 16px;
}
.pomodoro-time { font-size: 64px; font-weight: 800; color: var(--accent); letter-spacing: 3px; }
.pomodoro-status { font-size: 14px; color: var(--text-light); margin-top: 6px; }
.pomodoro-controls { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.pomodoro-count { font-size: 13px; color: var(--accent); margin-top: 12px; font-weight: 600; }

/* ============ 日历 ============ */
.calendar-grid {
  display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; margin-top: 12px;
}
.calendar-header { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-light); padding: 6px 0; }
.calendar-cell {
  aspect-ratio: 1; border-radius: var(--radius-sm); background: var(--bg-main);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition); position: relative; font-size: 13px;
}
.calendar-cell:hover { background: var(--bg-sidebar); }
.calendar-cell.other-month { opacity: 0.3; }
.calendar-cell.today { background: var(--accent); color: #fff; font-weight: 700; }
.calendar-cell .cc-dots { display: flex; gap: 2px; margin-top: 2px; }
.calendar-cell .cc-dot { width: 5px; height: 5px; border-radius: 50%; }
.dot-study { background: var(--accent); }
.dot-exercise { background: var(--secondary-dark); }
.dot-summary { background: var(--success); }
.calendar-cell.today .cc-dot { background: #fff; }
.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

/* ============ 每日总结 ============ */
.mood-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.mood-btn {
  width: 48px; height: 48px; border-radius: 50%; font-size: 26px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--bg-main); transition: var(--transition); border: 3px solid transparent;
}
.mood-btn:hover { box-shadow: var(--card-shadow); border-color: var(--accent-light); }
.mood-btn.selected { border-color: var(--accent); background: var(--input-bg); }

/* ============ AI 助手 ============ */
.ai-fab {
  position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px;
  border-radius: 50%; background: var(--accent); color: #fff;
  box-shadow: 0 6px 20px var(--accent-glow); font-size: 26px;
  display: flex; align-items: center; justify-content: center; z-index: 200;
  transition: var(--transition);
}
.ai-fab:hover { box-shadow: 0 8px 28px var(--accent-glow); }
.ai-panel {
  position: fixed; right: 24px; bottom: 90px; width: 380px; max-width: calc(100vw - 32px);
  height: 540px; max-height: calc(100vh - 120px); background: var(--card-bg);
  border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  display: none; flex-direction: column; z-index: 201; overflow: hidden;
}
.ai-panel.show { display: flex; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.ai-header {
  background: var(--accent); color: #fff; padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center; font-weight: 700;
}
.ai-close { color: #fff; font-size: 18px; }
.ai-messages { flex: 1; overflow-y: auto; padding: 16px; }
.ai-msg { margin-bottom: 12px; max-width: 88%; font-size: 13px; line-height: 1.6; }
.ai-msg.bot { background: var(--bg-main); padding: 10px 14px; border-radius: var(--radius) var(--radius) var(--radius) 4px; }
.ai-msg.user { background: var(--accent); color: #fff; padding: 10px 14px; border-radius: var(--radius) var(--radius) 4px var(--radius); margin-left: auto; }
.ai-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border-color); }
.ai-quick button {
  font-size: 11px; padding: 5px 10px; border-radius: var(--radius-xl);
  background: var(--bg-main); color: var(--accent); transition: var(--transition);
}
.ai-quick button:hover { background: var(--accent); color: #fff; }
.ai-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border-color); }
.ai-input-row input {
  flex: 1; border: 1.5px solid var(--border-color); border-radius: var(--radius-xl);
  padding: 9px 14px; font-size: 13px;
}
.ai-input-row input:focus { border-color: var(--accent-light); }
.ai-input-row button {
  background: var(--accent); color: #fff; border-radius: 50%;
  width: 38px; height: 38px; font-size: 16px; display: flex; align-items: center; justify-content: center;
}

/* ============ 模态框 ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  display: none; align-items: center; justify-content: center; z-index: 300; padding: 20px;
}
/* 公告弹窗：不透明遮罩，页面内容完全不可见，聚焦公告 */
.modal-overlay.announcement-modal { background: #000; }
.modal-overlay.show { display: flex; }
.modal {
  background: var(--card-bg); border-radius: var(--radius-lg); width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto; animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-header {
  padding: 16px 20px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 { font-size: 17px; }
.modal-close { font-size: 20px; color: var(--text-light); }
.modal-body { padding: 20px; }

/* ============ Toast ============ */
.toast-container { position: fixed; top: 76px; right: 20px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--card-bg); padding: 12px 18px; border-radius: var(--radius);
  box-shadow: var(--card-shadow-hover); font-size: 14px; font-weight: 500;
  border-left: 4px solid var(--accent); animation: toastIn 0.3s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ============ 数据同步页 ============ */
.sync-status {
  display: flex; align-items: center; gap: 8px; padding: 12px 18px;
  border-radius: var(--radius); margin-bottom: 16px; font-weight: 600;
}
.sync-status.connected { background: rgba(107,191,126,0.12); color: #4A9D5C; }
.sync-status.disconnected { background: rgba(232,120,122,0.1); color: var(--danger); }
.sync-code-box {
  background: var(--bg-main); border-radius: var(--radius); padding: 16px;
  text-align: center; margin: 12px 0;
}
.sync-code-box .sc-code { font-size: 24px; font-weight: 800; color: var(--accent); letter-spacing: 2px; }
#qrcodeBox { display: flex; justify-content: center; padding: 12px; }

/* ============ 图表容器 ============ */
.chart-container { position: relative; height: 200px; }

/* ============ 响应式 ============ */
/* 平板及以下 */
@media (max-width: 1024px) {
  .motivation-text { display: none; }
  .topbar-center .current-time { font-size: 17px; }
}
@media (max-width: 768px) {
  :root { --topbar-h: 56px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-center { display: none; }
  .search-box { max-width: none; }
  .motivation-text { display: none; }
  .clock-btn { padding: 6px 10px; font-size: 12px; }
  .menu-toggle { display: flex; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h); bottom: calc(56px + env(safe-area-inset-bottom)); z-index: 90;
    transform: translateX(-100%); box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    width: min(260px, 78vw);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .content { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .hero-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: 1fr 1fr; }
  .cet4-grid { grid-template-columns: 1fr 1fr; }
  .quick-entry { grid-template-columns: 1fr 1fr 1fr; }
  .stat-row { flex-wrap: wrap; }
  .stat-box { min-width: calc(50% - 6px); }
  .ai-panel { right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); width: calc(100vw - 16px); height: 60vh; }
  .ai-fab { right: 16px; bottom: calc(70px + env(safe-area-inset-bottom)); width: 52px; height: 52px; font-size: 24px; }
  /* 底部Tab栏 */
  .bottom-tab {
    position: fixed; bottom: 0; left: 0; right: 0; height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--card-bg); display: flex; box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 95; border-top: 1px solid var(--border-color);
  }
  .bottom-tab-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 10px; color: var(--text-light); gap: 2px; cursor: pointer; transition: var(--transition);
    padding: 4px 0 2px; user-select: none; -webkit-tap-highlight-color: transparent;
  }
  .bottom-tab-item:active { background: var(--hover-bg); }
  .bottom-tab-item.active { color: var(--accent); }
  .bottom-tab-item.active .bt-icon { transform: translateY(-1px); }
  .bottom-tab-item .bt-icon { font-size: 20px; transition: transform var(--transition); }
  .bottom-tab-item .bt-label {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 10px; line-height: 1.3; padding: 0 2px;
  }
}
.bottom-tab { display: none; }
@media (max-width: 768px) { .bottom-tab { display: flex; } }

/* 手机窄屏：顶栏进一步精简 */
@media (max-width: 600px) {
  .topbar-left { gap: 2px; flex: 0 0 auto; }
  .clock-btn .clock-text { display: none; }
  .clock-btn { padding: 0; border-radius: 50%; width: 36px; height: 36px; justify-content: center; flex-shrink: 0; }
  .topbar-right { gap: 4px; flex: 0 0 auto; }
  /* 图标按钮统一收成 36px 圆形，避免占满顶栏 */
  .theme-btn { padding: 0; width: 36px; height: 36px; justify-content: center; border-radius: 50%; flex-shrink: 0; }
  .theme-btn-text { display: none; }
  .notify-btn { position: relative; }
  .user-box { margin-left: 0; padding: 3px 6px; }
  .logout-btn { padding: 2px 7px; font-size: 11px; }
  .grid-auto { grid-template-columns: 1fr; }
  .quick-entry { grid-template-columns: 1fr 1fr; }
  .cet4-grid { grid-template-columns: 1fr; }
  /* 弹窗全屏化 */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; width: 100%; }
  .modal-body { padding: 16px; }
  .finmodal-cat-grid { grid-template-columns: repeat(4, 1fr); }

  /* ---------- 搜索改为全宽浮层（原来输入区仅 20px，形同虚设） ---------- */
  .search-toggle { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; }
  .search-close { display: block; }
  .search-box {
    position: fixed;
    left: 8px; right: 8px;
    top: calc(var(--topbar-h) + 6px);
    max-width: none; width: auto;
    padding: 10px 12px;
    display: none;
    z-index: 220;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-color);
    background: var(--card-bg);
  }
  .search-box.show { display: flex; }
  .search-box input { font-size: 15px; margin-left: 8px; }
  .search-icon { display: block; }
  /* 浮层内的结果列表需要更宽的点击区域 */
  .search-results { top: calc(100% + 6px); max-height: 60vh; }
  .search-result-item { padding: 12px 14px; font-size: 15px; min-height: 44px; }
  /* 搜索浮层展开时给页面加遮罩感（内容区下沉） */
  body.search-open .content { opacity: 0.55; }
}
@media (max-width: 380px) {
  .current-time { display: none; }
  .clock-btn { width: 34px; height: 34px; }
  .theme-btn, .search-toggle { width: 34px; height: 34px; }
  .topbar { padding: 0 8px; }
}

/* 打印隐藏 */
@media print { .topbar, .sidebar, .ai-fab, .ai-panel, .bottom-tab { display: none !important; } }

/* ============ 用户信息栏 ============ */
.user-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--glass-bg); border-radius: 20px;
  padding: 4px 12px; margin-left: 8px;
  transition: var(--transition);
}
.user-avatar { font-size: 16px; }
.user-name { font-size: 13px; color: var(--accent-dark); font-weight: 600; }
.logout-btn {
  border: none; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; padding: 3px 10px; border-radius: 12px;
  cursor: pointer; transition: var(--transition);
}
.logout-btn:hover { background: rgba(255,100,100,0.15); color: #e74c3c; }
@media (max-width: 768px) {
  .user-box { padding: 4px 8px; }
  .user-name { display: none; }
}

/* ============ 登录/注册遮罩 ============ */
.auth-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--auth-grad);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.3s ease;
}
.auth-overlay.hidden { display: none; }
.auth-card {
  background: var(--card-bg); border-radius: 24px;
  padding: 40px 36px; width: 360px; max-width: 90vw;
  box-shadow: 0 8px 48px var(--accent-glow);
  animation: slideUp 0.4s ease;
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-img {
  width: 72px; height: 72px; margin: 0 auto 12px;
  display: block; object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
}
.auth-logo h2 { font-size: 20px; color: var(--accent-dark); font-weight: 700; }
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 24px;
  background: var(--bg-main); border-radius: 12px; padding: 4px;
}
.auth-tab {
  flex: 1; border: none; background: transparent;
  padding: 10px; font-size: 14px; font-weight: 600;
  color: var(--text-light); border-radius: 8px;
  cursor: pointer; transition: var(--transition);
}
.auth-tab.active { background: var(--card-bg); color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.auth-field { margin-bottom: 16px; }
.auth-field input {
  width: 100%; padding: 12px 16px; border: 2px solid var(--border-color);
  border-radius: 12px; font-size: 14px; outline: none; color: var(--text-main);
  background: var(--input-bg);
  transition: var(--transition); box-sizing: border-box;
}
.auth-field input:focus { border-color: var(--accent); }
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row input { flex: 1; min-width: 0; }
.auth-code-btn {
  flex-shrink: 0; padding: 0 14px; border: 2px solid var(--accent);
  border-radius: 12px; background: transparent; color: var(--accent);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.auth-code-btn:hover { background: var(--accent); color: #fff; }
.auth-code-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.auth-submit-btn {
  width: 100%; padding: 13px; border: none; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: var(--transition); margin-top: 4px;
}
.auth-submit-btn:hover { background: var(--accent-dark); box-shadow: var(--card-shadow); }
.auth-submit-btn:active { transform: translateY(0); }
.auth-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-hint { text-align: center; font-size: 12px; margin-top: 14px; min-height: 16px; }
.auth-hint.error { color: #e74c3c; }
.auth-hint.success { color: var(--accent); }

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

/* ============ 管理后台 ============ */
.admin-nav-item { border-left: 3px solid var(--accent); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 768px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

.stat-card-mini {
  text-align: center; padding: 20px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.stat-card-mini .stat-icon { font-size: 28px; }
.stat-card-mini .stat-value { font-size: 24px; font-weight: 800; color: var(--accent-dark); }
.stat-card-mini .stat-label { font-size: 12px; color: var(--text-light); }

.admin-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.admin-table th {
  text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--bg-sidebar);
  color: var(--text-light); font-weight: 600; white-space: nowrap;
}
.admin-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border-color); vertical-align: middle;
}
.admin-table tr:hover { background: var(--bg-main); }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.badge-admin { background: var(--accent-soft); color: var(--accent); }
.badge-user { background: var(--hover-bg); color: var(--text-light); }

.admin-data-view {
  background: var(--bg-main); border-radius: 8px; padding: 12px;
  font-size: 12px; max-height: 400px; overflow: auto; white-space: pre-wrap;
  word-break: break-all; font-family: 'SF Mono', 'Consolas', monospace;
}

.btn-danger {
  background: #e74c3c; color: #fff; border: none;
  border-radius: 8px; padding: 6px 10px; cursor: pointer;
  font-size: 12px; transition: var(--transition);
}
.btn-danger:hover { background: #c0392b; }

/* ============ 主题风格选择器 ============ */
.theme-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-main); color: var(--accent);
  padding: 8px 14px; border-radius: var(--radius-xl);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  border: 1.5px solid transparent; transition: var(--transition);
}
.theme-btn:hover { background: var(--accent); color: #fff; }
.theme-panel {
  position: fixed; top: calc(var(--topbar-h) + 12px); right: 20px;
  width: 300px; background: var(--card-bg); border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow-hover); z-index: 350; padding: 16px;
  display: none; animation: slideDown 0.2s ease;
}
.theme-panel.show { display: block; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.theme-panel-title { font-size: 14px; font-weight: 700; color: var(--text-main); margin-bottom: 12px; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-option {
  border: 2px solid var(--border-color); border-radius: var(--radius);
  padding: 10px; cursor: pointer; transition: var(--transition);
  background: var(--bg-main); text-align: center;
}
.theme-option:hover { border-color: var(--accent-light); box-shadow: var(--card-shadow); }
.theme-option.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.theme-option .to-preview {
  height: 40px; border-radius: 8px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; border: 1px solid rgba(0,0,0,0.06);
}
.theme-option .to-name { font-size: 12px; font-weight: 600; color: var(--text-main); }
.theme-option .to-desc { font-size: 10px; color: var(--text-light); margin-top: 2px; }
/* 各主题预览卡配色 */
.to-preview.default { background: linear-gradient(135deg, #FAF6E9, #D4E9E4); }
.to-preview.ink {
  background: #FFFFFF;
  position: relative;
  overflow: hidden;
}
.to-preview.ink::after {
  content: '';
  position: absolute; inset: 0;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 50' preserveAspectRatio='xMidYMax slice'><path d='M0 32 Q 12 22 24 28 T 48 26 T 80 28 L 80 50 L 0 50 Z' fill='%233D3530' opacity='0.35'/><path d='M0 40 Q 16 32 32 36 T 64 34 L 80 36 L 80 50 L 0 50 Z' fill='%231A1715' opacity='0.5'/><path d='M18 18 q 2 -3 4 0 q 2 -3 4 0' fill='none' stroke='%231A1715' stroke-width='0.8' stroke-linecap='round' opacity='0.6'/></svg>") center bottom / cover no-repeat,
    #FFFFFF;
}
.to-preview.ink::before {
  content: '印';
  position: absolute; top: 4px; right: 4px;
  width: 14px; height: 14px;
  background: #A93226; color: #FFFFFF;
  font-size: 9px; line-height: 14px; text-align: center;
  font-family: "STKaiti","KaiTi",serif;
  border-radius: 1px;
  z-index: 2;
}
.to-preview.ink span { color: #2A2620; z-index: 1; }
.to-preview.cartoon { background: linear-gradient(135deg, #FFF7E8, #FFE3C7); }
.to-preview.cyber { background: linear-gradient(135deg, #0B0F19, #101828); }
.to-preview.cyber span { color: #00E5FF; }
.to-preview.night { background: linear-gradient(135deg, #131722, #1B2130); }
.to-preview.night span { color: #D9A05B; }
@media (max-width: 768px) {
  .theme-panel { right: 8px; left: 8px; width: auto; }
}

/* ============ 自定义背景图片 ============ */
/* 说明：body.has-custom-bg 由 JS 添加，--user-bg 变量由 JS 设为 url("...") */
body.has-custom-bg {
  background-image: var(--user-bg, none);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  /* 容器玻璃化：实色背景变半透明白，让图片透出；文字统一转深色保证可读 */
  --bg-main: rgba(255,255,255,0.80);
  --bg-sidebar: rgba(255,255,255,0.64);
  --card-bg: rgba(255,255,255,0.84);
  --input-bg: rgba(255,255,255,0.90);
  --glass-bg: rgba(255,255,255,0.84);
  --hover-bg: rgba(255,255,255,0.52);
  --text-main: #2A2A2A;
  --text-light: #6E6E6E;
  --border-color: rgba(0,0,0,0.10);
}
/* 半透明白色遮罩，压暗背景图保证对比度（覆盖水墨山峦装饰） */
body.has-custom-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: rgba(255,255,255,0.55);
}

/* 主题面板 · 自定义背景区块 */
.theme-panel-divider {
  height: 1px; background: var(--border-color);
  margin: 14px 0 12px;
}
.bg-preview {
  height: 72px; border-radius: var(--radius);
  border: 1.5px dashed var(--border-color);
  background: var(--bg-main);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-light);
  margin-bottom: 10px;
  background-size: cover; background-position: center;
  transition: var(--transition); overflow: hidden;
}
.bg-preview.has-img { border-style: solid; border-color: var(--accent-light); }
.bg-actions { display: flex; gap: 8px; }
.bg-upload-btn {
  flex: 1; padding: 8px 0; border-radius: var(--radius);
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: var(--transition);
}
.bg-upload-btn:hover { opacity: 0.88; }
.bg-clear-btn {
  padding: 8px 14px; border-radius: var(--radius);
  border: 1.5px solid var(--border-color); color: var(--text-light);
  font-size: 13px; transition: var(--transition); white-space: nowrap;
}
.bg-clear-btn:hover { border-color: var(--danger); color: var(--danger); }
.bg-hint { font-size: 10px; color: var(--text-light); margin-top: 8px; line-height: 1.5; }

/* ============ 每日收支 ============ */
/* 收入=红（进账/涨），支出=绿（花费/跌），符合中文记账直觉 */
.fin-hero {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: var(--radius-lg); padding: 22px; color: #fff;
  box-shadow: var(--card-shadow); margin-bottom: 16px; position: relative; overflow: hidden;
}
.fin-hero::after {
  content: '💸'; position: absolute; right: -8px; bottom: -16px;
  font-size: 90px; opacity: 0.12; transform: rotate(-8deg);
}
.fin-hero-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.fin-hero-label { font-size: 13px; opacity: 0.85; }
.fin-hero-amount { font-size: 32px; font-weight: 800; letter-spacing: 1px; }
.fin-hero-amount.positive { color: #fff; }
.fin-hero-amount.negative { color: #FFD9D2; }
.fin-hero-bottom { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fin-hero-item { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 120px; }
.fin-hero-item-icon { font-size: 20px; background: rgba(255,255,255,0.16); width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.fin-hero-item-val { font-size: 16px; font-weight: 700; }
.fin-hero-item-val.income { color: #FFE3B3; }
.fin-hero-item-val.expense { color: #C9F0D2; }
.fin-hero-item-label { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.fin-hero-divider { width: 1px; height: 34px; background: rgba(255,255,255,0.25); flex-shrink: 0; }

/* 快速记账 */
.fin-actions { display: flex; gap: 12px; margin-bottom: 16px; }
.fin-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 0; border-radius: var(--radius-lg); font-size: 15px; font-weight: 700;
  color: #fff; transition: var(--transition); cursor: pointer;
}
.fin-action-btn.expense { background: var(--success); }
.fin-action-btn.expense:hover { filter: brightness(0.9); box-shadow: var(--card-shadow); }
.fin-action-btn.income { background: var(--danger); }
.fin-action-btn.income:hover { filter: brightness(0.9); box-shadow: var(--card-shadow); }
.fin-action-icon { font-size: 20px; }

/* 月份切换 + 筛选 */
.fin-month-bar { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
.fin-month-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--border-color);
  background: transparent; color: var(--text-main); font-size: 16px; cursor: pointer;
  transition: var(--transition); line-height: 1;
}
.fin-month-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.fin-month-label { font-size: 15px; font-weight: 700; color: var(--text-main); min-width: 90px; text-align: center; }
.fin-filter-tabs { display: flex; gap: 8px; }
.fin-filter-tab {
  flex: 1; padding: 8px 0; border-radius: var(--radius-xl); font-size: 13px; font-weight: 600;
  background: var(--bg-main); color: var(--text-light); border: 1px solid transparent;
  cursor: pointer; transition: var(--transition); text-align: center;
}
.fin-filter-tab:hover { color: var(--accent); }
.fin-filter-tab.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-light); }

/* 分类统计 */
.fin-cat-list { display: flex; flex-direction: column; gap: 12px; }
.fin-cat-row { display: flex; align-items: center; gap: 12px; }
.fin-cat-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--bg-main); display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.fin-cat-body { flex: 1; min-width: 0; }
.fin-cat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.fin-cat-name { font-size: 13px; font-weight: 600; color: var(--text-main); }
.fin-cat-pct { font-size: 11px; color: var(--text-light); }
.fin-cat-bar-wrap { height: 7px; background: var(--bg-main); border-radius: var(--radius-xl); overflow: hidden; }
.fin-cat-bar { height: 100%; border-radius: var(--radius-xl); transition: width 0.6s ease; }
.fin-cat-bar.income { background: linear-gradient(90deg, #E07B6E, var(--danger)); }
.fin-cat-bar.expense { background: linear-gradient(90deg, #7FC99A, var(--success)); }
.fin-cat-amount { font-size: 14px; font-weight: 700; white-space: nowrap; }
.fin-cat-amount.income { color: var(--danger); }
.fin-cat-amount.expense { color: var(--success); }

/* 收支明细 */
.fin-record-count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-light); }
.fin-day-group { margin-bottom: 18px; }
.fin-day-group:last-child { margin-bottom: 0; }
.fin-day-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--bg-main); border-radius: var(--radius);
  margin-bottom: 6px;
}
.fin-day-date { display: flex; align-items: center; gap: 8px; }
.fin-day-num { font-size: 18px; font-weight: 800; color: var(--text-main); }
.fin-day-week { font-size: 12px; color: var(--text-light); }
.fin-day-today {
  font-size: 11px; font-weight: 600; color: var(--danger);
  background: var(--accent-soft); padding: 2px 8px; border-radius: var(--radius-xl);
}
.fin-day-summary { display: flex; gap: 12px; font-size: 13px; font-weight: 600; }
.fin-day-summary .income { color: var(--danger); }
.fin-day-summary .expense { color: var(--success); }
.fin-record {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-bottom: 1px solid var(--border-color); transition: var(--transition);
}
.fin-record:last-child { border-bottom: none; }
.fin-record:hover { background: var(--hover-bg); }
.fin-record-icon {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.fin-record-icon.income { background: rgba(232,120,122,0.14); }
.fin-record-icon.expense { background: rgba(107,191,126,0.14); }
.fin-record-info { flex: 1; min-width: 0; }
.fin-record-cat { font-size: 14px; font-weight: 600; color: var(--text-main); }
.fin-record-note { font-size: 12px; color: var(--text-light); margin-top: 1px; }
.fin-record-note.fin-empty-note { color: var(--border-color); }
.fin-record-amount { font-size: 14px; font-weight: 700; white-space: nowrap; }
.fin-record-amount.income { color: var(--danger); }
.fin-record-amount.expense { color: var(--success); }
.fin-record-del {
  width: 24px; height: 24px; border-radius: 50%; border: none; cursor: pointer;
  background: transparent; color: var(--text-light); font-size: 16px; line-height: 1;
  transition: var(--transition); flex-shrink: 0; opacity: 0;
}
.fin-record:hover .fin-record-del { opacity: 0.7; }
.fin-record-del:hover { background: rgba(232,120,122,0.15); color: var(--danger); opacity: 1 !important; }

/* 空状态 */
.fin-empty { text-align: center; padding: 36px 16px; }
.fin-empty-icon { font-size: 44px; opacity: 0.4; margin-bottom: 10px; }
.fin-empty-text { font-size: 15px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; }
.fin-empty-hint { font-size: 12px; color: var(--text-light); }

/* ============ 记账弹窗 ============ */
.finmodal-type { display: flex; gap: 8px; margin-bottom: 16px; }
.finmodal-type-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 0; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  background: var(--bg-main); color: var(--text-light); border: 1.5px solid var(--border-color);
  cursor: pointer; transition: var(--transition);
}
.finmodal-type-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.finmodal-type-icon { font-size: 16px; }
.finmodal-amount-wrap { margin-bottom: 14px; }
.finmodal-label { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 6px; display: block; }
.finmodal-amount {
  width: 100%; padding: 12px 14px; font-size: 24px; font-weight: 700;
  border: 1.5px solid var(--border-color); border-radius: var(--radius);
  background: var(--input-bg); color: var(--text-main); outline: none; transition: var(--transition);
}
.finmodal-amount:focus { border-color: var(--accent-light); box-shadow: 0 0 0 3px var(--accent-soft); }
.finmodal-section { margin-bottom: 14px; }
.finmodal-cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.finmodal-cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border-radius: var(--radius); border: 1.5px solid var(--border-color);
  background: var(--bg-main); cursor: pointer; transition: var(--transition);
}
.finmodal-cat:hover { border-color: var(--accent-light); }
.finmodal-cat.selected { border-color: var(--accent); background: var(--accent-soft); }
.finmodal-cat-icon { font-size: 20px; }
.finmodal-cat-name { font-size: 11px; color: var(--text-main); font-weight: 500; }
.finmodal-row { display: flex; gap: 10px; margin-bottom: 14px; }
.finmodal-row-field { flex: 1; min-width: 0; }
.finmodal-input {
  width: 100%; padding: 10px 12px; font-size: 14px; color: var(--text-main);
  border: 1.5px solid var(--border-color); border-radius: var(--radius);
  background: var(--input-bg); outline: none; transition: var(--transition);
}
.finmodal-input:focus { border-color: var(--accent-light); box-shadow: 0 0 0 3px var(--accent-soft); }
.finmodal-actions { display: flex; gap: 10px; margin-top: 4px; }
.finmodal-save {
  flex: 1; padding: 12px 0; border-radius: var(--radius); border: none;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: var(--transition);
}
.finmodal-save:hover { background: var(--accent-dark); }
.finmodal-cancel {
  padding: 12px 20px; border-radius: var(--radius); border: 1.5px solid var(--border-color);
  background: transparent; color: var(--text-light); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.finmodal-cancel:hover { border-color: var(--text-light); }

/* 移动端适配 */
@media (max-width: 600px) {
  .finmodal-cat-grid { grid-template-columns: repeat(4, 1fr); }
  .fin-hero-item { min-width: 100px; }
  .fin-hero-divider { display: none; }
  .fin-actions { flex-direction: column; }
}

/* 每日总结草稿提示条 */
.draft-hint {
  font-size: 12px; color: var(--text-light); line-height: 1.6;
  background: var(--accent-soft); border: 1px solid var(--accent-light);
  border-radius: var(--radius); padding: 8px 12px; margin-bottom: 14px;
}

/* ============ 全服公告横幅 ============ */
.announcement-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, var(--accent-soft), var(--secondary));
  border-bottom: 1px solid var(--accent-light);
  padding: 7px 20px; font-size: 13px; font-weight: 600;
  color: var(--text-main); position: relative; z-index: 98;
  overflow: hidden;
}
.announcement-icon { font-size: 16px; flex-shrink: 0; animation: ann-pulse 1.5s ease-in-out infinite; }
@keyframes ann-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.announcement-track {
  flex: 1; display: flex; align-items: center; gap: 12px;
  overflow: hidden; white-space: nowrap;
}
.ann-banner-content { color: var(--text-main); }
.ann-banner-time { color: var(--text-light); font-size: 11px; font-weight: 500; flex-shrink: 0; }

/* ============ 现金激励页面 ============ */
.reward-claimed-banner {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, var(--accent-soft), var(--secondary));
  border: 1.5px solid var(--accent-light);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px;
}
.rc-emoji { font-size: 38px; }
.rc-info { flex: 1; }
.rc-title { font-size: 15px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.rc-amount { font-size: 30px; font-weight: 800; color: var(--accent-dark); line-height: 1.1; }
.rc-time { font-size: 12px; color: var(--text-light); margin-top: 2px; }

.reward-conditions .reward-cond-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px dashed var(--border-color);
}
.reward-conditions .reward-cond-item:last-child { border-bottom: none; }
.reward-cond-item .rc-check { font-size: 20px; flex-shrink: 0; line-height: 1.4; }
.reward-cond-item .rc-body { flex: 1; }
.reward-cond-item .rc-label { font-size: 14px; font-weight: 600; color: var(--text-main); margin-bottom: 2px; }
.reward-cond-item .rc-desc { font-size: 12px; color: var(--text-light); line-height: 1.5; }
.reward-cond-item.done .rc-label { color: var(--accent); }
.reward-cond-item.done .rc-desc { color: var(--accent-dark); }

.reward-claim-section {
  display: flex; justify-content: center; margin: 20px 0;
}
.reward-claim-btn {
  font-size: 17px !important; padding: 14px 40px !important;
  box-shadow: 0 6px 18px var(--accent-glow);
  animation: reward-glow 2s ease-in-out infinite;
}
@keyframes reward-glow {
  0%,100% { opacity: 0.85; filter: brightness(0.95); }
  50% { opacity: 1; filter: brightness(1.12); }
}
@keyframes reward-pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.55), 0 6px 18px rgba(243, 156, 18, 0.4); }
  70%  { box-shadow: 0 0 0 14px rgba(243, 156, 18, 0), 0 6px 18px rgba(243, 156, 18, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(243, 156, 18, 0), 0 6px 18px rgba(243, 156, 18, 0.4); }
}

.reward-stats {
  display: flex; gap: 12px; margin: 20px 0;
}
.reward-stat-card {
  flex: 1; text-align: center; background: var(--card-bg);
  border: 1px solid var(--border-color); border-radius: var(--radius);
  padding: 18px 12px; box-shadow: var(--card-shadow);
}
.reward-stat-card .rs-value { font-size: 26px; font-weight: 800; color: var(--accent); }
.reward-stat-card .rs-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }

.reward-announcements { margin-top: 16px; }
.reward-ann-list { display: flex; flex-direction: column; gap: 8px; }
.reward-ann-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--bg-main); border-radius: var(--radius);
  border-left: 3px solid var(--accent-light);
}
.reward-ann-item .ann-content { font-size: 13px; color: var(--text-main); flex: 1; }
.reward-ann-item .ann-time { font-size: 11px; color: var(--text-light); flex-shrink: 0; }

/* ============ 现金大转盘 ============ */
.reward-prereq {
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, var(--bg-main), var(--card-bg));
}
.reward-prereq .card-title { justify-content: center; }

.reward-wheel-section { padding: 24px 20px; }
.wheel-stage {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 28px 16px 22px;
  background:
    radial-gradient(circle at 50% 30%, rgba(241, 196, 15, 0.18), transparent 65%),
    radial-gradient(circle at center, rgba(90, 139, 130, 0.08), transparent 70%);
  border-radius: 18px;
  position: relative;
}
/* 顶部说明条 */
.wheel-stage::before {
  content: '范围 1 - 20 元';
  position: absolute; top: 10px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px; letter-spacing: 1px;
  color: var(--text-light);
  background: var(--card-bg);
  padding: 3px 12px; border-radius: 999px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.wheel-display {
  width: 230px; height: 230px;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  /* 金币配色：纯金黄到暖橙，凸显"真金白银" */
  background:
    radial-gradient(circle at 30% 30%, #FFF1A8 0%, #FFD24A 30%, #F5A623 55%, #C97C16 85%, #8E5400 100%);
  box-shadow:
    0 14px 40px rgba(201, 124, 22, 0.45),
    inset 0 -10px 18px rgba(102, 60, 0, 0.35),
    inset 0 4px 10px rgba(255, 245, 200, 0.55);
  position: relative;
  border: 6px solid #fff8c4;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
  cursor: default;
  will-change: transform;
}
/* 内层圆环装饰：仿古钱币方孔 */
.wheel-display::before {
  content: ''; position: absolute; inset: 14px;
  border: 2px dashed rgba(255, 248, 196, 0.55);
  border-radius: 50%;
  pointer-events: none;
}
.wheel-display::after {
  content: '¥';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 180px; font-weight: 900;
  color: rgba(255, 248, 196, 0.06);
  z-index: 0;
  pointer-events: none;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
/* 静态：温和呼吸 + 悬停微微抬起 */
.wheel-display.idle {
  animation: wheel-breath 3.6s ease-in-out infinite;
}
.wheel-display.idle:hover {
  transform: scale(1.04) translateY(-5px);
  box-shadow:
    0 22px 50px rgba(201, 124, 22, 0.55),
    inset 0 -10px 18px rgba(102, 60, 0, 0.35),
    inset 0 4px 10px rgba(255, 245, 200, 0.65);
}
.wheel-display.spinning {
  animation: wheel-rotate 0.18s linear infinite;
  cursor: wait;
}
.wheel-display.landed {
  animation: wheel-bounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 16px 56px rgba(241, 196, 15, 0.7),
    inset 0 -10px 18px rgba(102, 60, 0, 0.35),
    inset 0 4px 10px rgba(255, 245, 200, 0.7);
  cursor: default;
}
@keyframes wheel-breath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}
@keyframes wheel-rotate {
  from { transform: rotate(0deg) scale(1); }
  to   { transform: rotate(360deg) scale(1.02); }
}
@keyframes wheel-bounce {
  0%   { transform: scale(0.92); }
  40%  { transform: scale(1.12); }
  70%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}
/* 灯泡外环：8 颗小圆点绕转盘外圈慢转 */
.wheel-display .wheel-orbit {
  position: absolute; inset: -14px;
  border-radius: 50%;
  pointer-events: none;
  animation: orbit-spin 8s linear infinite;
}
.wheel-display .wheel-orbit span {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, #fff8c4 0%, #f1c40f 60%, transparent 100%);
  box-shadow: 0 0 8px #f1c40f, 0 0 14px rgba(241, 196, 15, 0.6);
  top: 50%; left: 50%; transform-origin: 0 0;
}
.wheel-display .wheel-orbit span:nth-child(1) { transform: rotate(0deg)   translateX(120px) translateY(-5px); }
.wheel-display .wheel-orbit span:nth-child(2) { transform: rotate(45deg)  translateX(120px) translateY(-5px); }
.wheel-display .wheel-orbit span:nth-child(3) { transform: rotate(90deg)  translateX(120px) translateY(-5px); }
.wheel-display .wheel-orbit span:nth-child(4) { transform: rotate(135deg) translateX(120px) translateY(-5px); }
.wheel-display .wheel-orbit span:nth-child(5) { transform: rotate(180deg) translateX(120px) translateY(-5px); }
.wheel-display .wheel-orbit span:nth-child(6) { transform: rotate(225deg) translateX(120px) translateY(-5px); }
.wheel-display .wheel-orbit span:nth-child(7) { transform: rotate(270deg) translateX(120px) translateY(-5px); }
.wheel-display .wheel-orbit span:nth-child(8) { transform: rotate(315deg) translateX(120px) translateY(-5px); }
.wheel-display.spinning .wheel-orbit { animation-duration: 1.2s; }
.wheel-display.landed .wheel-orbit  { animation: none; opacity: 0; transition: opacity 0.4s; }
@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.wheel-amount {
  font-size: 46px; font-weight: 900; color: #fff8c4;
  text-shadow:
    0 0 12px rgba(255, 245, 200, 0.6),
    0 2px 6px rgba(102, 60, 0, 0.7),
    0 1px 2px rgba(0, 0, 0, 0.4);
  z-index: 2; line-height: 1;
  display: flex; align-items: baseline; gap: 2px;
  position: relative;
}
.wheel-amount #wheelNumber {
  font-size: 64px; font-variant-numeric: tabular-nums;
  transition: color 0.3s, text-shadow 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.wheel-display.landed .wheel-amount #wheelNumber {
  color: #fff;
  text-shadow:
    0 0 18px #fff8c4,
    0 0 32px #f1c40f,
    0 2px 6px rgba(102, 60, 0, 0.8);
  transform: scale(1.18);
  animation: number-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes number-pop {
  0%   { transform: scale(0.6) rotate(-8deg); opacity: 0.4; }
  60%  { transform: scale(1.3) rotate(3deg);  opacity: 1; }
  100% { transform: scale(1.18) rotate(0deg); opacity: 1; }
}
.wheel-hint {
  font-size: 11px; color: rgba(255, 248, 196, 0.95);
  margin-top: 8px; z-index: 2;
  text-shadow: 0 1px 2px rgba(102, 60, 0, 0.5);
  transition: opacity 0.3s;
  letter-spacing: 0.5px;
}
.wheel-display.spinning + .reward-spin-btn-wrap .wheel-result-tip,
.wheel-display.landed  + .reward-spin-btn-wrap .wheel-result-tip { opacity: 1; }
.reward-spin-btn {
  position: relative;
  font-size: 15px !important; padding: 12px 32px !important;
  background: linear-gradient(135deg, #F1C40F 0%, #F39C12 100%) !important;
  border: none !important; color: #fff !important;
  box-shadow: 0 6px 18px rgba(243, 156, 18, 0.4);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s ease,
              filter 0.25s ease;
  animation: reward-pulse-ring 2.4s ease-out infinite;
  will-change: transform, box-shadow;
}
.reward-spin-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 26px rgba(243, 156, 18, 0.55), 0 0 0 6px rgba(243, 156, 18, 0.12);
  filter: brightness(1.08);
}
.reward-spin-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 3px 10px rgba(243, 156, 18, 0.45);
  filter: brightness(0.95);
  transition-duration: 0.08s;
}
.reward-spin-btn:disabled {
  opacity: 0.85;
  cursor: not-allowed;
  animation: none;
  filter: saturate(0.85);
}
.reward-spin-btn-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.wheel-result-tip {
  font-size: 12px; color: var(--text-light);
  min-height: 18px; opacity: 0;
  transition: opacity 0.4s ease;
  text-align: center;
}

.reward-submit-form {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-main);
  border-radius: 14px;
  border: 1px dashed var(--accent-light);
  animation: fade-in 0.4s ease-out;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.wheel-result-tip {
  font-size: 14px; color: var(--text-main); margin-bottom: 14px;
  padding: 10px 14px; background: var(--card-bg); border-radius: 10px;
  border-left: 3px solid var(--accent);
}
.form-field { margin-bottom: 12px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-main); margin-bottom: 6px;
}
.form-textarea, .form-input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--border-color); border-radius: 10px;
  font-size: 14px; font-family: inherit;
  background: var(--card-bg); color: var(--text-main);
  box-sizing: border-box; outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.form-textarea:focus, .form-input:focus { border-color: var(--accent); }

/* 已提交状态卡片 */
.reward-submitted {
  background: linear-gradient(135deg, var(--card-bg), var(--bg-main));
  border: 1.5px solid var(--accent-light);
}
.submitted-header {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 14px; border-bottom: 1px dashed var(--border-color);
}
.submitted-icon { font-size: 42px; line-height: 1; }
.submitted-info { flex: 1; }
.submitted-title { font-size: 13px; color: var(--text-light); margin-bottom: 4px; }
.submitted-status {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.status-pending { background: #FFF3CD; color: #856404; }
.status-approved { background: #D1ECF1; color: #0C5460; }
.status-paid { background: #D4EDDA; color: #155724; }
.status-rejected { background: #F8D7DA; color: #721C24; }
.submitted-amount { text-align: right; }
.submitted-amount .sa-label { font-size: 11px; color: var(--text-light); }
.submitted-amount .sa-value { font-size: 26px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.submitted-meta { padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.submitted-meta .meta-item { font-size: 13px; color: var(--text-main); }
.submitted-meta .meta-item span { color: var(--text-light); margin-right: 4px; }
.reject-reason { color: #721C24 !important; }
.pending-tip, .approved-tip, .paid-tip {
  padding: 8px 12px; border-radius: 8px; font-size: 12px;
  background: rgba(90, 139, 130, 0.08); color: var(--accent-dark);
  margin-top: 4px;
}
.reject-reason { padding: 8px 12px; background: rgba(231, 76, 60, 0.08); border-radius: 8px; }

/* 申请历史 */
.reward-history-section { margin-top: 16px; }
.reward-history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--bg-main); border-radius: 10px;
  border-left: 3px solid var(--border-color);
  flex-wrap: wrap;
}
.history-item.status-pending { border-left-color: #FFC107; }
.history-item.status-approved { border-left-color: #17A2B8; }
.history-item.status-paid { border-left-color: #28A745; }
.history-item.status-rejected { border-left-color: #DC3545; }
.hi-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.hi-icon { font-size: 22px; }
.hi-date { font-size: 13px; color: var(--text-main); font-weight: 600; }
.hi-status { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.hi-amount { font-size: 18px; font-weight: 800; color: var(--accent); }
.hi-reason { font-size: 11px; color: #DC3545; width: 100%; padding-left: 32px; }


@media (max-width: 600px) {
  .reward-stats { flex-direction: column; }
  .reward-claimed-banner { flex-direction: column; text-align: center; }
}

/* ============================================================
   设计系统 v2 · 统一组件层
   目的：页面渲染全部改用类名，消除 210 处内联 style 与 36 处硬编码颜色
   ============================================================ */

/* ---------- 1. 页面骨架 ---------- */
.page-head {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  margin-bottom: var(--sp-5); flex-wrap: wrap;
}
.page-head-main { flex: 1; min-width: 0; }
.page-head .page-title { margin-bottom: var(--sp-1); }
.page-head .page-subtitle { margin-bottom: 0; }
.page-head-actions {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
}

/* 区块（替代散落的 .card + 内联标题） */
.sec { margin-bottom: var(--sp-4); }
.sec-head {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-3); flex-wrap: wrap;
}
.sec-title {
  font-size: var(--fs-lg); font-weight: 700; color: var(--text-main);
  display: flex; align-items: center; gap: 6px; min-width: 0;
}
.sec-sub { font-size: var(--fs-sm); color: var(--text-light); }
.sec-actions { margin-left: auto; display: flex; gap: var(--sp-2); flex-shrink: 0; }

/* ---------- 2. 统计卡 ---------- */
.stat-grid {
  display: grid; gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat-cell {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: var(--sp-4); box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; gap: var(--sp-1);
  position: relative; overflow: hidden;
}
.stat-cell.is-accent { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #fff; }
.stat-cell.is-accent .stat-label { color: rgba(255,255,255,0.85); }
.stat-cell.is-accent .stat-value { color: #fff; }
.stat-label { font-size: var(--fs-sm); color: var(--text-light); display: flex; align-items: center; gap: 4px; }
.stat-value {
  font-size: var(--fs-2xl); font-weight: 800; color: var(--text-main);
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.stat-value small { font-size: var(--fs-sm); font-weight: 600; color: var(--text-light); margin-left: 3px; }
.stat-delta { font-size: var(--fs-xs); font-weight: 600; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ---------- 3. 统一列表 ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--border-color);
  min-height: 52px;
}
.list-row:last-child { border-bottom: none; }
.list-row.is-tap { cursor: pointer; border-radius: var(--radius); transition: var(--transition); }
.list-row.is-tap:hover { background: var(--hover-bg); }
.list-row.is-tap:active { background: var(--surface-3); }
.lr-lead {
  width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: var(--accent-soft); color: var(--accent);
}
.lr-main { flex: 1; min-width: 0; }
.lr-title {
  font-size: var(--fs-md); font-weight: 600; color: var(--text-main);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lr-sub {
  font-size: var(--fs-sm); color: var(--text-light); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lr-meta { font-size: var(--fs-sm); color: var(--text-light); flex-shrink: 0; }
.lr-actions { display: flex; gap: var(--sp-2); flex-shrink: 0; align-items: center; }
.list-row.is-done .lr-title { text-decoration: line-through; color: var(--text-light); }

/* 键值行 */
.kv { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 7px 0; }
.kv-key { font-size: var(--fs-base); color: var(--text-light); }
.kv-val { font-size: var(--fs-md); font-weight: 600; color: var(--text-main); }
.kv-val.mono { font-variant-numeric: tabular-nums; }

/* ---------- 4. 分段控件（替代横向 tab） ---------- */
.seg {
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface-2); border-radius: var(--radius);
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg-item {
  flex: 1 0 auto; padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: var(--fs-md); font-weight: 600; color: var(--text-light);
  white-space: nowrap; transition: var(--transition); text-align: center;
  min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 5px;
}
.seg-item:hover { color: var(--text-main); }
.seg-item.active { background: var(--card-bg); color: var(--accent); box-shadow: var(--shadow-sm); }

/* ---------- 5. 标签 / 徽标 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--radius-full);
  font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
}
.pill-accent  { background: var(--accent-soft);  color: var(--accent); }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-warn    { background: var(--warning-soft); color: var(--warning); }
.pill-danger  { background: var(--danger-soft);  color: var(--danger); }
.pill-info    { background: var(--info-soft);    color: var(--info); }
.pill-muted   { background: var(--surface-3);    color: var(--text-light); }

.badge-dot {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-full); background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--card-bg);
}

/* ---------- 6. 状态块（覆盖 .tag 旧用法，主题安全） ---------- */
.alert {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
  font-size: var(--fs-base); line-height: 1.6;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft); color: var(--text-main);
}
.alert-success { border-left-color: var(--success); background: var(--success-soft); }
.alert-warn    { border-left-color: var(--warning); background: var(--warning-soft); }
.alert-danger  { border-left-color: var(--danger);  background: var(--danger-soft); }
.alert-info    { border-left-color: var(--info);    background: var(--info-soft); }
.alert-icon { font-size: 17px; flex-shrink: 0; line-height: 1.5; }

/* ---------- 7. 图表容器（响应式，替代固定 200px） ---------- */
.chart-box {
  position: relative; width: 100%;
  height: clamp(160px, 32vw, 240px);
}
.chart-box.is-tall { height: clamp(200px, 42vw, 300px); }
.chart-box canvas { width: 100% !important; height: 100% !important; }

/* ---------- 8. 进度环 ---------- */
.ring { position: relative; width: 76px; height: 76px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring .ring-bg  { stroke: var(--surface-3); }
.ring .ring-val { stroke: var(--accent); transition: stroke-dashoffset 0.8s ease; }
.ring-text {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: var(--fs-lg); font-weight: 800; color: var(--text-main);
}
.ring-text small { font-size: 10px; font-weight: 600; color: var(--text-light); }

/* ---------- 9. 移动端底部抽屉（替代全屏 modal） ---------- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: var(--overlay-bg); backdrop-filter: blur(2px);
  display: none; align-items: flex-end; justify-content: center;
}
.sheet-overlay.show { display: flex; }
.sheet {
  background: var(--card-bg); width: 100%; max-width: 560px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 88vh; display: flex; flex-direction: column;
  animation: sheet-up 0.26s cubic-bezier(0.4,0,0.2,1);
  padding-bottom: env(safe-area-inset-bottom);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grip {
  width: 38px; height: 4px; border-radius: var(--radius-full);
  background: var(--surface-3); margin: 10px auto 4px; flex-shrink: 0;
}
.sheet-head {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5) var(--sp-3);
  border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.sheet-title { font-size: var(--fs-lg); font-weight: 700; flex: 1; min-width: 0; }
.sheet-body { padding: var(--sp-5); overflow-y: auto; flex: 1; }
.sheet-foot {
  padding: var(--sp-3) var(--sp-5) var(--sp-5);
  display: flex; gap: var(--sp-3); flex-shrink: 0;
  border-top: 1px solid var(--border-color);
}
.sheet-foot .btn { flex: 1; justify-content: center; }

/* 桌面端：抽屉退化为居中弹窗 */
@media (min-width: 601px) {
  .sheet-overlay { align-items: center; padding: var(--sp-5); }
  .sheet { border-radius: var(--radius-lg); max-height: 84vh; padding-bottom: 0; }
  .sheet-grip { display: none; }
}

/* ---------- 10. 骨架屏 ---------- */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: skel-shine 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm); height: 14px;
}
@keyframes skel-shine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skel-line { margin-bottom: var(--sp-2); }
.skel-card { height: 84px; border-radius: var(--radius-lg); margin-bottom: var(--sp-3); }

/* ---------- 11. 手势：左滑删除 ---------- */
.swipe-wrap { position: relative; overflow: hidden; }
.swipe-body {
  position: relative; z-index: 2; background: var(--card-bg);
  transition: transform 0.24s cubic-bezier(0.4,0,0.2,1);
  will-change: transform;
}
.swipe-action {
  position: absolute; right: 0; top: 0; bottom: 0; width: 84px;
  display: flex; align-items: center; justify-content: center;
  background: var(--danger); color: #fff; font-size: var(--fs-sm); font-weight: 700;
  gap: 4px; flex-direction: column;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.swipe-action-icon { font-size: 18px; }

/* ---------- 12. 手势：下拉刷新 ---------- */
.pull-indicator {
  height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
  gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-light);
  transition: height 0.2s ease;
}
.pull-indicator.show { height: 44px; }
.pull-indicator.is-spin .pull-spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 13. 悬浮快捷操作 ---------- */
.fab-stack {
  position: fixed; right: 16px; bottom: calc(70px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--sp-3); z-index: 80;
  align-items: flex-end;
}
@media (min-width: 769px) { .fab-stack { bottom: 24px; } }
.fab-mini {
  width: 44px; height: 44px; border-radius: var(--radius-full);
  background: var(--card-bg); color: var(--accent);
  box-shadow: var(--card-shadow-hover);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  transition: var(--transition); border: 1px solid var(--border-color);
}
.fab-mini:hover { transform: translateY(-2px); }
.fab-mini:active { transform: scale(0.94); }

/* ---------- 14. 工具栏 ---------- */
.toolbar {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap; margin-bottom: var(--sp-3);
}
.toolbar-spacer { flex: 1; }

/* ---------- 15. 原子工具类（取代内联布局样式） ---------- */
.row        { display: flex; align-items: center; gap: var(--sp-2); }
.row-top    { display: flex; align-items: flex-start; gap: var(--sp-2); }
.row-between{ display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.row-end    { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.col        { display: flex; flex-direction: column; gap: var(--sp-2); }
.col-4      { display: flex; flex-direction: column; gap: var(--sp-4); }
.wrap       { flex-wrap: wrap; }
.grow       { flex: 1; min-width: 0; }
.center     { text-align: center; }
.right      { text-align: right; }
.ml-auto    { margin-left: auto; }
.mt-2 { margin-top: var(--sp-2); }  .mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }  .mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }.mb-4 { margin-bottom: var(--sp-4); }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.t-xs { font-size: var(--fs-xs); } .t-sm { font-size: var(--fs-sm); }
.t-base { font-size: var(--fs-base); } .t-md { font-size: var(--fs-md); }
.t-lg { font-size: var(--fs-lg); } .t-xl { font-size: var(--fs-xl); }
.t-light { color: var(--text-light); } .t-accent { color: var(--accent); }
.t-danger { color: var(--danger); } .t-success { color: var(--success); }
.t-warn { color: var(--warning); } .t-bold { font-weight: 700; }
.t-mono { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }
.divider { height: 1px; background: var(--border-color); margin: var(--sp-3) 0; }
.scroll-x { overflow-x: auto; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.pad-0 { padding: 0 !important; }
.full { width: 100%; }
.hide { display: none !important; }

/* ============================================================
   设计系统 v2 · 移动端适配修正
   ============================================================ */

/* 触摸目标不小于 44px（iOS HIG 建议） */
@media (hover: none) and (pointer: coarse) {
  /* 可点击的行/导航严格 44px */
  .list-row.is-tap, .nav-item, .quick-btn, .bottom-tab-item, .seg-item { min-height: 44px; }
  /* 按钮给 40px：既满足触控，又不让卡片标题栏过高 */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; padding: 8px 14px; }
  .btn-icon { width: 40px; height: 40px; }
  /* 去掉 hover 产生的粘滞效果 */
  .card:hover { box-shadow: var(--card-shadow); }
}

@media (max-width: 768px) {
  /* 页面头：操作按钮换行并撑满，避免被挤到外面 */
  .page-head { flex-direction: column; align-items: stretch; gap: var(--sp-3); }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; justify-content: center; }
  .page-title { font-size: var(--fs-xl); }

  /* 统计卡窄屏两列 */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
  .stat-value { font-size: var(--fs-xl); }

  /* 列表：操作按钮不换行、副标题允许截断 */
  .list-row { padding: var(--sp-3) var(--sp-1); gap: var(--sp-2); }
  .lr-actions .btn { padding: 6px 10px; font-size: var(--fs-sm); }

  /* 内容区内边距 + 底部 Tab 安全区 */
  .content { padding: var(--sp-4) var(--sp-3) calc(76px + env(safe-area-inset-bottom)); }
  .card { padding: var(--sp-4); border-radius: var(--radius); }

  /* 分段控件横向滚动 */
  .seg { justify-content: flex-start; }
  .seg-item { padding: 8px 12px; font-size: var(--fs-base); }

  /* 分段控件：窄屏改为换行铺满，避免选项滑出屏幕外看不见（原来 6 项需 705px） */
  .seg { flex-wrap: wrap; overflow-x: visible; gap: 4px; }
  .seg-item {
    flex: 1 1 calc(33.333% - 4px);
    min-width: 0;
    padding: 9px 8px;
    font-size: var(--fs-sm);
    gap: 3px;
    overflow: hidden;
  }
  /* 文字过长时省略号截断，避免把按钮撑破 */
  .seg-icon { flex-shrink: 0; }
  .seg-text {
    min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }

  /* 图表在窄屏降低高度，防止挤压首屏 */
  .chart-box { height: 180px; }
  .chart-box.is-tall { height: 220px; }
}

@media (max-width: 600px) {
  .stat-grid { gap: var(--sp-2); }
  .stat-cell { padding: var(--sp-3); }
  .sheet { max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .sheet-body { padding: var(--sp-4); }
  /* 弹窗底部按钮吸底，避免被键盘顶走 */
  .sheet-foot { padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: var(--fs-lg); }
  .page-title { font-size: var(--fs-lg); }
  .btn { padding: 8px 12px; font-size: var(--fs-base); }
  .lr-actions .btn { padding: 5px 8px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 16. 左滑行包裹后的分隔线修正 ----------
   .list-row 被 .swipe-wrap 单独包裹后，每行都成了各自父节点的 :last-child，
   原有的 border-bottom 会被 :last-child 规则抵消，导致行与行之间没有分隔线。 */
.swipe-wrap { border-bottom: 1px solid var(--border-color); }
.swipe-wrap:last-child { border-bottom: none; }
.swipe-wrap .list-row { border-bottom: none; }
.swipe-body .list-row { border-bottom: none; }

/* ---------- 17. 日历圆点：图例处脱离 .calendar-cell 后需要自身尺寸 ---------- */
.cc-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.calendar-cell .cc-dot { width: 5px; height: 5px; }
.dot-study { background: var(--accent); }
.dot-exercise { background: var(--warning); }
.dot-summary { background: var(--success); }

/* ============================================================
   第三批 · 个性化增强
   ============================================================ */

/* ---------- 18. 主题：夜读（深色，暖调护眼） ---------- */
body[data-theme="night"] {
  --bg-main: #131722;        /* 深墨蓝底 */
  --bg-sidebar: #0F131C;     /* 更深的侧栏 */
  --accent: #D9A05B;         /* 暖琥珀·主色 */
  --accent-light: #E8BC85;
  --accent-dark: #B8834A;
  --secondary: #4A5568;
  --secondary-dark: #3A4553;
  --text-main: #E4E7EE;      /* 柔和白·不刺眼 */
  --text-light: #8B93A5;
  --card-bg: #1B2130;        /* 卡片略浅，形成层次 */
  --card-shadow: 0 2px 12px rgba(0,0,0,0.30);
  --card-shadow-hover: 0 6px 24px rgba(0,0,0,0.45);
  --danger: #E8798A;
  --success: #6BC98A;
  --warning: #E8B65B;
  --input-bg: #161B28;
  --border-color: rgba(255,255,255,0.09);
  --hover-bg: rgba(255,255,255,0.05);
  --auth-grad: linear-gradient(135deg, #131722 0%, #0F131C 100%);
  --accent-glow: rgba(217,160,91,0.35);
  --glass-bg: rgba(27,33,48,0.80);
  --accent-soft: rgba(217,160,91,0.14);

  --danger-soft: rgba(232,121,138,0.16);
  --success-soft: rgba(107,201,138,0.15);
  --warning-soft: rgba(232,182,91,0.16);
  --info: #6FA8DC;
  --info-soft: rgba(111,168,220,0.15);
  --surface-2: rgba(255,255,255,0.035);
  --surface-3: rgba(255,255,255,0.075);
  --overlay-bg: rgba(0,0,0,0.62);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
  --chart-1: #D9A05B; --chart-2: #6FA8DC; --chart-3: #6BC98A;
  --chart-4: #C98BB9; --chart-5: #E8798A;
  --chart-grid: rgba(255,255,255,0.07);
}
body[data-theme="night"] .sidebar,
body[data-theme="night"] .topbar,
body[data-theme="night"] .card,
body[data-theme="night"] .modal,
body[data-theme="night"] .sheet,
body[data-theme="night"] .ai-panel { border: 1px solid rgba(255,255,255,0.06); }
body[data-theme="night"] .nav-item.active { color: #131722; }
body[data-theme="night"] ::-webkit-scrollbar-thumb { background: rgba(217,160,91,0.45); }

/* ---------- 19. 字号档位（跟随「个性化」面板） ---------- */
body[data-fs="sm"] {
  --fs-xs: 10px; --fs-sm: 11px; --fs-base: 12px;
  --fs-md: 13px; --fs-lg: 15px; --fs-xl: 18px; --fs-2xl: 21px;
}
body[data-fs="lg"] {
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px;
  --fs-md: 15px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 27px;
}

/* ============================================================
   第三批 · 数据看板
   ============================================================ */

/* ---------- 20. 打卡热力图 ---------- */
.heat-wrap { display: flex; flex-direction: column; gap: var(--sp-2); }
.heat-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.heat-cell {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: var(--surface-3);
  min-height: 12px;
}
.heat-lv0 { background: var(--surface-3); }
.heat-lv1 { background: var(--accent); opacity: 0.28; }
.heat-lv2 { background: var(--accent); opacity: 0.50; }
.heat-lv3 { background: var(--accent); opacity: 0.72; }
.heat-lv4 { background: var(--accent); opacity: 1; }
.heat-cell.is-empty { background: transparent; }
.heat-cell.is-today { outline: 2px solid var(--accent); outline-offset: 1px; }
.heat-legend {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); color: var(--text-light);
  justify-content: flex-end;
}
.heat-legend .heat-cell { width: 12px; height: 12px; min-height: 0; aspect-ratio: auto; }

/* ---------- 21. 迷你柱状趋势（纯 CSS，无需 Chart.js） ---------- */
.spark {
  display: flex; align-items: flex-end; gap: 3px;
  height: 60px; padding-top: var(--sp-2);
}
.spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.spark-bar {
  width: 100%; max-width: 26px; border-radius: 3px 3px 0 0;
  background: var(--accent); opacity: 0.85; min-height: 2px;
  transition: height 0.4s ease;
}
.spark-bar.is-peak { opacity: 1; }
.spark-label {
  font-size: 9px; color: var(--text-light); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* ---------- 22. 榜单行（排行榜） ---------- */
.rank-row { display: flex; align-items: center; gap: var(--sp-3); padding: 7px 0; }
.rank-no {
  width: 22px; height: 22px; border-radius: var(--radius-full); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 800;
  background: var(--surface-3); color: var(--text-light);
}
.rank-no.is-top { background: var(--accent); color: #fff; }
.rank-name { flex: 1; min-width: 0; font-size: var(--fs-base); }
.rank-bar { width: 72px; height: 6px; border-radius: var(--radius-full); background: var(--surface-3); overflow: hidden; flex-shrink: 0; }
.rank-bar > i { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-full); }
.rank-val { font-size: var(--fs-sm); color: var(--text-light); width: 46px; text-align: right; flex-shrink: 0; }

/* ============================================================
   第三批 · 消息中心
   ============================================================ */
.notify-btn { position: relative; }
.notify-item {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--border-color);
}
.notify-item:last-child { border-bottom: none; }
.notify-item.is-unread { background: var(--accent-soft); border-radius: var(--radius); }
.notify-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: var(--surface-2);
}
.notify-body { flex: 1; min-width: 0; }
.notify-title { font-size: var(--fs-md); font-weight: 600; color: var(--text-main); }
.notify-desc { font-size: var(--fs-sm); color: var(--text-light); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.notify-time { font-size: var(--fs-xs); color: var(--text-light); margin-top: 4px; }
.notify-filter { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }

/* ============================================================
   第三批 · 快捷操作 / 手势
   ============================================================ */
.fab-stack.is-hidden { display: none; }
.fab-mini.is-accent { background: var(--accent); color: #fff; border-color: transparent; }
/* .fab-mini 是 flex 布局，会覆盖 UA 的 [hidden]{display:none}，需显式声明 */
.fab-mini[hidden] { display: none; }

/* 长按拖动排序 */
.drag-handle { cursor: grab; touch-action: none; color: var(--text-light); font-size: 15px; padding: 0 2px; }
.list-row.is-dragging {
  opacity: 0.92;
  box-shadow: var(--card-shadow-hover);
  border-radius: var(--radius);
  background: var(--card-bg);
  position: relative;
  z-index: 10;
}
.list-row.is-drop-target { box-shadow: inset 0 2px 0 var(--accent); }
body.is-drag-active { cursor: grabbing; user-select: none; }
.drag-tip { font-size: var(--fs-xs); color: var(--text-light); }




