/* ============================================================
   英语四六级工作台 (CET-4/6 Workbench)
   视觉方向：暖色编辑风 / 书房质感（与专升本「静海/octopus」区分）
   默认浅色暖象牙底 + 暖金强调色 + 衬线标题；仍保留五套强调色 /
   流体概览卡 / 3D 环绕卡 / 时间轴 / 设置抽屉 / 移动端响应式
   额外升级：单词翻转卡、SVG 进度环、模考趋势图、打卡 streak
   纯静态，无第三方依赖。
   ============================================================ */

:root {
  /* 深色：深咖底（暖调，区别于冷调静海） */
  --bg: #17120c;
  --bg-2: #221a10;
  --panel: #241c12;
  --panel-2: #2e2417;
  --panel-soft: #2a2114;
  --line: #3a2e1d;
  --line-bright: #4d3d27;
  --text: #f4ece0;
  --muted: #b09a7e;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);

  /* 强调色：默认暖金 amber */
  --accent-h: 38;
  --accent-s: 72%;
  --accent-l: 50%;
  --accent-rgb: 214, 158, 64;
  --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-50: hsl(var(--accent-h), var(--accent-s), 95%);
  --accent-100: hsl(var(--accent-h), var(--accent-s), 88%);
  --accent-200: hsl(var(--accent-h), var(--accent-s), 76%);
  --accent-300: hsl(var(--accent-h), var(--accent-s), 64%);
  --accent-400: hsl(var(--accent-h), var(--accent-s), 54%);
  --accent-500: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-600: hsl(var(--accent-h), var(--accent-s), 42%);
  --accent-700: hsl(var(--accent-h), var(--accent-s), 34%);
  --accent-800: hsl(var(--accent-h), var(--accent-s), 26%);
  --accent-900: hsl(var(--accent-h), var(--accent-s), 18%);
  --accent-foreground: #2a1c05;
  --accent-ink: #fff7e6;

  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 22px;
  --gap: 18px;
  --maxw: 1320px;
  --flow-speed: 14s;
}

/* 强调色变体（哑光编辑调，弱化 octopus 霓虹感） */
html[data-accent="emerald"] { --accent-h: 150; --accent-s: 46%; --accent-l: 40%; --accent-rgb: 38, 140, 96; --accent-foreground: #06251a; --accent-ink: #e9fff4; }
html[data-accent="ocean"] { --accent-h: 200; --accent-s: 52%; --accent-l: 44%; --accent-rgb: 40, 122, 166; --accent-foreground: #04222e; --accent-ink: #e6f7ff; }
html[data-accent="iris"] { --accent-h: 256; --accent-s: 52%; --accent-l: 62%; --accent-rgb: 124, 104, 224; --accent-foreground: #140a2c; --accent-ink: #f1ecff; }
html[data-accent="amber"] { --accent-h: 38; --accent-s: 72%; --accent-l: 50%; --accent-rgb: 214, 158, 64; --accent-foreground: #2a1c05; --accent-ink: #fff7e6; }
html[data-accent="sakura"] { --accent-h: 338; --accent-s: 54%; --accent-l: 60%; --accent-rgb: 214, 110, 160; --accent-foreground: #2c0820; --accent-ink: #ffe9f4; }

html[data-theme="light"] {
  --bg: #f6efe2;
  --bg-2: #efe6d4;
  --panel: #fffdf8;
  --panel-2: #fbf5ea;
  --panel-soft: #f1e8d6;
  --line: #e6d9c2;
  --line-bright: #d8c6a6;
  --text: #2c2418;
  --muted: #8a7659;
  --shadow: 0 12px 34px rgba(80, 60, 30, 0.14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 800px at 80% -10%, var(--bg-2), var(--bg)) fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(var(--accent-rgb), 0.3); }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: .3px; font-family: Georgia, "Songti SC", "Noto Serif SC", serif; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-400), var(--accent-700));
  color: var(--accent-foreground);
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), .4);
}
.brand .logo svg { width: 22px; height: 22px; }
.topbar .search {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-soft); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 999px;
}
.topbar .search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 14px; }
.topbar .search input::placeholder { color: var(--muted); }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--panel-soft); border: 1px solid var(--line); color: var(--text);
  transition: .2s;
}
.icon-btn:hover { border-color: var(--line-bright); background: var(--panel-2); }
.icon-btn svg { width: 20px; height: 20px; }

.shell { display: grid; grid-template-columns: 250px 1fr; gap: var(--gap); max-width: var(--maxw); margin: 0 auto; padding: 20px; }

.nav { position: sticky; top: 74px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.nav .nav-group { font-size: 11px; color: var(--muted); padding: 14px 12px 6px; letter-spacing: .12em; text-transform: uppercase; }
.nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  text-align: left; padding: 10px 12px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font-size: 14px; transition: .18s;
}
.nav button svg { width: 18px; height: 18px; flex: none; }
.nav button:hover { color: var(--text); background: var(--panel-soft); }
.nav button[aria-current="true"] { color: var(--text); background: var(--panel-2); border-color: var(--line); box-shadow: inset 3px 0 0 var(--accent); }

.main { min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.section { display: none; }
.section.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px);} to { opacity:1; transform:none; } }
.section h2 { margin: 4px 0 14px; font-size: 21px; display: flex; align-items: center; gap: 10px; font-family: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif; letter-spacing: .2px; }
.section h2 .sub { font-size: 13px; color: var(--muted); font-weight: 500; }

/* 流体概览卡 */
.cards-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.fluid-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg); padding: 18px;
  border: 1px solid var(--line); color: #fff;
  min-height: 132px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow); isolation: isolate;
}
.fluid-card::before {
  content: ""; position: absolute; inset: -40%;
  background:
    radial-gradient(circle at 20% 20%, var(--fc-a, #10b2c4), transparent 55%),
    radial-gradient(circle at 80% 30%, var(--fc-b, #6a5cff), transparent 50%),
    radial-gradient(circle at 50% 90%, var(--fc-c, #0a345c), transparent 55%);
  opacity: var(--fc-opacity, .85);
  filter: blur(var(--fc-blur, 22px));
  animation: flow var(--flow-speed, 14s) linear infinite;
  z-index: -1;
}
@keyframes flow { 0% { transform: translate(0,0) rotate(0deg); } 50% { transform: translate(-6%, 4%) rotate(8deg); } 100% { transform: translate(0,0) rotate(0deg); } }
.fluid-card .label { font-size: 13px; opacity: .9; }
.fluid-card .value { font-size: 34px; font-weight: 800; line-height: 1; }
.fluid-card .hint { font-size: 12px; opacity: .85; }
.fluid-card.accent-tint { color: var(--accent-ink); }

/* 3D 环绕卡场景 */
.stage-wrap { position: relative; }
.stage { position: relative; height: 340px; margin: 6px 0 4px; perspective: 1400px; display: grid; place-items: center; }
.ring { position: relative; width: 260px; height: 300px; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.card3d {
  position: absolute; inset: 0; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line-bright);
  backdrop-filter: blur(8px); box-shadow: var(--shadow);
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
  backface-visibility: hidden; transition: opacity .5s, box-shadow .3s;
}
.card3d .tag { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: .08em; }
.card3d h3 { margin: 2px 0; font-size: 17px; }
.card3d p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.card3d .go { margin-top: auto; font-size: 13px; color: var(--accent); font-weight: 600; }
.stage-ctrl { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; }
.stage-ctrl button { width: 42px; height: 42px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--text); display: grid; place-items: center; }
.stage-ctrl button:hover { border-color: var(--accent); color: var(--accent); }
.dots { display: flex; gap: 6px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-bright); display: block; transition: .3s; }
.dots i.on { background: var(--accent); width: 18px; border-radius: 4px; }

/* 时间轴 */
.timeline { position: relative; padding-left: 26px; margin: 4px 0; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 10px 0 16px; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.tl-item.done::before { background: var(--accent); }
.tl-item.urgent::before { border-color: #ff5d5d; box-shadow: 0 0 0 4px rgba(255,93,93,.18); }
.tl-item .date { font-size: 12px; color: var(--accent); font-weight: 700; }
.tl-item .title { font-weight: 700; margin: 2px 0; }
.tl-item .desc { font-size: 13px; color: var(--muted); }

/* 通用面板 / 列表 */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: var(--panel-soft); border: 1px solid var(--line); color: var(--muted); }
.chip.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv b { font-weight: 700; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th, table.tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--muted); font-weight: 600; background: var(--panel-soft); }
table.tbl tr:hover td { background: var(--panel-soft); }
.pass { color: #2ec27e; font-weight: 700; }
.miss { color: #ff6b6b; font-weight: 700; }

/* 搜索过滤条 / 输入 */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.input, select.input { background: var(--panel-soft); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 9px 12px; font-size: 14px; outline: 0; min-height: 44px; }
.input:focus, select.input:focus { border-color: var(--accent); }
.seg { display: inline-flex; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 8px; font-size: 13px; min-height: 38px; }
.seg button.on { background: var(--accent); color: var(--accent-foreground); font-weight: 700; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-soft); color: var(--text); font-size: 14px; font-weight: 600; min-height: 44px; }
.btn:hover { border-color: var(--line-bright); }
.btn.primary { background: var(--accent); color: var(--accent-foreground); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ff8585; border-color: rgba(255,107,107,.4); }

/* 单词翻转卡 */
.flip-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 6px 0 4px; }
.flip-card { width: 100%; max-width: 520px; height: 220px; perspective: 1200px; cursor: pointer; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.2,.7,.2,1); transform-style: preserve-3d; }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; border-radius: var(--radius); backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 22px; border: 1px solid var(--line-bright); box-shadow: var(--shadow); text-align: center; }
.flip-front { background: linear-gradient(150deg, var(--panel-2), var(--panel)); }
.flip-back { background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 22%, var(--panel)), var(--panel)); transform: rotateY(180deg); }
.flip-face .word { font-size: 30px; font-weight: 800; letter-spacing: .5px; font-family: Georgia, "Songti SC", "Noto Serif SC", serif; }
.flip-face .phon { font-size: 15px; color: var(--muted); }
.flip-face .pos { font-size: 13px; color: var(--accent); font-weight: 700; }
.flip-face .mean { font-size: 18px; font-weight: 700; }
.flip-face .eg { font-size: 13px; color: var(--muted); max-width: 90%; line-height: 1.5; }
.flip-face .hint { position: absolute; bottom: 12px; font-size: 11px; color: var(--muted); opacity: .7; }
.vocab-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.vocab-actions .btn { flex: 1; min-width: 120px; justify-content: center; }
.vocab-actions .hk { display: inline-block; margin-left: 6px; padding: 1px 6px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.12); border-radius: 4px; opacity: .8; }

/* SVG 进度环 */
.ring-stat { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.ring-stat svg { display: block; }
.ring-stat .num { font-size: 13px; font-weight: 700; }
.ring-stat .cap { font-size: 11px; color: var(--muted); }

/* 模考趋势图 */
.mock-chart { width: 100%; overflow-x: auto; }
.mock-chart svg { display: block; width: 100%; min-width: 480px; height: 240px; }
.mock-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: end; }

/* 短语 / 模板 / 日志 */
.phrase { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--panel-soft); border: 1px solid var(--line); border-radius: 12px; }
.phrase .cn { font-weight: 600; }
.phrase .en { color: var(--accent); font-weight: 600; }
.template { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.template .t-title { font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.template .t-body { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.template .copy { margin-top: 8px; }
.log-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.log-row .body { flex: 1; min-width: 0; }
.log-row .t { font-weight: 600; }
.log-row .d { font-size: 12px; color: var(--muted); }
.log-row .score { font-weight: 800; color: var(--accent); }

/* 打卡 */
.checkin-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.streak-num { font-size: 40px; font-weight: 900; color: var(--accent); line-height: 1; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.calendar .day { aspect-ratio: 1; border-radius: 8px; background: var(--panel-soft); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.calendar .day.done { background: var(--accent); color: var(--accent-foreground); border-color: transparent; font-weight: 700; }
.calendar .day.today { border-color: var(--accent); }

/* 任务 */
.todo { display: flex; flex-direction: column; gap: 8px; }
.todo .item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.todo .item.over { border-color: #ff6b6b; }
.todo .item.done { opacity: .55; }
.todo .item .check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--accent); flex: none; display: grid; place-items: center; cursor: pointer; }
.todo .item.done .check { background: var(--accent); color: var(--accent-foreground); }
.todo .item .body { flex: 1; min-width: 0; }
.todo .item .t { font-weight: 600; }
.todo .item .d { font-size: 12px; color: var(--muted); }
.todo .item .del { color: var(--muted); background: none; border: 0; font-size: 18px; }

.alert-today { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: var(--radius); padding: 14px 16px; margin-bottom: var(--gap); }
.alert-today h3 { margin: 0 0 8px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.alert-today .row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; border-top: 1px dashed var(--line); }
.alert-today .row:first-of-type { border-top: 0; }
.alert-today .row .pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255,93,93,.18); color: #ff8585; }
.alert-today .row .pill.ok { background: rgba(46,194,126,.18); color: #5fe0a3; }
.alert-today .row .pill.warn { background: rgba(240,168,38,.2); color: #f4c46a; }

/* 口语跟读 */
.speak-card { text-align: center; }
.speak-en { font-size: clamp(20px, 4.5vw, 30px); font-weight: 800; line-height: 1.4; letter-spacing: .3px; }
.speak-zh { color: var(--muted); margin-top: 8px; font-size: 15px; }
.speak-ctrls { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.mic-btn { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-foreground); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .15s; }
.mic-btn svg { width: 34px; height: 34px; }
.mic-btn:hover { transform: scale(1.06); }
.mic-btn.recording { animation: pulse 1.1s infinite; }
.mic-btn.disabled { filter: grayscale(.6) opacity(.6); cursor: not-allowed; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 70% { box-shadow: 0 0 0 16px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.speak-result { margin-top: 16px; }
.speak-result .transcript { font-size: 14px; color: var(--muted); }
.speak-result .transcript b { color: var(--text); }
.score-badge { display: inline-flex; align-items: baseline; justify-content: center; gap: 2px; font-size: 40px; font-weight: 900; color: var(--accent); margin: 8px 0; }
.score-badge span { font-size: 14px; color: var(--muted); }
.missed { font-size: 14px; color: #ff8585; margin-top: 4px; }
.fb { font-size: 14px; margin-top: 6px; }
.stars { display: flex; gap: 6px; }
.stars button { font-size: 28px; background: none; border: 0; color: var(--line-bright); cursor: pointer; line-height: 1; transition: transform .12s, color .12s; }
.stars button:hover { transform: scale(1.15); color: var(--accent); }
.speak-log { display: flex; flex-direction: column; gap: 10px; }
.speak-log .log-row .score { font-size: 16px; }

/* 设置抽屉 */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: .3s; z-index: 90; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: 360px; max-width: 92vw; background: var(--bg-2); border-left: 1px solid var(--line); z-index: 100; transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.7,.2,1); padding: 20px; overflow-y: auto; box-shadow: var(--shadow); }
.drawer.show { transform: none; }
.drawer h3 { margin: 4px 0 14px; }
.drawer .field { margin-bottom: 16px; }
.drawer .field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--bg-2), 0 0 0 4px var(--line-bright); }
.accent-row { display: flex; gap: 6px; align-items: center; }
.accent-row input[type=range] { flex: 1; accent-color: var(--accent); }
.accent-row input[type=color] { width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; }

/* 移动端底部 Tab */
.mobile-tab { display: none; }
.menu-btn { display: none; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; padding: 12px; gap: 14px; }
  .nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: thin; }
  .nav .nav-group { display: none; }
  .nav button { width: auto; white-space: nowrap; border: 1px solid var(--line); background: var(--panel-soft); }
  .nav button[aria-current="true"] { box-shadow: none; border-color: var(--accent); }
  .cards-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .mobile-tab { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .mobile-tab button { flex: 1; background: none; border: 0; color: var(--muted); font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; }
  .mobile-tab button svg { width: 22px; height: 22px; }
  .mobile-tab button.on { color: var(--accent); }
  body { padding-bottom: 76px; }
  .topbar { padding: 10px 14px; }
  .topbar .search { max-width: none; }
}

@media (max-width: 560px) {
  .cards-row { grid-template-columns: 1fr 1fr; }
  .fluid-card .value { font-size: 28px; }
  .calendar { grid-template-columns: repeat(7, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .fluid-card::before { animation: none; }
  .ring { transition: none; }
  .flip-inner { transition: none; }
  * { scroll-behavior: auto !important; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--panel); border: 1px solid var(--line-bright); color: var(--text); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 200; opacity: 0; transition: .3s; font-size: 14px; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hidden { display: none !important; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }
.foot a { color: var(--muted); text-decoration: underline; }

/* ============================================================
   账号系统
   ============================================================ */

/* 登录遮罩 */
.auth-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1000px 700px at 50% 30%, var(--bg-2), var(--bg));
  padding: 20px;
}
.auth-overlay.hidden { display: none !important; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 32px 28px;
  box-shadow: var(--shadow); text-align: center;
  animation: authIn .4s cubic-bezier(.2,.7,.2,1);
}
@keyframes authIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.auth-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.auth-logo .logo {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-400), var(--accent-700));
  color: var(--accent-foreground);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), .45);
}
.auth-logo .logo svg { width: 32px; height: 32px; }
.auth-card h2 { margin: 0 0 6px; font-size: 22px; font-family: Georgia, "Songti SC", "Noto Serif SC", serif; }
.auth-sub { margin: 0 0 20px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.auth-tabs {
  display: flex; background: var(--panel-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px; margin-bottom: 16px;
}
.auth-tabs button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  padding: 9px; border-radius: 8px; font-size: 14px; font-weight: 600;
  transition: .2s;
}
.auth-tabs button.on { background: var(--accent); color: var(--accent-foreground); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form .input { width: 100%; }
.auth-form .btn { width: 100%; justify-content: center; margin-top: 4px; }
.auth-error { color: #ff8585; font-size: 13px; min-height: 20px; margin-top: 8px; }
.auth-guest {
  background: none; border: 0; color: var(--muted); font-size: 13px;
  margin-top: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.auth-guest:hover { color: var(--accent); }
.auth-note { margin: 16px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; opacity: .8; }

/* 顶栏用户按钮 */
.user-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-soft);
  display: grid; place-items: center; padding: 0; cursor: pointer;
  transition: .2s;
}
.user-btn:hover { border-color: var(--accent); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-400), var(--accent-700));
  color: var(--accent-foreground);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 800; text-transform: uppercase;
  user-select: none;
}
.user-btn .user-avatar { width: 34px; height: 34px; font-size: 15px; }

/* 用户下拉菜单 */
.user-menu {
  position: fixed; top: 62px; right: 20px; z-index: 150;
  width: 240px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; opacity: 0; transform: translateY(-8px) scale(.97);
  pointer-events: none; transition: .2s cubic-bezier(.2,.7,.2,1);
}
.user-menu.show { opacity: 1; transform: none; pointer-events: auto; }
.user-menu-header { display: flex; align-items: center; gap: 12px; padding: 6px 8px 10px; }
.user-menu-header .user-avatar { width: 42px; height: 42px; font-size: 17px; flex: none; }
.um-name { font-weight: 700; font-size: 15px; }
.um-role { font-size: 12px; color: var(--muted); margin-top: 2px; }
.um-divider { height: 1px; background: var(--line); margin: 4px 0; }
.um-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; color: var(--text);
  padding: 10px 12px; border-radius: 10px; font-size: 14px;
  text-align: left; cursor: pointer; transition: .15s;
}
.um-item:hover { background: var(--panel-soft); }
.um-item.danger { color: #ff8585; }

/* 抽屉内账号区 */
.acc-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.acc-section h4 { margin: 0 0 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.acc-info { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 10px 12px; background: var(--panel-soft); border-radius: 10px; }
.acc-info .user-avatar { width: 38px; height: 38px; font-size: 15px; flex: none; }
.acc-info .name { font-weight: 700; font-size: 14px; }
.acc-info .meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.acc-btns { display: flex; flex-direction: column; gap: 8px; }
.acc-btns .btn { width: 100%; justify-content: center; }
.pwd-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 12px; background: var(--panel-soft); border-radius: 10px; }
.pwd-form .input { width: 100%; min-height: 40px; font-size: 13px; }
.pwd-form .btn { width: 100%; justify-content: center; min-height: 40px; font-size: 13px; }
