/* style.css — 自我提升 App · iOS 天气风格（深色毛玻璃） */
:root {
  color-scheme: dark;
  --primary: #5ac8fa;
  --primary-2: #0a84ff;
  --bg-top: #0a1428;
  --bg-mid: #12213f;
  --bg-bottom: #1b3058;
  --glass: rgba(255, 255, 255, .08);
  --glass-strong: rgba(255, 255, 255, .12);
  --line: rgba(255, 255, 255, .12);
  --text: #f2f5ff;
  --muted: rgba(255, 255, 255, .58);
  --ok: #32d74b;
  --warn: #ffd60a;
  --danger: #ff453a;
  --radius: 22px;
  --grad-main: linear-gradient(135deg, #0a84ff, #5ac8fa);
  --grad-soft: linear-gradient(135deg, rgba(10,132,255,.55), rgba(94,92,230,.5));
  --header-bg: linear-gradient(180deg, rgba(10,20,40,.85) 0%, rgba(10,20,40,.2) 100%);
  --tab-bg: rgba(12, 22, 44, .82);
  --input-bg: rgba(255,255,255,.1);
  --card-shadow: 0 8px 28px rgba(0, 0, 0, .25);
  --sheet-bg: linear-gradient(180deg, rgba(20,34,64,.92), rgba(14,24,46,.96));
  --overlay-bg: rgba(4, 10, 22, .7);
  --ring-color: #5ac8fa;
  --hero-glow: rgba(90,200,250,.25);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
}
#app { display: flex; flex-direction: column; min-height: 100vh; padding-bottom: 72px; }

/* 头部：融入背景 */
#app-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px 12px;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 1px;
}
#btn-settings {
  background: var(--glass); border: 1px solid var(--line); color: #fff;
  width: 38px; height: 38px; border-radius: 12px; font-size: 18px; cursor: pointer;
}

/* 主区域 */
#app-main { padding: 8px 14px 20px; flex: 1; }
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px;
  margin-bottom: 14px;
  box-shadow: var(--card-shadow);
}
.card h2 { margin: 0 0 8px; font-size: 21px; color: #fff; font-weight: 700; }
.card h3 { margin: 0 0 12px; font-size: 16px; color: #fff; font-weight: 600; }
.muted { color: var(--muted); font-size: 13px; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.tag { font-size: 12px; background: rgba(255,214,10,.16); color: var(--warn); padding: 1px 8px; border-radius: 10px; }

/* 底部 Tab：深色毛玻璃 */
#app-tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 520px; margin: 0 auto;
  display: flex; gap: 4px;
  background: var(--tab-bg);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-top: 1px solid var(--line);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  z-index: 20;
}
#app-tabs button {
  flex: 1; padding: 10px 0; border: 0; background: none;
  font-size: 14px; color: var(--muted); cursor: pointer;
  border-radius: 14px;
  transition: all .25s ease;
  font-weight: 500;
}
#app-tabs button.active {
  background: var(--grad-main);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(10,132,255,.4);
}

/* 按钮 */
button {
  font: inherit; border-radius: 14px; padding: 10px 16px;
  border: 1px solid var(--line); background: var(--glass); color: var(--text);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
}
button:active { transform: scale(.95); }
button.primary {
  background: var(--grad-main);
  border: 0; color: #fff; font-weight: 600;
  box-shadow: 0 5px 16px rgba(10,132,255,.35);
}
button.ghost { background: none; color: var(--primary); border-color: transparent; }
button.danger { background: none; color: var(--danger); border-color: rgba(255,69,58,.4); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.sel { background: var(--grad-main); border-color: transparent; color: #fff; }

/* 表单 */
.form label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.form input, .form select, .form textarea {
  width: 100%; margin-top: 5px; padding: 11px;
  border: 1px solid var(--line); border-radius: 14px; font: inherit;
  background: var(--input-bg); color: var(--text);
}
.form input::placeholder, .form textarea::placeholder { color: rgba(255,255,255,.4); }
.form input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); }
.hint { display: block; font-size: 12px; color: var(--muted); }
.ref { margin: 10px 0; font-size: 13px; color: var(--muted); }
.ref-table { background: rgba(255,255,255,.07); border-radius: 14px; padding: 8px 12px; }
.calc-preview {
  background: linear-gradient(135deg, rgba(10,132,255,.22), rgba(90,200,250,.16));
  border: 1px solid rgba(90,200,250,.3);
  border-radius: 16px; padding: 12px 14px; margin: 10px 0; font-size: 14px;
}
.calc-preview b { color: var(--primary); }
.form-row { display: flex; gap: 6px; align-items: center; margin: 10px 0; }
.form-row input, .form-row select {
  padding: 9px; border: 1px solid var(--line); border-radius: 12px; font: inherit;
  background: var(--input-bg); color: var(--text);
}

/* 门禁 */
.lock-wrap { text-align: center; }
.lock-head h1 { font-size: 24px; margin: 6px 0; color: #fff; }
.timer-card {
  background: var(--grad-soft);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff; border-radius: var(--radius); padding: 24px; margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(10,132,255,.3);
}
.timer-label { font-size: 13px; opacity: .85; }
.timer-value { font-size: 52px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.timer-min { font-size: 12px; opacity: .8; margin-top: 4px; }
.study-list { text-align: left; }
.section-title { font-weight: 700; margin: 12px 0 10px; color: #fff; }
.study-item {
  background: rgba(255,255,255,.07); border-radius: 16px; padding: 12px 14px; margin-bottom: 9px;
  border: 1px solid var(--line);
}
.study-item summary { cursor: pointer; font-size: 15px; color: #fff; }
.study-ans { margin-top: 10px; padding: 10px 12px; background: rgba(90,200,250,.12); border-radius: 12px; font-size: 14px; border: 1px solid rgba(90,200,250,.25); }
.study-content { margin: 8px 0; color: #dfe6f5; font-size: 14px; }
.steps { margin: 6px 0; color: rgba(255,255,255,.75); }
.lock-actions { display: flex; gap: 10px; margin-top: 14px; }
.lock-actions button { flex: 1; }

/* 考试 */
.exam-wrap { text-align: left; }
.exam-q { background: rgba(255,255,255,.07); border-radius: 16px; padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); }
.exam-q-title { font-size: 15px; margin-bottom: 10px; color: #fff; }
.choice { display: inline-block; margin: 4px 6px 4px 0; }
.fill { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: var(--input-bg); color: var(--text); }
.wrong-tip { color: var(--danger); font-size: 13px; margin-top: 6px; }
.success-banner { background: rgba(50,215,75,.18); color: var(--ok); padding: 13px; border-radius: 14px; font-weight: 700; margin-top: 12px; border: 1px solid rgba(50,215,75,.3); }

/* 今日页 */
.bar { height: 8px; background: rgba(255,255,255,.14); border-radius: 5px; overflow: hidden; margin: 8px 0; }
.bar-fill { height: 100%; background: var(--grad-main); border-radius: 5px; }
.bar-fill.grow { transition: width .9s cubic-bezier(.4,0,.2,1); }

/* 健康页：能量行 */
.energy-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0; }
.energy-cell { display: flex; flex-direction: column; align-items: center; background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; min-width: 74px; }
.energy-cell.primary { background: linear-gradient(135deg, rgba(10,132,255,.4), rgba(90,200,250,.3)); border-color: rgba(90,200,250,.4); }
.energy-num { font-size: 24px; font-weight: 300; color: #fff; font-variant-numeric: tabular-nums; }
.energy-lab { font-size: 11px; color: var(--muted); margin-top: 2px; }
.energy-plus { font-size: 18px; color: rgba(255,255,255,.5); }

/* 健康页：周模板 */
.tmpl-row { display: flex; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; }
.tmpl-row:last-child { border-bottom: 0; }
.tmpl-row.today { background: rgba(90,200,250,.14); border-radius: 12px; padding: 8px 10px; }
.tmpl-day { width: 40px; color: var(--muted); }
.ex-item { background: rgba(255,255,255,.06); border-radius: 14px; padding: 9px 12px; margin: 8px 0; border: 1px solid var(--line); }
.ex-item summary { cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; color: #fff; }
.variant-tabs { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.variant-tabs .vt { font-size: 12px; padding: 5px 12px; border-radius: 18px; }
.variant-body { font-size: 13px; color: #d5dcec; }

/* 饮食 */
#food-preview img { width: 100%; border-radius: 16px; margin-top: 8px; }
.food-items { margin: 8px 0; }
.food-item { padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,.15); font-size: 14px; }
.total { font-size: 16px; margin: 8px 0; color: #fff; }
.food-log-head { font-weight: 600; margin: 12px 0 4px; color: #fff; }

/* 生日 */
.due-item { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; }
.due-item:last-child { border-bottom: 0; }
.due-item.today-bd { background: rgba(255,214,10,.14); border-radius: 12px; border: 1px solid rgba(255,214,10,.25); }
.tl-person { margin: 8px 0; font-size: 13px; }
.tl-dates { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tl-dates span { background: rgba(255,255,255,.1); border-radius: 8px; padding: 2px 8px; font-size: 12px; }
.bd-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.bd-row .del { font-size: 12px; padding: 4px 10px; }
#bd-import { width: 100%; margin: 6px 0; padding: 11px; border: 1px solid var(--line); border-radius: 14px; font: inherit; background: var(--input-bg); color: var(--text); }

/* 设置遮罩 */
#overlay {
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
}
#overlay[hidden] { display: none; }
.sheet {
  background: var(--sheet-bg);
  -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
  border: 1px solid var(--line);
  width: 100%; max-width: 520px;
  border-radius: 26px 26px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
}
.sheet h3 { margin: 0 0 12px; color: #fff; }
.sheet button { margin: 8px 6px 0 0; }
.sheet details summary { cursor: pointer; color: var(--primary); font-weight: 600; margin: 8px 0; }
.row { display: flex; justify-content: space-between; align-items: center; }

/* 超人进度 */
.hero-card { text-align: center; overflow: hidden; position: relative; }
.hero-card::before {
  content: ''; position: absolute; inset: -40% -20% auto; height: 80%;
  background: radial-gradient(circle, var(--hero-glow) 0%, transparent 70%);
  animation: heroGlow 3s ease-in-out infinite;
}
@keyframes heroGlow { 0%,100% { opacity:.5; } 50% { opacity:1; } }
.hero-wrap { position: relative; width: 158px; height: 158px; margin: 6px auto; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: rgba(255,255,255,.16); }
.ring-fg {
  stroke: var(--ring-color);
  stroke-linecap: round;
  transition: stroke-dashoffset .9s cubic-bezier(.4,0,.2,1);
  filter: drop-shadow(0 2px 6px rgba(90,200,250,.55));
}
.hero-card.max .ring-fg { stroke: #32d74b; animation: ringPulse 1s ease-in-out infinite; }
@keyframes ringPulse { 0%,100% { filter: drop-shadow(0 0 3px rgba(50,215,75,.5)); } 50% { filter: drop-shadow(0 0 14px rgba(50,215,75,.95)); } }
.hero-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hero-emoji { font-size: 44px; animation: heroBounce 1.6s ease-in-out infinite; }
.hero-card.max .hero-emoji { animation: heroSpin 2.4s ease-in-out infinite; }
@keyframes heroBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes heroSpin { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.15) rotate(8deg); } }
.hero-pct { font-size: 26px; font-weight: 300; color: #fff; font-variant-numeric: tabular-nums; }
.hero-text { font-weight: 600; margin: 4px 0 0; color: #dfe6f5; }
.hero-card.max .hero-text { color: var(--ok); }

/* 撒花动画 */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 999; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -20px;
  border-radius: 3px;
  animation-name: confettiFall;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}
@keyframes confettiFall {
  0% { transform: translateY(-5vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: .6; }
}

/* 打卡/勾选动画 */
.btn-done-pop { animation: popDone .5s cubic-bezier(.36,1.6,.5,1); }
@keyframes popDone {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.checkmark svg { width: 22px; height: 22px; vertical-align: -4px; margin-right: 4px; }
.checkmark path { stroke: #32d74b; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: drawCheck .5s ease forwards; }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

/* 闹钟页 */
.chip { display: inline-flex; align-items: center; gap: 3px; background: rgba(255,255,255,.09); border: 1px solid var(--line); border-radius: 18px; padding: 4px 11px; margin: 3px 3px 3px 0; font-size: 13px; cursor: pointer; }
.chip input { accent-color: var(--primary); }
.al-days { margin: 8px 0; }
.al-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; border-bottom: 1px solid rgba(255,255,255,.08); }
.al-row:last-child { border-bottom: 0; }
.al-info { display: flex; flex-direction: column; gap: 2px; }
.al-time { font-size: 22px; color: var(--primary); font-weight: 300; font-variant-numeric: tabular-nums; }
.al-ops { display: flex; align-items: center; gap: 10px; }
.switch { position: relative; display: inline-block; width: 48px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch::before {
  content: ''; position: absolute; inset: 0; border-radius: 28px;
  background: rgba(255,255,255,.22); transition: background .25s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform .25s;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.switch:has(input:checked)::before { background: var(--grad-main); }
.switch:has(input:checked)::after { transform: translateX(20px); }

/* 响铃全屏 */
.alarm-ring { text-align: center; padding: 34px 20px; width: 100%; max-width: 480px; margin: 0 auto; }
.ring-bell { font-size: 80px; animation: bellShake .6s ease-in-out infinite; }
@keyframes bellShake {
  0%,100% { transform: rotate(0); }
  20% { transform: rotate(18deg); }
  40% { transform: rotate(-18deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-10deg); }
}
.alarm-ring h2 { font-size: 28px; margin: 10px 0 2px; color: #fff; }
.ring-time { font-size: 19px; font-weight: 300; color: #5ac8fa; margin: 4px 0 14px; }
.alarm-ring .big { font-size: 18px; padding: 15px 24px; margin: 12px 0; width: 82%; max-width: 340px; }
#alarm-status .ok { font-size: 16px; font-weight: 700; }
#alarm-status .warn { font-size: 14px; }

/* 学习内容多媒体 */
.media-box { margin: 10px 0; border-radius: 16px; overflow: hidden; background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.media-box img { width: 100%; display: block; }
.media-box video { width: 100%; display: block; }
.media-box iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.media-caption { font-size: 12px; color: var(--muted); padding: 6px 10px; }
.study-item.has-media summary { display: flex; align-items: center; gap: 8px; }
.study-item .media-thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
/* ============ 主题：清爽浅色 ============ */
[data-theme="light"] {
  color-scheme: light;
  --primary: #0a84ff;
  --primary-2: #0060df;
  --bg-top: #e8f0fb;
  --bg-mid: #f4f7fc;
  --bg-bottom: #ffffff;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .92);
  --line: rgba(31, 42, 80, .1);
  --text: #1f2430;
  --muted: rgba(31, 42, 80, .55);
  --ok: #188038;
  --warn: #b06000;
  --danger: #d93025;
  --grad-main: linear-gradient(135deg, #0060df, #38b6ff);
  --grad-soft: linear-gradient(135deg, rgba(0,96,223,.25), rgba(56,182,255,.2));
  --header-bg: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.55) 100%);
  --tab-bg: rgba(255, 255, 255, .88);
  --input-bg: rgba(31, 42, 80, .06);
  --card-shadow: 0 8px 24px rgba(31, 42, 80, .1);
  --sheet-bg: linear-gradient(180deg, rgba(255,255,255,.96), rgba(240,245,255,.97));
  --overlay-bg: rgba(31, 42, 80, .35);
  --ring-color: #0a84ff;
  --hero-glow: rgba(10,132,255,.2);
}
[data-theme="light"] #app-header { color: #1f2430; }
[data-theme="light"] .brand { color: #1f2430; }
[data-theme="light"] #btn-settings { color: #1f2430; }
[data-theme="light"] .timer-card { color: #fff; }
[data-theme="light"] .media-box { background: rgba(0,0,0,.06); }
[data-theme="light"] .study-item, [data-theme="light"] .exam-q, [data-theme="light"] .ex-item { background: rgba(31,42,80,.05); }
[data-theme="light"] .form input::placeholder, [data-theme="light"] .form textarea::placeholder { color: rgba(31,42,80,.35); }
[data-theme="light"] .media-caption { color: rgba(31,42,80,.5); }

/* ============ 主题：活力渐变 ============ */
[data-theme="vivid"] {
  color-scheme: dark;
  --primary: #ff6b9d;
  --primary-2: #7c4dff;
  --bg-top: #1a1038;
  --bg-mid: #301858;
  --bg-bottom: #4a2068;
  --glass: rgba(255, 255, 255, .12);
  --glass-strong: rgba(255, 255, 255, .18);
  --line: rgba(255, 255, 255, .16);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, .65);
  --ok: #4cd97b;
  --warn: #ffd60a;
  --danger: #ff453a;
  --grad-main: linear-gradient(135deg, #7c4dff, #ff6b9d);
  --grad-soft: linear-gradient(135deg, rgba(124,77,255,.5), rgba(255,107,157,.45));
  --header-bg: linear-gradient(180deg, rgba(26,16,56,.88) 0%, rgba(26,16,56,.25) 100%);
  --tab-bg: rgba(20, 12, 44, .85);
  --input-bg: rgba(255,255,255,.14);
  --card-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --sheet-bg: linear-gradient(180deg, rgba(48,24,88,.94), rgba(26,16,56,.96));
  --overlay-bg: rgba(10, 6, 24, .7);
  --ring-color: #ff6b9d;
  --hero-glow: rgba(255,107,157,.3);
}
[data-theme="vivid"] .timer-card { color: #fff; }

/* ============ 项目选择页 ============ */
.back-btn {
  background: none; border: 0; color: #fff; font-size: 28px;
  width: 38px; height: 38px; padding: 0; line-height: 1; cursor: pointer;
}
[data-theme="light"] .back-btn { color: #1f2430; }
.projects-head { text-align: center; margin: 18px 0 6px; }
.projects-head h2 { font-size: 26px; margin: 0 0 6px; color: #fff; }
[data-theme="light"] .projects-head h2 { color: #1f2430; }
.project-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 20px 18px; margin-bottom: 14px; border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  transition: transform .15s ease;
}
.project-card:active { transform: scale(.98); }
.project-card .project-emoji { font-size: 36px; flex-shrink: 0; }
.project-card .project-info { flex: 1; min-width: 0; }
.project-card .project-info b { font-size: 17px; }
.project-card .project-info p { margin: 2px 0 0; }
.project-card .project-arrow { font-size: 28px; color: var(--muted); flex-shrink: 0; }
.project-card.p2 { border-color: color-mix(in srgb, var(--ring-color) 45%, transparent); }
.placeholder { text-align: center; padding: 48px 20px; }
.placeholder h2 { font-size: 26px; }

/* ============ 首页重新设计 ============ */
.hero-today {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(135deg, rgba(10,132,255,.28), rgba(90,200,250,.16)), var(--glass);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border: 1px solid rgba(90,200,250,.35);
  border-radius: 26px;
  padding: 22px 20px; margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(10,132,255,.18);
  position: relative; overflow: hidden;
}
.hero-today::before {
  content: ''; position: absolute; right: -30px; top: -40px; width: 130px; height: 130px;
  background: radial-gradient(circle, rgba(255,255,255,.16) 0%, transparent 70%);
  pointer-events: none;
}
.ht-date-block { display: flex; flex-direction: column; align-items: flex-start; }
.ht-date { font-size: 62px; font-weight: 200; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.ht-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ht-info { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ht-gate {
  font-size: 13px; font-weight: 700; padding: 5px 14px; border-radius: 20px;
  border: 1px solid var(--line);
}
.ht-gate.open { background: rgba(50,215,75,.16); color: var(--ok); border-color: rgba(50,215,75,.35); }
.ht-gate.locked { background: rgba(255,214,10,.14); color: var(--warn); border-color: rgba(255,214,10,.3); }
.ht-greet { font-size: 13px; color: var(--muted); text-align: right; }
.ht-btn { margin-top: 2px; }

/* 代谢构成（首页/健康页） */
.energy-mini {
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px; margin: 4px 0 10px;
  font-size: 13px; color: #dfe6f5; text-align: center; line-height: 1.8;
}
.energy-mini b { color: var(--primary); }

/* 今日训练卡片（状态机） */
.workout-card .wk-body { display: flex; flex-direction: column; gap: 8px; }
.workout-card .wk-body .form-row { display: flex; gap: 10px; }
.workout-card .wk-body .form-row label { flex: 1; margin: 0; font-size: 13px; color: var(--muted); }
.workout-card .wk-body .form-row input {
  width: 100%; margin-top: 4px; padding: 10px; border: 1px solid var(--line);
  border-radius: 12px; font: inherit; background: var(--input-bg); color: var(--text);
}
.wk-rec {
  background: rgba(90,200,250,.1); border: 1px solid rgba(90,200,250,.2);
  border-radius: 10px; padding: 6px 10px; font-size: 14px; color: #dfe6f5;
}
.workout-card .wk-body button { width: 100%; }

/* 考试重试区（答案在按钮之前，确保先看到答案） */
.retry-wrap {
  margin-top: 16px; padding: 14px; border-radius: 16px;
  background: rgba(255,69,58,.1); border: 1px solid rgba(255,69,58,.35);
  text-align: center;
}
.retry-tip { color: var(--danger); font-size: 14px; font-weight: 600; margin: 0 0 10px; }
button.big { padding: 13px 22px; font-size: 16px; }

/* 教学视频链接 */
.video-link {
  display: inline-block; margin: 6px 0; padding: 6px 12px; font-size: 13px;
  background: rgba(255,255,255,.08); border: 1px solid var(--line); border-radius: 12px;
  color: var(--primary); text-decoration: none;
}
.video-link:active { transform: scale(.97); }

/* Tab 图标 */
.tab-ico { display: block; font-size: 18px; line-height: 1.2; }
#app-tabs button { padding: 8px 0; }
#app-tabs button span { display: block; }

/* ============ 整体界面打磨 ============ */
.card { transition: transform .2s ease, box-shadow .2s ease; }
.card:active { transform: scale(.992); }
#app-header { letter-spacing: .5px; }
button { -webkit-user-select: none; user-select: none; }
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.ex-item summary { font-size: 15px; }
.study-item summary { font-size: 16px; }
.energy-row { gap: 6px; }
.energy-cell { padding: 8px 6px; min-width: 56px; }
.energy-num { font-size: 19px; }
.energy-plus { font-size: 15px; }
[data-theme="light"] .ht-date { color: #1f2430; }
[data-theme="light"] .hero-today { background: linear-gradient(135deg, rgba(0,96,223,.14), rgba(56,182,255,.1)), var(--glass); }
[data-theme="light"] .energy-mini { background: rgba(31,42,80,.05); color: #4a5470; }
[data-theme="light"] .energy-mini b { color: #0a84ff; }
[data-theme="light"] .wk-rec { background: rgba(10,132,255,.08); border-color: rgba(10,132,255,.25); color: #1f2430; }

/* ============ 首页与整体视觉升级（frontend-design） ============ */
.brand {
  font-size: 18px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(90deg, #ffffff, #5ac8fa);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
[data-theme="light"] .brand {
  background: linear-gradient(90deg, #1f2430, #0a84ff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 卡片入场（错落） */
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
#app-main .card, #app-main .hero-today { animation: cardIn .5s cubic-bezier(.2,.7,.2,1) both; }
#app-main .card:nth-child(2) { animation-delay: .06s; }
#app-main .card:nth-child(3) { animation-delay: .12s; }
#app-main .card:nth-child(4) { animation-delay: .18s; }
#app-main .card:nth-child(5) { animation-delay: .24s; }

/* Tab 精修 */
#app-tabs button { position: relative; }
#app-tabs button.active {
  box-shadow: 0 6px 18px rgba(10,132,255,.45), inset 0 1px 0 rgba(255,255,255,.25);
}
.tab-ico { transition: transform .25s ease; }
#app-tabs button.active .tab-ico { transform: translateY(-1px) scale(1.12); }

/* 数字字体统一 */
.ht-date, .energy-num, .timer-value, .hero-pct, .al-time { font-variant-numeric: tabular-nums; }

/* hero-today 呼吸光晕 */
.hero-today::after {
  content: ''; position: absolute; left: -40px; bottom: -60px; width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(90,200,250,.18) 0%, transparent 70%);
  pointer-events: none; animation: heroBreath 4s ease-in-out infinite;
}
@keyframes heroBreath { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.ht-date { text-shadow: 0 4px 22px rgba(10,132,255,.45); }

/* 超人环发光 */
.hero-card .ring-fg { filter: drop-shadow(0 0 8px rgba(90,200,250,.65)); }

/* primary 按钮微光 */
button.primary { box-shadow: 0 6px 18px rgba(10,132,255,.4), inset 0 1px 0 rgba(255,255,255,.18); }

/* 尊重系统减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============ 项目选择页精修 ============ */
.project-card { position: relative; overflow: hidden; }
.project-card.p2 {
  background: linear-gradient(135deg, rgba(10,132,255,.22), rgba(90,200,250,.08)), var(--glass);
  border-color: rgba(90,200,250,.45);
  box-shadow: 0 10px 30px rgba(10,132,255,.18);
}
.project-card.p2::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
  background: radial-gradient(circle, rgba(90,200,250,.2) 0%, transparent 70%);
  pointer-events: none;
}
.project-card.p1 { opacity: .72; }
.project-card .project-emoji { filter: drop-shadow(0 4px 10px rgba(10,132,255,.35)); }

/* ============ 健康页精修 ============ */
.energy-row { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 16px; padding: 10px 8px; }
.energy-cell { background: transparent; border: 0; }
.energy-cell.primary {
  background: linear-gradient(135deg, rgba(10,132,255,.5), rgba(90,200,250,.35));
  border: 1px solid rgba(90,200,250,.45);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(10,132,255,.3);
}
[data-theme="light"] .energy-row { background: rgba(31,42,80,.04); }
[data-theme="light"] .energy-cell.primary { background: linear-gradient(135deg, rgba(0,96,223,.22), rgba(56,182,255,.18)); border-color: rgba(0,96,223,.35); box-shadow: 0 4px 14px rgba(0,96,223,.18); }
[data-theme="vivid"] .energy-cell.primary { background: linear-gradient(135deg, rgba(124,77,255,.55), rgba(255,107,157,.4)); border-color: rgba(255,107,157,.5); }

/* 训练记录条目 */
.wk-rec { display: flex; justify-content: space-between; align-items: center; }

/* 首页热量条圆滑 */
#app-main .bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.12); }
#app-main .bar-fill { border-radius: 6px; }
