:root {
    --bg: #0f172a; --card: #1e293b; --card2: #172033; --text: #e2e8f0;
    --text-strong: #f8fafc; --muted: #94a3b8; --dim: #64748b;
    --orange: #a78bfa; --red: #ef4444; --green: #22c55e; --blue: #3b82f6; --yellow: #facc15;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
  html, body { height: 100%; }
  body {
    background: var(--bg); color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
    max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative;
  }
  .page { padding: 20px 16px 120px; }
  button { font-family: inherit; border: none; cursor: pointer; outline: none; -webkit-appearance: none; appearance: none; }
  .btn-primary {
    width: 100%; background: linear-gradient(145deg, #8b5cf6, #6d28d9); color: #fff;
    border-radius: 14px; font-size: 17px; font-weight: 600; padding: 15px 0; text-align: center;
  }
  .btn-primary:active { opacity: 0.85; }
  .btn-ghost {
    width: 100%; background: rgba(255,255,255,0.06); color: var(--text);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; font-size: 16px; padding: 13px 0; text-align: center;
  }
  .card { background: var(--card); border-radius: 18px; padding: 20px; margin-bottom: 16px; }
  .section-title { font-size: 18px; font-weight: 700; color: var(--text-strong); margin-bottom: 8px; }
  .muted { color: var(--muted); font-size: 13px; line-height: 1.5; }
  .hidden { display: none !important; }

  .topbar { position: sticky; top: 0; background: var(--bg); z-index: 10; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .topbar .back { font-size: 22px; color: var(--orange); width: 24px; cursor: pointer; }
  .topbar .title { font-size: 17px; font-weight: 700; color: var(--text-strong); }
  .ver-switch { margin-left: auto; font-size: 12px; color: var(--muted); text-decoration: none; padding: 4px 12px; border: 1px solid rgba(255,255,255,0.14); border-radius: 999px; white-space: nowrap; }
  .ver-switch:active { color: var(--orange); border-color: var(--orange); }

  .hero { text-align: center; padding: 40px 0 32px; }
  .hero-logo { width: 132px; height: 132px; object-fit: contain; display: block; margin: 0 auto; filter: drop-shadow(0 0 14px rgba(167,139,250,0.45)); animation: handGlow 3s ease-in-out infinite; }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes handGlow {
      0%, 100% { transform: scale(1); filter: drop-shadow(0 0 14px rgba(167,139,250,0.45)); }
      50% { transform: scale(1.03); filter: drop-shadow(0 0 30px rgba(124,58,237,0.75)); }
    }
  }
  .hero-title { font-size: 40px; font-weight: 800; color: var(--orange); letter-spacing: 4px; margin-top: 8px; display: block; }
  .hero-sub { color: var(--muted); font-size: 13px; margin-top: 10px; display: block; }

  .recovery-row { display: flex; align-items: center; gap: 16px; margin: 16px 0; }
  .recovery-score { width: 82px; height: 82px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; color: var(--bg); flex-shrink: 0; }
  .recovery-score.green { background: var(--green); }
  .recovery-score.blue { background: var(--blue); }
  .recovery-score.yellow { background: var(--yellow); }
  .recovery-score.red { background: var(--red); }
  .recovery-info { display: flex; flex-direction: column; gap: 4px; }
  .recovery-text { font-size: 20px; font-weight: 700; color: var(--text-strong); }

  .metric-grid { display: flex; gap: 10px; margin-top: 16px; }
  .metric { flex: 1; background: rgba(255,255,255,0.04); border-radius: 12px; padding: 16px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .metric-num { font-size: 22px; font-weight: 700; color: var(--orange); }
  .metric-label { font-size: 11px; color: var(--muted); text-align: center; }

  .link-row { display: flex; justify-content: space-between; margin-top: 14px; }
  .link { color: var(--blue); font-size: 14px; padding: 8px; cursor: pointer; }
  .link.danger { color: var(--red); }

  .sport-list { display: flex; flex-direction: column; gap: 12px; }
  .sport-item { background: var(--card); border: 2px solid transparent; border-radius: 16px; padding: 20px; cursor: pointer; transition: border-color 0.15s; }
  .sport-item:active { border-color: var(--orange); }
  .sport-head { display: flex; justify-content: space-between; align-items: center; }
  .sport-label-wrap { display: flex; align-items: center; gap: 10px; }
  .sport-emoji { font-size: 28px; }
  .sport-label { font-size: 20px; font-weight: 700; color: var(--text-strong); }
  .sport-arrow { color: var(--orange); font-size: 20px; }
  .sport-desc { color: var(--muted); font-size: 13px; margin-top: 6px; display: block; }

  .progress-bar { width: 100%; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
  .progress-fill { height: 100%; background: linear-gradient(90deg, #a78bfa, #6d28d9); border-radius: 4px; transition: width 0.3s; }
  .progress-text { display: block; text-align: right; color: var(--muted); font-size: 12px; margin-top: 8px; }
  .question-title { font-size: 24px; font-weight: 700; color: var(--text-strong); margin: 36px 0 24px; line-height: 1.4; }
  .options { display: flex; flex-direction: column; gap: 12px; }
  .option { background: var(--card); border: 2px solid transparent; border-radius: 14px; padding: 18px; font-size: 16px; color: var(--text); cursor: pointer; transition: all 0.15s; }
  .option.active { border-color: var(--orange); background: #2b2430; color: var(--orange); font-weight: 600; }
  .actions { display: flex; gap: 12px; margin-top: 36px; }
  .actions button { flex: 1; }

  .status-card { background: linear-gradient(135deg, #1e293b, #172033); border-radius: 18px; padding: 20px; margin-bottom: 16px; }
  .status-top { display: flex; justify-content: space-between; align-items: center; }
  .status-left { display: flex; flex-direction: column; gap: 4px; }
  .status-label { color: var(--muted); font-size: 12px; }
  .status-value { font-size: 22px; font-weight: 700; color: var(--text-strong); }
  .status-right { text-align: center; }
  .streak-num { font-size: 34px; font-weight: 800; color: var(--orange); display: block; }
  .streak-label { color: var(--muted); font-size: 11px; }

  .avoid-banner { display: flex; align-items: flex-start; gap: 12px; background: rgba(239,68,68,0.10); border-radius: 12px; padding: 14px; margin-top: 14px; }
  .avoid-icon { font-size: 24px; }
  .avoid-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
  .avoid-title { font-size: 15px; font-weight: 700; color: #f87171; }
  .avoid-text { color: var(--text); font-size: 12px; line-height: 1.5; }

  .rhythm-banner { display: flex; align-items: flex-start; gap: 12px; background: rgba(59,130,246,0.10); border-radius: 12px; padding: 14px; margin-top: 10px; }
  .rhythm-banner.high { background: rgba(239,68,68,0.10); }
  .rhythm-banner.low { background: rgba(250,204,21,0.10); }
  .rhythm-icon { font-size: 24px; }
  .rhythm-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
  .rhythm-title { font-size: 15px; font-weight: 700; color: #60a5fa; }
  .rhythm-banner.high .rhythm-title { color: #f87171; }
  .rhythm-banner.low .rhythm-title { color: #facc15; }
  .rhythm-text { color: var(--text); font-size: 12px; line-height: 1.5; white-space: pre-line; }

  .calendar-card { background: var(--card); border-radius: 18px; padding: 16px; }
  .calendar-hint { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 14px; line-height: 1.6; }
  .month-block { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,0.08); }
  .month-block:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
  .month-title-row { font-size: 15px; font-weight: 700; color: var(--text-strong); text-align: center; margin: 2px 0 10px; letter-spacing: 1px; }
  .day-cell.empty { cursor: default; }
  .calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .nav-btn { font-size: 28px; color: var(--orange); padding: 0 12px; cursor: pointer; user-select: none; }
  .month-title { font-size: 18px; font-weight: 700; color: var(--text-strong); }
  .weekday-row { display: flex; margin-bottom: 4px; }
  .weekday { flex: 1; text-align: center; color: var(--dim); font-size: 12px; }
  .weeks { display: flex; flex-direction: column; }
  .week { display: flex; }
  .day-cell { flex: 1; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; border-radius: 8px; margin: 1px; cursor: pointer; }
  .day-cell:active { background: rgba(255,255,255,0.06); }
  .day-num { font-size: 14px; color: #cbd5e1; }
  .day-num.today { color: var(--orange); font-weight: 800; }
  .day-marks { display: flex; gap: 3px; margin-top: 2px; height: 16px; }
  .mark { font-size: 10px; width: 16px; height: 16px; line-height: 16px; text-align: center; border-radius: 50%; color: #fff; }
  .mark-release { background: var(--green); }
  .mark-schedule { background: var(--blue); }
  .mark-rest { background: var(--yellow); color: #1f2937; font-weight: 700; }
  .mark-ready { background: var(--orange); font-weight: 700; }
  .mark-avoid { background: var(--red); font-weight: 700; }

  .today-row { display: flex; gap: 8px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; margin-top: 14px; font-size: 13px; line-height: 1.5; }
  .today-row.green { background: rgba(34,197,94,0.12); }
  .today-row.yellow { background: rgba(250,204,21,0.12); }
  .today-row.red { background: rgba(239,68,68,0.14); }
  .today-icon { font-size: 16px; flex-shrink: 0; }

  .storage-warning { display: block; background: rgba(250,204,21,0.15); color: #facc15; padding: 10px 14px; border-radius: 12px; font-size: 12px; margin: 12px 16px 0; text-align: center; line-height: 1.5; }

  .suggest-banner { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(145deg, #8b5cf6, #6d28d9); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
  .suggest-left { display: flex; flex-direction: column; gap: 2px; }
  .suggest-label { font-size: 12px; color: rgba(255,255,255,0.85); }
  .suggest-date { font-size: 28px; font-weight: 800; color: #fff; letter-spacing: 1px; }
  .suggest-right { font-size: 12px; color: rgba(255,255,255,0.9); text-align: right; max-width: 120px; line-height: 1.4; }
  .legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
  .legend-item { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }

  .bottom-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: rgba(15,23,42,0.96); }

  .field-label { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
  .type-row { display: flex; gap: 10px; }
  .type-item { flex: 1; background: rgba(255,255,255,0.04); border: 2px solid transparent; border-radius: 10px; padding: 14px 4px; text-align: center; font-size: 14px; color: #cbd5e1; cursor: pointer; }
  .type-item.active { border-color: var(--orange); color: var(--orange); font-weight: 600; }
  input[type="date"], input[type="text"] { width: 100%; background: rgba(255,255,255,0.04); border: none; border-radius: 10px; padding: 14px; font-size: 16px; color: var(--text-strong); color-scheme: dark; outline: none; }
  input::placeholder { color: var(--dim); }

  .toast { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: 84vw; text-align: center; background: rgba(0,0,0,0.88); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; line-height: 1.5; z-index: 100; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
  .toast.show { opacity: 1; }

  /* ===== 每日记录 ===== */
  .log-date-row { display: flex; align-items: center; justify-content: center; gap: 16px; }
  .log-date { font-size: 17px; font-weight: 700; color: var(--text-strong); min-width: 128px; text-align: center; }
  .log-nav { font-size: 24px; color: var(--orange); padding: 0 8px; cursor: pointer; user-select: none; }
  .log-nav.disabled { color: var(--dim); cursor: default; }
  .log-top { text-align: center; margin-top: 10px; }
  .log-streak { display: inline-block; background: rgba(124,58,237,0.15); color: var(--brand); font-size: 12px; padding: 4px 12px; border-radius: 999px; }
  .log-tip { display: block; color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.6; }

  .log-group { background: var(--card); border-radius: 18px; padding: 18px 16px; margin-bottom: 14px; }
  .log-label { font-size: 15px; font-weight: 700; color: var(--text-strong); display: block; }
  .log-sub { color: var(--muted); font-size: 12px; display: block; margin: 4px 0 12px; line-height: 1.5; }
  .chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip-opt {
    background: rgba(255,255,255,0.05); border: 2px solid transparent; border-radius: 12px;
    padding: 9px 13px; font-size: 13px; color: #cbd5e1; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
  }
  .chip-opt:active { transform: scale(0.97); }
  .chip-opt.active { border-color: var(--orange); color: var(--orange); background: rgba(124,58,237,0.12); font-weight: 600; }
  .chip-opt.good.active { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.10); }
  .chip-opt.bad.active { border-color: var(--red); color: #f87171; background: rgba(239,68,68,0.10); }
  .chip-opt.big { flex: 1; text-align: center; padding: 15px 8px; font-size: 15px; }
  .log-subpanel { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08); }

  .log-note { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; margin-top: 12px; font-size: 12px; line-height: 1.55; color: var(--text); background: rgba(59,130,246,0.10); }
  .log-note.warn { background: rgba(239,68,68,0.10); }
  .log-note.good { background: rgba(34,197,94,0.10); }
  .log-note-icon { font-size: 16px; flex-shrink: 0; }

  .day-cell .log-dot { position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: #60a5fa; }

  .js-warning { display: none; background: rgba(239,68,68,0.15); color: #fca5a5; padding: 12px 16px; border-radius: 12px; font-size: 13px; margin: 16px; text-align: center; }
/* ===== 新版新增：徽章（两版通用） ===== */
  .hero-badge { display: inline-block; margin-top: 10px; background: rgba(124,58,237,0.15); color: var(--brand); font-size: 12px; padding: 3px 12px; border-radius: 999px; }

  /* ===== 新版新增：键盘可达性 ===== */
  [data-action] { cursor: pointer; }
  [data-action]:focus-visible,
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  .type-item:focus-visible,
  .chip-opt:focus-visible,
  .option:focus-visible,
  .day-cell:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 12px;
  }
  .page:focus { outline: none; }

  /* ===== 新版新增：评估进度提示 ===== */
  .q-hint { display: block; text-align: right; color: var(--muted); font-size: 12px; margin-top: 6px; }

  /* ===== 新版新增：日历「回到今天」 ===== */
  .cal-today {
    display: inline-block; margin: 0 auto 12px; text-align: center; font-size: 12px; color: var(--orange);
    border: 1px solid rgba(167,139,250,0.5); border-radius: 999px; padding: 5px 14px; cursor: pointer;
  }
  .cal-today-wrap { text-align: center; }

  /* ===== 新版新增：无脚本提示（替代原来永远不会显示的 jsWarning） ===== */
  .noscript-tip { background: rgba(239,68,68,0.15); color: #fca5a5; padding: 12px 16px; border-radius: 12px; font-size: 13px; margin: 16px; text-align: center; }

  /* ===== 新版新增：年龄确认（合规） ===== */
  .age-gate { position: fixed; inset: 0; z-index: 300; background: rgba(15,23,42,0.985); display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
  .age-gate-card { max-width: 430px; width: 100%; background: var(--card); border-radius: 18px; padding: 26px 22px; }
  .age-gate-card h2 { font-size: 20px; color: var(--text-strong); margin-bottom: 12px; text-align: center; }
  .age-gate-card p { color: var(--muted); font-size: 13px; line-height: 1.75; margin-bottom: 10px; }
  .age-gate-card .age-links { text-align: center; font-size: 12px; margin-top: 4px; }
  .age-gate-card .age-links a { color: #64748b; text-decoration: underline; }
  .age-gate-btns { display: flex; gap: 10px; margin-top: 18px; }
  .age-gate-btns button { flex: 1; }
  .age-deny-tip { display: none; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(239,68,68,0.12); color: #fca5a5; font-size: 13px; line-height: 1.7; }
  .age-deny-tip.show { display: block; }

  /* ===== 新版新增：统一页脚 ===== */
  .site-footer { text-align: center; color: #475569; font-size: 11px; line-height: 1.9; padding: 20px 16px 26px; }
  .site-footer a { color: #64748b; text-decoration: underline; }
  .site-footer .sep { margin: 0 7px; opacity: .45; }

  /* ===== 新版新增：记录后的即时回应（陪伴感） ===== */
  .ack-card { display: flex; gap: 10px; align-items: flex-start; background: rgba(59,130,246,0.10); border: 1px solid rgba(59,130,246,0.24); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
  .ack-icon { font-size: 18px; line-height: 1.3; }
  .ack-text { font-size: 13px; line-height: 1.7; color: var(--text); }

  /* ===== 新版新增：我的数据页 / 文档页 ===== */
  .data-sum { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .data-chip { font-size: 12px; color: #cbd5e1; background: rgba(255,255,255,0.06); border-radius: 999px; padding: 5px 12px; }
  .data-row { border-top: 1px solid rgba(255,255,255,0.07); padding: 12px 0; font-size: 13px; }
  .data-row:first-child { border-top: none; padding-top: 0; }
  .data-row .k { color: var(--text-strong); font-weight: 600; }
  .data-row .v { color: var(--muted); display: block; margin-top: 5px; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; }
  .data-row details summary { color: var(--blue); font-size: 12px; cursor: pointer; margin-top: 6px; }
  .data-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
  .data-btns button { flex: 1 1 45%; }
  .doc h2 { font-size: 17px; color: var(--text-strong); margin: 22px 0 8px; }
  .doc h2:first-child { margin-top: 0; }
  .doc p, .doc li { color: var(--muted); font-size: 13px; line-height: 1.85; }
  .doc ul { padding-left: 20px; margin: 8px 0; }
  .doc strong { color: var(--text); }
  .doc .updated { color: #64748b; font-size: 12px; }

  /* ===== 新版新增：周报里的四格指标（换行成 2×2，避免挤在一起） ===== */
  .metric-grid.four { flex-wrap: wrap; }
  .metric-grid.four .metric { flex: 1 1 40%; }

  /* ===== 新版新增：恢复曲线图（内联 SVG） ===== */
  .curve-chart { display: block; width: 100%; height: auto; margin: 4px 0 12px; }

  /* ===== 新版新增：移动端 / iOS 加固 =====
     我只能在 Windows 的 Chromium 上测，没法真机验 iOS，所以把已知的风险点先做防御：
     ① iOS 旋转屏幕时会自动放大文字 → 锁定 text-size-adjust
     ② iOS 地址栏收起/展开会让 100vh 抖动 → 追加 100dvh（旧浏览器忽略这一行，用上面的 100vh）
     ③ iOS 双击有 300ms 缩放延迟，长按会选中文字 → 交互元素统一 touch-action + 禁选
     ④ iOS 上 date / text 输入框可点区域偏矮 → 给最小高度 */
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { min-height: 100vh; min-height: 100dvh; }
  [data-action], .chip-opt, .option, .day-cell, .type-item, .sport-item, .nav-btn, .cal-today {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
  }
  input[type="date"], input[type="text"] { min-height: 44px; }

  /* ===== 新版新增：视觉与可用性打磨 =====
     依据：① 触控目标偏小（chip-opt 实测约 38px，低于 44px 的建议值）
           ② 正文偏小（说明性文字 12~13px，手机上看吃力）
           ③ 卡片与底色只靠色差区分，边界不清
           ④ 首屏 hero 占位过多，内容被推到折叠线以下 */
  .chip-opt { padding: 12px 14px; font-size: 14px; }
  .muted { font-size: 14px; }
  .log-sub { font-size: 13px; }
  .metric-label { font-size: 12px; }
  .chip { font-size: 12px; padding: 5px 11px; }
  .card, .status-card { border: 1px solid rgba(255,255,255,0.055); }
  .hero { padding: 34px 0 26px; }
  /* logo 已换成 SVG 记号（节律曲线）：不再是方形图片，也不需要原来给金色拳头做的光晕动画 */
  .hero-logo { width: 148px; height: auto; animation: none; object-fit: contain; filter: drop-shadow(0 8px 22px rgba(124,58,237,0.22)); }
  .home .hero { padding: 40px 0 26px; }
  .home .hero-logo { width: 148px; height: auto; }
  /* 注：曾把品牌记号放进顶栏，但箭头图形挨着标题会被读成"排序/展开"这类 UI 控件，
     所以撤掉——品牌只保留在首页 hero（那里有足够的语境说明它是标志）。 */

  /* ===== 颜色职责拆分 + 对比度修复 =====
     实测（WCAG，正文需 ≥4.5）：
       页脚文字 #475569 → 2.36 不合格   → 改 #8b9bb4（6.33）
       页脚链接 #64748b → 3.75 偏低     → 改 #94a3b8（6.96）
       弱文字  #64748b → 3.07 偏低      → 改 #8394ab（4.73）
       链接蓝  #3b82f6 → 3.98 偏低      → 改 #60a5fa（5.75）
     另外把"数据"从橙色里分出来：橙色只留给品牌与操作，数据用冷色（青），
     否则指标数字、图表、建议标记和主按钮抢同一份注意力。 */
  :root { --dim: #8394ab; --blue: #60a5fa; --data: #38bdf8; }
  .metric-num { color: var(--brand); }
  .site-footer { color: #8b9bb4; }
  .site-footer a { color: #94a3b8; }

  /* ===== 品牌色：橙 → 紫，并拆成"强调色"与"填充色"两个变量 =====
     为什么换：橙→红的渐变本身就是"警告色"组合，而红色在我们的语义里已经表示"透支/危险"；
     主按钮带警报感、又和警告色抢职责。换成单色紫之后主操作变平静，红色也释放出来只表示警告。
     为什么拆两个：填充按钮上的白字需要 ≥4.5，实测白字在 #7c3aed 上是 5.70（合格），
     而 #7c3aed 作为深色底上的文字只有 2.57（不合格）——所以文字强调用更亮的 #a78bfa（5.38）。 */
  :root {
    --brand: #a78bfa;        /* 深色底上的链接/强调/图标 */
    --brand-fill: #7c3aed;   /* 填充按钮（白字 5.70） */
    --orange: var(--brand);  /* 沿用旧变量名，让原有 var(--orange) 全部跟着换色 */
  }
  .btn-primary { background: var(--brand-fill); }
  .suggest-banner { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
  .option.active { border-color: var(--brand); background: rgba(167,139,250,0.12); color: var(--brand); }
  .chip-opt.active { border-color: var(--brand); color: var(--brand); background: rgba(167,139,250,0.12); }

  /* ===== 浅色主题（data-theme="light"）=====
     方向按常规做法：浅灰页面底 + 白卡片（卡片"浮起"）。你最初说的是白底+灰卡片，
     那是反向层级（卡片会显得凹陷）；如果你确实想要那个方向，把下面两行对调即可。 */
  html[data-theme="light"] {
    --bg: #f2f3f5; --card: #ffffff; --card2: #f7f8fa;
    --text: #1f2937; --text-strong: #0f172a; --muted: #526078; --dim: #667589;
    --brand: #6d28d9; --brand-fill: #6d28d9;
    --blue: #2563eb; --data: #0369a1;
    --green: #15803d; --yellow: #a16207; --red: #b91c1c;
  }
  html[data-theme="light"] body { background: #f2f3f5; color: #1f2937; }
  html[data-theme="light"] .card,
  html[data-theme="light"] .status-card { background: #ffffff; border-color: rgba(15,23,42,0.08); }
  html[data-theme="light"] .status-card { background: linear-gradient(135deg, #ffffff, #f7f8fa); }
  html[data-theme="light"] .topbar { background: #f2f3f5; border-bottom-color: rgba(15,23,42,0.08); }
  html[data-theme="light"] .bottom-bar { background: rgba(242,243,245,0.96); }
  html[data-theme="light"] .option.active { background: #f3e8ff; }
  html[data-theme="light"] .chip-opt.active { background: #f3e8ff; }
  /* 白底上的浅色浮层要换成深色浮层，否则看不见 */
  html[data-theme="light"] .chip-opt,
  html[data-theme="light"] .metric,
  html[data-theme="light"] .chip,
  html[data-theme="light"] .data-chip { background: rgba(15,23,42,0.05); }
  html[data-theme="light"] .chip-opt,
  html[data-theme="light"] .day-cell,
  html[data-theme="light"] .data-row { color: #1f2937; }
  html[data-theme="light"] .day-num { color: #334155; }
  html[data-theme="light"] .chip,
  html[data-theme="light"] .data-chip { color: #475569; }
  html[data-theme="light"] .site-footer { color: #5c6a80; }
  html[data-theme="light"] .site-footer a { color: #526078; }
  html[data-theme="light"] .btn-ghost { background: rgba(15,23,42,0.04); border-color: rgba(15,23,42,0.12); color: #1f2937; }
  html[data-theme="light"] .data-row { border-top-color: rgba(15,23,42,0.07); }
  html[data-theme="light"] .week { border-bottom-color: rgba(15,23,42,0.07); }
  html[data-theme="light"] .hero-logo { filter: none; }
  /* 日历标记：浅色下语义色更深，白字才够对比（实测白字 on #15803d=5.02 / #b91c1c=6.47 / #6d28d9=7.10） */
  html[data-theme="light"] .mark,
  html[data-theme="light"] .mark-rest,
  html[data-theme="light"] .recovery-score { color: #ffffff; }
  html[data-theme="light"] .toast { background: rgba(15,23,42,0.92); }


  /* ===== 首页专用样式（作用域 .home，不影响功能页） ===== */

    :root {
      --bg: #0f172a; --card: #1e293b; --text: #e2e8f0;
      --text-strong: #f8fafc; --muted: #94a3b8;
      --blue: #3b82f6;
    }
    .home * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
    .home { min-height: 100%; }
    .home {
      background: var(--bg); color: var(--text);
      font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
      max-width: 480px; margin: 0 auto; min-height: 100vh;
      padding: 0 16px 40px; display: flex; flex-direction: column;
    }
    .home .hero { text-align: center; padding: 52px 0 32px; }
    .home .hero-logo {
      width: 132px; height: 132px; object-fit: contain; display: block; margin: 0 auto;
      filter: drop-shadow(0 0 14px rgba(167,139,250,0.45)); animation: glow 3s ease-in-out infinite;
    }
    @media (prefers-reduced-motion: no-preference) {
      @keyframes glow {
        0%, 100% { transform: scale(1); filter: drop-shadow(0 0 14px rgba(167,139,250,0.45)); }
        50% { transform: scale(1.03); filter: drop-shadow(0 0 30px rgba(124,58,237,0.75)); }
      }
    }
    .home .hero-title { font-size: 40px; font-weight: 800; color: var(--orange); letter-spacing: 4px; margin-top: 8px; display: block; }
    .home .hero-sub { color: var(--muted); font-size: 13px; margin-top: 12px; display: block; line-height: 1.7; }
    .home .pick-hint { text-align: center; color: #cbd5e1; font-size: 14px; margin: 6px 0 16px; }

    .home .ver-card {
      display: block; text-decoration: none; background: var(--card);
      border: 2px solid transparent; border-radius: 18px; padding: 22px 20px;
      margin-bottom: 14px; transition: border-color .15s, transform .15s;
    }
    .home .ver-card:active { border-color: var(--orange); transform: scale(0.985); }
    .home .ver-top { display: flex; align-items: center; gap: 10px; }
    .home .ver-emoji { font-size: 30px; }
    .home .ver-name { font-size: 21px; font-weight: 700; color: var(--text-strong); }
    .home .ver-tag { margin-left: auto; font-size: 11px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
    .home .ver-tag.blue { background: rgba(59,130,246,0.18); color: #60a5fa; }
    .home .ver-tag.orange { background: rgba(45,212,191,0.18); color: #2dd4bf; }
    html[data-theme="light"] .home .ver-tag.orange { background: rgba(13,148,136,0.12); color: #0d9488; }
    .home .ver-tag.purple { background: rgba(139,92,246,0.18); color: #a78bfa; }
    html[data-theme="light"] .home .ver-tag.purple { background: rgba(109,40,217,0.10); color: #6d28d9; }
    .home .ver-desc { color: var(--muted); font-size: 13px; line-height: 1.65; margin-top: 10px; display: block; }
    .home .ver-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
    .home .chip { font-size: 11px; color: #cbd5e1; background: rgba(255,255,255,0.06); border-radius: 999px; padding: 4px 10px; }

    .home .footer { text-align: center; color: #475569; font-size: 11px; line-height: 1.8; margin-top: auto; padding-top: 28px; }

  /* ===== 底部选项卡（生活版 / 健身版 / 纯戒色模式共用） =====
     固定在视口最下方：页面无论怎么上下滑动，它都停在那儿。
     正中间那格是抬起来的圆形 Check in 按钮，点它 = 记录今天的真实状态。
     品牌色是紫色（--brand），所以这里不用橙红，避免和"警告/透支"的红色语义打架。 */
  body.has-tabbar { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.has-tabbar .toast { bottom: calc(184px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
    width: 100%; max-width: 480px; z-index: 90;
    display: flex; align-items: flex-end; justify-content: space-between;
    background: var(--bg);
    border-top: 1px solid rgba(255,255,255,0.07);
    height: calc(56px + env(safe-area-inset-bottom));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  html[data-theme="light"] .tabbar { background: #f2f3f5; border-top-color: rgba(15,23,42,0.08); }
  .tab {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 2px 0 1px; background: none; border: 0; font-family: inherit;
    text-decoration: none; color: var(--dim); font-size: 11px; line-height: 1.1; cursor: pointer;
  }
  .tab:active { opacity: .7; }
  .tab-icon, .tab-icon svg { display: block; width: 24px; height: 24px; }
  .tab.active { color: var(--brand); }
  .tab-label { font-size: 11px; letter-spacing: .5px; }

  /* 中间的 Check in：抬起一个圆形按钮，周围有旋转弧线和扩散脉冲 */
  .tab.tab-fab {
    flex: 0 0 76px; position: relative; padding: 0; gap: 0;
    transform: translateY(-19px);
    --fab-cut: var(--bg);
    --fab-glow: var(--brand);
    --fab-glow-soft: rgba(167,139,250,0.34);
    --fab-ring: rgba(167,139,250,0.60);
    --fab-halo-dur: 2.6s;
    --fab-pulse-dur: 2.4s;
  }
  html[data-theme="light"] .tab.tab-fab { --fab-cut: #f2f3f5; }
  .tab-fab-disc {
    position: relative; z-index: 3;
    width: 62px; height: 62px; border-radius: 50%; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: linear-gradient(145deg, #a78bfa 0%, #7c3aed 55%, #6d28d9 100%);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(0,0,0,0.34), 0 0 0 5px var(--fab-cut);
  }
  .tab-fab-disc svg { width: 21px; height: 21px; display: block; }
  .tab-fab-label { font-size: 12px; font-weight: 800; letter-spacing: .3px; line-height: 1; }
  .tab-fab.current .tab-fab-disc { box-shadow: 0 10px 22px rgba(0,0,0,0.34), 0 0 0 5px var(--fab-cut), 0 0 0 7px var(--fab-ring); }

  /* 状态色：今天还没打卡 = 品牌紫催一下；守住了 / 记过了 = 绿；破戒 = 红；只记状态 = 蓝 */
  .tab-fab.kept, .tab-fab.logged {
    --fab-glow: rgba(34,197,94,0.95); --fab-glow-soft: rgba(34,197,94,0.32); --fab-ring: rgba(34,197,94,0.55);
    --fab-halo-dur: 6s; --fab-pulse-dur: 3.8s;
  }
  .tab-fab.broke {
    --fab-glow: #ef4444; --fab-glow-soft: rgba(239,68,68,0.32); --fab-ring: rgba(239,68,68,0.55);
    --fab-halo-dur: 3.4s; --fab-pulse-dur: 3s;
  }
  /* 外圈：一条绕着圆圈转的弧线 */
  .tab-fab-halo {
    position: absolute; left: 50%; top: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px;
    border-radius: 50%; z-index: 1; pointer-events: none;
    border: 2px solid transparent;
    border-top-color: var(--fab-glow);
    border-right-color: var(--fab-glow-soft);
  }
  /* 内圈：两圈向外扩散的脉冲 */
  .tab-fab-rings {
    position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px;
    z-index: 2; pointer-events: none;
  }
  .tab-fab-rings::before, .tab-fab-rings::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--fab-ring); opacity: 0;
  }
  @media (prefers-reduced-motion: no-preference) {
    .tab-fab-halo { animation: fabSpin var(--fab-halo-dur) linear infinite; }
    .tab-fab-rings::before { animation: fabPulse var(--fab-pulse-dur) ease-out infinite; }
    .tab-fab-rings::after {
      animation: fabPulse var(--fab-pulse-dur) ease-out infinite;
      animation-delay: calc(var(--fab-pulse-dur) * -0.5);
    }
  }
  @keyframes fabSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
  @keyframes fabPulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.62); opacity: 0; } }

  /* 日历页原来的固定底栏会被选项卡盖住，改成内容区里的一行按钮 */
  .cal-actions { display: flex; gap: 10px; margin-top: 16px; }
  .cal-actions .btn-primary, .cal-actions .btn-ghost { flex: 1; }

  /* ===== Check in 的两步交互 =====
     第一步：点底部选项卡中间那个圆按钮 —— 它不会直接跳页；
     第二步：屏幕正中出现一个大号 Check in，再点它才进打卡页。 */
  .fab-overlay {
    position: fixed; inset: 0; z-index: 200;
    display: none; align-items: center; justify-content: center;
  }
  .fab-overlay.open { display: flex; }
  .fab-overlay-backdrop {
    position: absolute; inset: 0; border: 0; padding: 0; cursor: pointer;
    background: rgba(2,6,23,0.62);
    backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  }
  .fab-overlay-card {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center; gap: 20px;
    animation: fabPop .22s ease-out both;
  }
  @keyframes fabPop { from { transform: scale(.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  .fab-big { position: relative; background: none; border: 0; padding: 0; cursor: pointer; }
  .fab-big-disc {
    position: relative; z-index: 3;
    width: 148px; height: 148px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(145deg, #a78bfa 0%, #7c3aed 55%, #6d28d9 100%);
    color: #ffffff;
    box-shadow: 0 22px 50px rgba(76,29,149,0.5), 0 0 0 10px rgba(124,58,237,0.13);
    transition: transform .12s;
  }
  .fab-big:active .fab-big-disc { transform: scale(.97); }
  .fab-big-disc svg { width: 44px; height: 44px; display: block; }
  .fab-big-disc span { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
  .fab-big-halo {
    position: absolute; left: 50%; top: 50%; width: 182px; height: 182px; margin: -91px 0 0 -91px;
    border-radius: 50%; z-index: 1; pointer-events: none;
    border: 2px solid transparent;
    border-top-color: rgba(167,139,250,0.9);
    border-right-color: rgba(167,139,250,0.28);
  }
  .fab-big-rings {
    position: absolute; left: 50%; top: 50%; width: 148px; height: 148px; margin: -74px 0 0 -74px;
    z-index: 2; pointer-events: none;
  }
  .fab-big-rings::before, .fab-big-rings::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid rgba(167,139,250,0.55); opacity: 0;
  }
  @media (prefers-reduced-motion: no-preference) {
    .fab-big-halo { animation: fabSpin 4.5s linear infinite; }
    .fab-big-rings::before { animation: fabPulse 3s ease-out infinite; }
    .fab-big-rings::after { animation: fabPulse 3s ease-out infinite; animation-delay: calc(3s * -0.5); }
  }
  .fab-overlay-hint { color: rgba(226,232,240,0.92); font-size: 14px; letter-spacing: .3px; }
  .fab-overlay-cancel {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
    color: rgba(226,232,240,0.9); font-family: inherit; font-size: 13px;
    padding: 9px 24px; border-radius: 999px; cursor: pointer;
  }
  .fab-overlay-cancel:active { opacity: .8; }

  /* =====================================================================
     视觉升级：统一圆角 / 细边 / 柔和阴影 / 毛玻璃顶栏
     放在最后追加覆盖，前面的结构与逻辑规则都不动，随时可以删掉回滚。
     ===================================================================== */
  body {
    background: radial-gradient(130% 55% at 50% -8%, rgba(124,58,237,0.20), rgba(124,58,237,0) 62%), var(--bg);
  }
  html[data-theme="light"] body {
    background: radial-gradient(130% 55% at 50% -8%, rgba(124,58,237,0.10), rgba(124,58,237,0) 62%), #f2f3f5;
  }
  .topbar {
    background: rgba(15,23,42,0.84);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  html[data-theme="light"] .topbar { background: rgba(242,243,245,0.86); }
  .topbar .title { font-size: 16px; letter-spacing: .3px; }
  /* 卡片类表面：统一大圆角 + 细边 + 柔和投影 */
  .card, .log-group, .calendar-card {
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 12px 30px rgba(2,6,23,0.30);
  }
  .status-card { border-radius: 22px; box-shadow: 0 16px 36px rgba(2,6,23,0.34); }
  html[data-theme="light"] .log-group,
  html[data-theme="light"] .calendar-card { border-color: rgba(15,23,42,0.08); box-shadow: 0 10px 26px rgba(15,23,42,0.07); }
  html[data-theme="light"] .card,
  html[data-theme="light"] .status-card { box-shadow: 0 10px 26px rgba(15,23,42,0.07); }
  .section-title { font-size: 17px; letter-spacing: .2px; margin-bottom: 10px; }

  /* 按钮：主按钮换成品牌渐变 + 柔和投影，次按钮做成细边玻璃感 */
  .btn-primary {
    border-radius: 16px; font-weight: 700; letter-spacing: .3px; padding: 16px 0;
    background: linear-gradient(145deg, #8b5cf6, #6d28d9);
    box-shadow: 0 10px 24px rgba(109,40,217,0.34);
  }
  .btn-primary:active { opacity: .92; transform: translateY(1px); }
  .btn-ghost {
    border-radius: 16px; font-weight: 600;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
  }

  /* 选项 / 芯片：细边代替粗边，选中用品牌色描边 + 淡淡一层底 */
  .chip-opt {
    border-radius: 14px; border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04); padding: 11px 14px; font-size: 14px;
    transition: border-color .15s, background .15s, box-shadow .15s;
  }
  html[data-theme="light"] .chip-opt { border-color: rgba(15,23,42,0.10); }
  .chip-opt.active {
    border-color: var(--brand); background: rgba(124,58,237,0.16); color: var(--brand);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.10);
  }
  .chip-opt.good.active {
    border-color: var(--green); background: rgba(34,197,94,0.14); color: var(--green);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.10);
  }
  .chip-opt.bad.active {
    border-color: var(--red); background: rgba(239,68,68,0.14); color: var(--red);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.10);
  }
  html[data-theme="light"] .chip-opt.active,
  html[data-theme="light"] .chip-opt.good.active,
  html[data-theme="light"] .chip-opt.bad.active { background: rgba(109,40,217,0.08); }
  html[data-theme="light"] .chip-opt.good.active { background: rgba(21,128,61,0.08); }
  html[data-theme="light"] .chip-opt.bad.active { background: rgba(185,28,28,0.08); }
  .option {
    border-radius: 16px; border: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 6px 18px rgba(2,6,23,0.20);
  }
  .option.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }
  .type-item { border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); }
  .type-item.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124,58,237,0.10); }

  /* 统计小格 */
  .metric { border-radius: 16px; background: rgba(255,255,255,0.045); }
  .metric-num { font-variant-numeric: tabular-nums; letter-spacing: .3px; }
  .recovery-score { box-shadow: 0 10px 26px rgba(2,6,23,0.30); }

  /* 打卡分组：更松的留白 + 更清楚的层级 */
  .log-group { padding: 20px 18px; }
  .log-label { font-size: 15px; letter-spacing: .1px; }
  .log-sub { margin: 5px 0 14px; }
  .log-streak { background: rgba(124,58,237,0.16); color: var(--brand); font-weight: 600; letter-spacing: .2px; }
  .log-nav { font-size: 22px; color: var(--brand); }
  .log-date { font-size: 18px; letter-spacing: .2px; }
  .chip-grid { gap: 9px; }

  /* 日历：格子更圆、标记更精致 */
  .day-cell { border-radius: 12px; }
  .day-cell:active { background: rgba(124,58,237,0.18); }
  .day-num { font-size: 13px; }
  .day-num.today { color: var(--brand); }
  .mark { width: 17px; height: 17px; line-height: 17px; font-size: 10px; box-shadow: 0 2px 6px rgba(2,6,23,0.32); }
  .month-title-row { letter-spacing: 2px; }
  .nav-btn { color: var(--brand); }
  .legend { gap: 14px; }

  /* 选项卡：和内容分层，但不改变底栏的实色（圆按钮的缺口要对齐） */
  .tabbar { box-shadow: 0 -12px 30px rgba(2,6,23,0.34); }
  .tab.active { color: var(--brand); font-weight: 600; }
  .tab-label { letter-spacing: .4px; }

  /* 提示气泡：玻璃感 */
  .toast {
    border-radius: 16px;
    background: rgba(2,6,23,0.86);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 30px rgba(2,6,23,0.42);
  }
  .sport-item { border-radius: 20px; border: 1px solid rgba(255,255,255,0.07); box-shadow: 0 10px 26px rgba(2,6,23,0.24); }
  .option, .sport-item, .card { transition: border-color .15s, box-shadow .15s, transform .15s; }

  /* ===== 顶栏「切换版本」菜单 ===== */
  button.ver-switch { background: none; font-family: inherit; cursor: pointer; }
  .ver-menu {
    position: absolute; top: 52px; right: 16px; z-index: 120; display: none;
    min-width: 156px; padding: 6px; border-radius: 16px;
    background: var(--card); border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 18px 44px rgba(2,6,23,0.45);
  }
  .ver-menu.open { display: block; }
  .ver-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 12px; border-radius: 11px; text-decoration: none;
    color: var(--text); font-size: 14px; line-height: 1.2;
  }
  .ver-item:active { background: rgba(255,255,255,0.07); }
  .ver-item.current { color: var(--brand); font-weight: 600; }
  .ver-check { font-size: 11px; color: var(--muted); font-weight: 400; }
  html[data-theme="light"] .ver-menu { background: #ffffff; border-color: rgba(15,23,42,0.08); }
  html[data-theme="light"] .ver-item:active { background: rgba(15,23,42,0.05); }

  /* ===== 日历页顶部：三条横幅压成一行摘要 ===== */
  .cal-summary {
    border-radius: 20px; padding: 14px 16px; margin-bottom: 16px; color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 14px 34px rgba(76,29,149,0.35);
  }
  .cal-summary-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .cal-summary-label { font-size: 12px; opacity: .85; }
  .cal-summary-date { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
  .cal-summary-note { margin-left: auto; font-size: 11px; opacity: .85; }
  .cal-summary-advice { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.55; margin-top: 10px; opacity: .96; }
  .cal-summary-meta { font-size: 11px; opacity: .78; margin-top: 8px; }
  .cal-status-row {
    display: flex; align-items: center; gap: 12px; margin: 14px 0 0;
    background: var(--card); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px; padding: 12px 14px;
  }
  html[data-theme="light"] .cal-status-row { border-color: rgba(15,23,42,0.08); }
  .cal-score { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 42px; display: flex; align-items: center;
    justify-content: center; font-size: 16px; font-weight: 800; color: var(--bg); }
  .cal-score.green { background: var(--green); }
  .cal-score.blue { background: var(--blue); }
  .cal-score.yellow { background: var(--yellow); }
  .cal-score.red { background: var(--red); }
  .cal-status-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .cal-status-title { font-size: 14px; font-weight: 700; color: var(--text-strong); }
  .cal-status-row .link { margin-left: auto; white-space: nowrap; font-size: 13px; }

  /* ===== 打卡页：折叠区 + 底部常驻保存条 ===== */
  .log-more { padding: 6px 8px; }
  .log-more-head {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 8px 6px;
    background: none; border: 0; cursor: pointer; font-family: inherit;
    font-size: 14px; font-weight: 700; color: var(--text-strong);
  }
  .log-more-title { flex: 1; text-align: left; }
  .log-more-arrow { font-size: 12px; font-weight: 600; color: var(--brand); white-space: nowrap; }
  .log-more-sub { display: block; padding: 0 8px 8px; font-size: 12px; color: var(--muted); }
  .log-more .log-subpanel { margin: 0 8px 6px; }
  .log-savebar {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(56px + env(safe-area-inset-bottom));
    width: 100%; max-width: 480px; z-index: 80; padding: 10px 16px 30px;
    background: var(--bg); border-top: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 -12px 28px rgba(2,6,23,0.38);
  }
  html[data-theme="light"] .log-savebar { border-top-color: rgba(15,23,42,0.08); box-shadow: 0 -10px 24px rgba(15,23,42,0.08); }
  #pageLog { padding-bottom: 240px; }
  body[data-tool="checkin"] .page { padding-bottom: 240px; }

  /* ===== 日历标记改版：格子淡底色 + 小对勾 / 小圆点（去掉圆底汉字） ===== */
  .day-cell.is-ready    { background: rgba(167,139,250,0.12); }
  .day-cell.is-rest     { background: rgba(148,163,184,0.10); }
  .day-cell.is-avoid    { background: rgba(239,68,68,0.22); }
  .day-cell.is-released { background: rgba(34,197,94,0.22); }
  .day-cell.is-kept     { background: rgba(34,197,94,0.22); }
  .day-cell.is-broke    { background: rgba(239,68,68,0.22); }
  html[data-theme="light"] .day-cell.is-ready { background: rgba(109,40,217,0.12); }
  html[data-theme="light"] .day-cell.is-rest { background: rgba(100,116,139,0.12); }
  html[data-theme="light"] .day-cell.is-avoid,
  html[data-theme="light"] .day-cell.is-broke { background: rgba(185,28,28,0.12); }
  html[data-theme="light"] .day-cell.is-released,
  html[data-theme="light"] .day-cell.is-kept { background: rgba(21,128,61,0.12); }
  .day-cell.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
  .day-cell:active { filter: brightness(1.18); }
  .day-cell.is-ready .day-num { color: var(--brand); font-weight: 700; }
  .day-cell.is-released .day-num { color: var(--green); font-weight: 700; }
  .day-cell.is-kept .day-num { color: var(--green); font-weight: 700; }
  .day-cell.is-avoid .day-num, .day-cell.is-broke .day-num { color: #f87171; font-weight: 700; }
  .day-tick, .day-cross {
    position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
    font-size: 10px; font-weight: 800; line-height: 1;
  }
  .day-tick { color: var(--green); }
  .day-cross { color: var(--red); }
  .sched-dot {
    position: absolute; top: 4px; right: 4px; width: 5px; height: 5px;
    border-radius: 50%; background: var(--blue);
  }
  .sched-dot.social { background: #f472b6; }
  .sched-dot.life { background: var(--dim); }
  .legend .sched-dot { position: static; }
  .legend-swatch {
    width: 15px; height: 15px; flex: 0 0 15px; border-radius: 5px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800;
  }
  .legend-swatch.is-released, .legend-swatch.is-kept { background: rgba(34,197,94,0.22); color: var(--green); }
  .legend-swatch.is-ready { background: rgba(167,139,250,0.22); }
  .legend-swatch.is-rest { background: rgba(148,163,184,0.16); }
  .legend-swatch.is-avoid, .legend-swatch.is-broke { background: rgba(239,68,68,0.20); color: var(--red); }
  /* 「宜」只高亮最近一个窗口，后面的窗口用小圆点提示，避免整月都被染色 */
  .day-cell.is-later { background: transparent; }
  /* 「已记录（没释放）」：和绿色 ✓ 一套做法 —— 淡蓝底 + 数字下方一个小圆点 */
  .day-cell.is-logged { background: rgba(96,165,250,0.14); }
  html[data-theme="light"] .day-cell.is-logged { background: rgba(37,99,235,0.10); }
  .day-cell.is-logged .day-num { color: #93c5fd; }
  html[data-theme="light"] .day-cell.is-logged .day-num { color: #2563eb; }
  .day-dot {
    position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
    width: 5px; height: 5px; border-radius: 50%; background: #60a5fa;
  }
  html[data-theme="light"] .day-dot { background: #2563eb; }
  .legend-swatch.is-logged { background: rgba(96,165,250,0.20); }
  .legend-dot { width: 6px; height: 6px; border-radius: 50%; background: #60a5fa; display: block; }
  html[data-theme="light"] .legend-dot { background: #2563eb; }
  .later-dot {
    position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: rgba(167,139,250,0.7);
  }
  /* 「已记录」的小圆点挪到左上角，免得和底下的小点撞在一起 */
  .day-cell .log-dot { top: 4px; left: 4px; bottom: auto; transform: none; }

  /* ===== 保存条里的就地提示（toast 会压住保存键，这里就地显示最稳） ===== */
  .log-hint {
    display: none; margin-bottom: 8px; padding: 9px 12px; border-radius: 12px;
    background: rgba(239,68,68,0.14); color: #fca5a5;
    font-size: 13px; line-height: 1.5; text-align: center;
  }
  html[data-theme="light"] .log-hint { background: rgba(185,28,28,0.10); color: #b91c1c; }
  .log-hint.show { display: block; }
  @keyframes saveShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
  .log-savebar .btn-primary.shake { animation: saveShake .3s ease-in-out 2; }
  @keyframes flashRing { 0% { box-shadow: 0 0 0 3px rgba(239,68,68,0.60); } 100% { box-shadow: 0 0 0 3px rgba(239,68,68,0); } }
  .flash { animation: flashRing 1.5s ease-out 1; }
