/* =====================================================================
   外观主题：主题色（data-accent）× 明暗（data-scheme）；纯黑（data-tone）；彩色侧栏（data-chrome）
   ===================================================================== */
:root[data-scheme="light"][data-accent="blue"] { --primary: #1f5fbf; --primary-600: #174ea0; --primary-50: #e8f0fb; --fill: #1f5fbf; --fill-hover: #174ea0; --g1: #3b7be0; --g2: #1a4fa3; --glow: rgba(31,95,191,.28); --hm1: #c9dbf5; --hm2: #93b8ea; --hm3: #4f86d6; --hm4: #1a4fa3; }
:root[data-scheme="dark"][data-accent="blue"] { --primary: #79a7ff; --primary-600: #9bbcff; --primary-50: rgba(121,167,255,.13); --fill: #2b6cd4; --fill-hover: #3f7fe6; --g1: #3f7fe6; --g2: #2257b5; --glow: rgba(43,108,212,.35); --hm1: #173356; --hm2: #1f5395; --hm3: #3f7fe6; --hm4: #9bbcff; }
:root[data-scheme="light"][data-accent="green"] { --primary: #127a45; --primary-600: #0d6237; --primary-50: #e6f4ec; --fill: #127a45; --fill-hover: #0d6237; --g1: #1e9a5a; --g2: #0d6237; --glow: rgba(18,122,69,.26); --hm1: #c8e8d5; --hm2: #8fd0aa; --hm3: #3fa86f; --hm4: #0d6237; }
:root[data-scheme="dark"][data-accent="green"] { --primary: #5fd394; --primary-600: #86e0ae; --primary-50: rgba(95,211,148,.13); --fill: #1d8a50; --fill-hover: #23a05e; --g1: #23a05e; --g2: #157042; --glow: rgba(29,138,80,.35); --hm1: #133826; --hm2: #1a5e3b; --hm3: #2b9a5d; --hm4: #86e0ae; }
:root[data-scheme="light"][data-accent="coral"] { --primary: #c4441f; --primary-600: #a33616; --primary-50: #fcece6; --fill: #c4441f; --fill-hover: #a33616; --g1: #e0603a; --g2: #a33616; --glow: rgba(196,68,31,.26); --hm1: #f6d3c6; --hm2: #eda58b; --hm3: #da6d48; --hm4: #a33616; }
:root[data-scheme="dark"][data-accent="coral"] { --primary: #ff8e6b; --primary-600: #ffab91; --primary-50: rgba(255,142,107,.13); --fill: #d4552e; --fill-hover: #e5683f; --g1: #e5683f; --g2: #b04222; --glow: rgba(212,85,46,.35); --hm1: #3d2219; --hm2: #6e3420; --hm3: #c4552f; --hm4: #ffab91; }
:root[data-scheme="light"][data-accent="purple"] { --primary: #7a2fb0; --primary-600: #64238f; --primary-50: #f3eafa; --fill: #7a2fb0; --fill-hover: #64238f; --g1: #9349c9; --g2: #64238f; --glow: rgba(122,47,176,.26); --hm1: #e6d3f3; --hm2: #c7a1e4; --hm3: #9f5fcf; --hm4: #64238f; }
:root[data-scheme="dark"][data-accent="purple"] { --primary: #c792f0; --primary-600: #d8b0f5; --primary-50: rgba(199,146,240,.13); --fill: #8a3fc4; --fill-hover: #9b52d4; --g1: #9b52d4; --g2: #6f2ea3; --glow: rgba(138,63,196,.35); --hm1: #2e1d3d; --hm2: #4d2a6c; --hm3: #8a3fc4; --hm4: #d8b0f5; }
:root[data-scheme="light"][data-accent="graphite"] { --primary: #2f3542; --primary-600: #1f242d; --primary-50: #eceef2; --fill: #2f3542; --fill-hover: #1f242d; --g1: #4a5263; --g2: #1f242d; --glow: rgba(30,35,45,.22); --hm1: #dfe2e8; --hm2: #b4bac6; --hm3: #7a8295; --hm4: #2f3542; }
:root[data-scheme="dark"][data-accent="graphite"] { --primary: #d5d9e0; --primary-600: #eef0f3; --primary-50: rgba(213,217,224,.12); --fill: #4a5263; --fill-hover: #5a6377; --g1: #5a6377; --g2: #353b48; --glow: rgba(0,0,0,.4); --hm1: #22262d; --hm2: #3a404b; --hm3: #6b7385; --hm4: #c8cdd6; }
/* 纯黑（OLED 友好） */
:root[data-tone="black"] { --bg: #000; --surface: #0b0b0c; --surface-2: #161618; --border: #26272b; --hm0: #161618; }

/* 彩色侧栏：用主题色填充电脑端导航 */
:root[data-chrome="color"] .shell .sidebar { background: linear-gradient(175deg, var(--g1), var(--g2)); border-right-color: transparent; }
:root[data-chrome="color"] .shell .sidebar .brand { color: #fff; }
:root[data-chrome="color"] .shell .sidebar .nav-link { color: rgba(255,255,255,.78); }
:root[data-chrome="color"] .shell .sidebar .nav-link:hover { background: rgba(255,255,255,.12); color: #fff; }
:root[data-chrome="color"] .shell .sidebar .nav-link.active { background: rgba(255,255,255,.2); color: #fff; }
:root[data-chrome="color"] .shell .sidebar .user-chip { background: rgba(255,255,255,.14); color: #fff; }
:root[data-chrome="color"] .shell .sidebar .icon-btn { color: rgba(255,255,255,.8); }
:root[data-chrome="color"] .shell .sidebar .icon-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
:root[data-chrome="color"] .shell .sidebar .avatar { background: rgba(255,255,255,.25); }
:root[data-chrome="color"] .shell .sidebar .btn-ghost { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
:root[data-chrome="color"] .shell .sidebar .logo-img { background: rgba(255,255,255,.16); --logo-ink: var(--g1); }
/* 浅色下压低饱和度、稍微加深（同色相），不抢内容区，也不发灰；不支持相对颜色的浏览器回退到原渐变 */
:root[data-scheme="light"][data-chrome="color"] .shell .sidebar, :root[data-scheme="light"][data-chrome="color"] .tp-side { background: linear-gradient(175deg, oklch(from var(--g1) calc(l * 0.86) calc(c * 0.78) h), oklch(from var(--g2) calc(l * 0.9) calc(c * 0.78) h)); }
/* 深色/纯黑下改为低饱和的主题色暗底，避免和深色页面对比过强 */
:root[data-scheme="dark"][data-chrome="color"] .shell .sidebar { background: linear-gradient(175deg, color-mix(in srgb, var(--g2) 30%, var(--surface)), color-mix(in srgb, var(--g2) 12%, var(--surface))); border-right-color: var(--border); }
:root[data-scheme="dark"][data-chrome="color"] .shell .sidebar .nav-link { color: rgba(255,255,255,.7); }
:root[data-scheme="dark"][data-chrome="color"] .shell .sidebar .nav-link:hover { background: rgba(255,255,255,.07); }
:root[data-scheme="dark"][data-chrome="color"] .shell .sidebar .nav-link.active { background: color-mix(in srgb, var(--g1) 32%, transparent); }
:root[data-scheme="dark"][data-chrome="color"] .shell .sidebar .user-chip { background: rgba(255,255,255,.07); }

/* 右上角悬浮的日夜切换：只在没有侧边栏的页面（落地页、登录页）显示；听写全屏页隐藏，避免挡住顶栏 */
body.has-shell .theme-toggle, body.fullscreen .theme-toggle { display: none; }
.user-chip .side-theme { margin-left: auto; }
.user-chip .side-theme + .icon-btn { margin-left: 0; }

/* 设置：主题色色板与预览 */
.swatches { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; font-size: 13px; color: var(--muted); cursor: pointer; }
.swatch-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .15s, box-shadow .15s; }
.swatch:hover .swatch-dot { transform: scale(1.06); }
.swatch.active { color: var(--text); font-weight: 600; }
.swatch.active .swatch-dot { color: #fff; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--fill); }
.theme-preview { display: flex; height: 92px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.tp-side { width: 26%; padding: 12px 10px; display: flex; flex-direction: column; gap: 7px; background: var(--surface); border-right: 1px solid var(--border); }
:root[data-chrome="color"] .tp-side { background: linear-gradient(175deg, var(--g1), var(--g2)); border-right-color: transparent; }
.tp-side i { height: 8px; border-radius: 4px; background: var(--surface-2); }
.tp-side i.on { background: var(--primary-50); box-shadow: inset 3px 0 0 var(--fill); }
:root[data-chrome="color"] .tp-side i { background: rgba(255,255,255,.2); } :root[data-chrome="color"] .tp-side i.on { background: rgba(255,255,255,.45); box-shadow: none; }
:root[data-scheme="dark"][data-chrome="color"] .tp-side { background: linear-gradient(175deg, color-mix(in srgb, var(--g2) 30%, var(--surface)), color-mix(in srgb, var(--g2) 12%, var(--surface))); border-right-color: var(--border); }
:root[data-scheme="dark"][data-chrome="color"] .tp-side i { background: rgba(255,255,255,.1); } :root[data-scheme="dark"][data-chrome="color"] .tp-side i.on { background: color-mix(in srgb, var(--g1) 45%, transparent); }
.tp-main { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.tp-card { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px; display: flex; flex-direction: column; gap: 6px; }
.tp-card b { height: 8px; width: 50%; border-radius: 4px; background: var(--text); opacity: .7; } .tp-card span { height: 6px; width: 75%; border-radius: 3px; background: var(--muted); opacity: .4; }
.tp-btn { height: 16px; width: 70px; border-radius: 6px; background: var(--fill); align-self: flex-end; }
.input.time-input { width: 132px; flex: none; }
@media (max-width: 560px) { .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 首页火苗：总是显示，今天还没学时是灰色，点击打开排行榜 */
button.streak { border: 0; cursor: pointer; font: inherit; transition: transform .15s, box-shadow .15s; }
button.streak:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(217,119,6,.18); }
button.streak .icon:last-child { opacity: .6; }
.streak.dim { background: var(--surface-2); color: var(--muted); }
