/* =========================================================
   时序 · Chronos — 明亮极简 · iOS 质感（Warm Minimal）
   ========================================================= */

:root {
  color-scheme: light;

  --bg: #f2f2f4;
  --bg-2: #e9e9ec;
  --card: #ffffff;
  --card-2: #f7f7f8;

  --ink: #1c1c1e;
  --ink-2: #6e6e73;
  --ink-3: #a3a3a8;

  --accent: #ff5a1f;
  --accent-deep: #ec4a0d;
  --accent-soft: rgba(255, 90, 31, .1);
  --ok: #34c759;
  --ok-soft: rgba(52, 199, 89, .12);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, .12);
  --danger: #ff3b30;
  --danger-soft: rgba(255, 59, 48, .1);

  --hairline: rgba(60, 60, 67, .1);
  --shadow: 0 6px 24px rgba(28, 28, 32, .05);
  --shadow-lg: 0 12px 36px rgba(28, 28, 32, .1);

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --kb: 0px;

  --r-card: 22px;
  --r: 14px;
  --r-sm: 10px;

  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.42, .64, 1);
  --maxw: 1160px;

  /* 首页统一的卡片内边距与卡片间距：所有卡片/行共用，保证左边缘与节奏一致 */
  --pad-card: 20px;
  --gap-card: 16px;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f0f12;
  --bg-2: #26262b;
  --card: #1c1c20;
  --card-2: #242429;

  --ink: #f5f5f7;
  --ink-2: #b0b0b8;
  --ink-3: #7c7c86;

  --accent: #ff6b3d;
  --accent-deep: #ff8657;
  --accent-soft: rgba(255, 107, 61, .16);
  --ok: #3ddc6a;
  --ok-soft: rgba(61, 220, 106, .14);
  --warn: #ffb340;
  --warn-soft: rgba(255, 179, 64, .14);
  --danger: #ff6259;
  --danger-soft: rgba(255, 98, 89, .14);

  --hairline: rgba(255, 255, 255, .08);
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* .row 等元素自带 display:flex，会盖掉 [hidden] 的 UA 样式 */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .4s var(--ease), color .4s var(--ease);
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: none;
  outline: none;
}
button { cursor: pointer; }

::selection { background: var(--accent-soft); }

/* ============ 背景：极淡暖光 ============ */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient .blob { display: none; }
.grain {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 40% at 50% -6%, var(--accent-soft), transparent 60%);
}

/* ============ 卡片 ============ */
.glass, .glass-strong {
  position: relative;
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .glass, [data-theme="dark"] .glass-strong { border: 1px solid var(--hairline); box-shadow: none; }
.glass::before, .glass::after { content: none; }
.sheen { display: none; }

/* ============ 骨架 ============ */
.app { position: fixed; inset: 0; z-index: 1; overflow: hidden; }
.pages { position: absolute; inset: 0; display: flex; transition: transform .36s var(--ease); }
body:not(.motion) .pages { transition: none; }
.page { position: relative; flex: none; width: 100%; height: 100%; overflow: hidden; }

.scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--sat) + 20px) 18px calc(var(--sab) + 104px);
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }

.tab-fade {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 110px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
  z-index: 2;
}

/* ============ 页头 ============ */
.home-head { max-width: var(--maxw); margin: 0 auto 20px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; flex: none; display: inline-flex; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-name { font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.live-clock { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.date-line {
  margin-top: 18px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .08em;
}
.date-line .sep { flex: 1; height: 1px; background: var(--hairline); }

.micro-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: .05em;
  color: var(--ink-3);
}

/* ============ 按钮 ============ */
.btn {
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r);
  font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s var(--spring), background .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 90, 31, .3);
}
[data-theme="dark"] .btn-primary { box-shadow: none; }
.btn-primary:active { background: var(--accent-deep); }
.btn-ghost {
  background: var(--bg-2);
  color: var(--ink);
}
[data-theme="dark"] .btn-ghost { background: var(--card-2); }

/* 浏览器演示首次进入的轻量说明层，不影响 APK 内原生页面 */
.web-welcome {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(20, 20, 22, .28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.web-welcome-card {
  width: min(430px, 100%); padding: 28px;
  border: 1px solid var(--hairline); border-radius: 22px;
  background: var(--card); box-shadow: var(--shadow-lg);
}
.web-welcome-kicker { font-size: 10px; font-weight: 700; letter-spacing: .12em; color: var(--accent); }
.web-welcome-card h2 { margin: 10px 0 8px; font-size: 25px; line-height: 1.18; }
.web-welcome-card p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.75; }
.web-welcome-actions { display: flex; gap: 10px; margin-top: 22px; }
.web-welcome-actions .btn { flex: 1; }
.web-welcome-note { margin-top: 14px; color: var(--ink-3); font-size: 11px; line-height: 1.5; }
@media (max-width: 420px) {
  .web-welcome-card { padding: 22px; }
  .web-welcome-actions { flex-direction: column; }
}

.pill-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
  transition: transform .15s var(--spring);
}
.pill-btn:active { transform: scale(.95); }
.pill-btn.danger { background: var(--danger-soft); color: var(--danger); }
.pill-btn.ghost { background: var(--bg-2); color: var(--ink-2); }
.pill-btn.ok { background: var(--ok-soft); color: var(--ok); }
.ghost-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px; font-weight: 600;
  transition: transform .15s var(--spring);
}
.ghost-btn:active { transform: scale(.95); }

/* ============ 今日 · 进度卡 ============ */
.progress-card { display: flex; align-items: center; gap: 20px; padding: var(--pad-card); }
.ring-wrap { position: relative; width: 104px; height: 104px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; }
.ring-bg { stroke: var(--hairline); stroke-width: 10; }
.ring-fg {
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 320.44;
  stroke-dashoffset: 320.44;
  transition: stroke-dashoffset .8s var(--ease);
}
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-center b { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1; }
.ring-center span { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-top: 3px; }

.progress-meta { flex: 1; min-width: 0; }
.progress-meta .big {
  font-size: clamp(40px, 12vw, 50px); font-weight: 800; line-height: 1.05; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.progress-meta .big i { font-style: normal; font-size: 22px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.progress-meta .sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.micro-stats {
  display: flex; gap: 24px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--hairline);
}
.micro-stats i { display: block; font-style: normal; font-size: 11px; color: var(--ink-3); }
.micro-stats b { display: block; font-size: 17px; font-weight: 700; color: var(--ink); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ============ 今日 · 当前任务卡 ============ */
#nowCard, .focus-mini { padding: var(--pad-card); }
.now-card { transition: background .3s var(--ease), box-shadow .3s var(--ease); }
.now-card.is-lit {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .now-card.is-lit { box-shadow: none; }
.now-card.is-lit .state-pill { background: var(--accent-soft); border-color: transparent; }
.now-card.is-lit .btn-primary { box-shadow: 0 4px 12px rgba(255, 90, 31, .2); }

.now-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.state-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 11px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  color: var(--accent);
}
.state-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.state-pill.doing .dot { animation: pulse 1.4s ease-in-out infinite; }
.state-pill.done { border-color: var(--ok); color: var(--ok); }
.state-pill.done .dot { background: var(--ok); }
.state-pill.skipped { border-color: var(--danger); color: var(--danger); }
.state-pill.skipped .dot { background: var(--danger); }
.state-pill.idle { border-color: var(--hairline); color: var(--ink-3); }
.state-pill.idle .dot { background: var(--ink-3); }
@keyframes pulse { 50% { opacity: .35; } }
.now-subject { font-size: 12px; font-weight: 600; color: var(--ink-3); }

.now-title { margin: 14px 0 6px; font-size: 25px; font-weight: 800; line-height: 1.25; letter-spacing: 0; }
.now-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--ink-2); }
.now-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }

.now-timer { margin-top: 16px; display: flex; align-items: baseline; gap: 10px; }
.now-timer b { font-size: 40px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.now-timer b.is-long { font-size: 30px; }
.now-timer span { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.now-progress { margin-top: 16px; height: 5px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.now-progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s var(--ease); }
.now-actions { display: flex; gap: 10px; margin-top: 18px; }
.now-actions .btn { flex: 1; }
.now-empty h3 { margin: 10px 0 4px; font-size: 16px; font-weight: 700; color: var(--ink); }
.now-empty p { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.6; }

/* 小屏：进度卡收成一行，别把「今日安排」挤到折叠线以下 */
@media (max-width: 520px) {
  .progress-card { padding: 16px; gap: 14px; }
  .ring-wrap { width: 84px; height: 84px; }
  .ring-center b { font-size: 24px; }
  .ring-center span { font-size: 10px; margin-top: 1px; }
  .progress-meta .big { font-size: 40px; }
  .progress-meta .big i { font-size: 18px; }
  .progress-meta .sub { font-size: 11px; margin-top: 2px; }
  .micro-stats { margin-top: 8px; padding-top: 8px; gap: 18px; }
  .micro-stats i { font-size: 10px; }
  .micro-stats b { font-size: 15px; }
  .schedule-head { padding-top: 14px; padding-bottom: 10px; }
}

/* ============ 今日 · 专注迷你卡（番茄 + 极度沉浸） ============ */
.focus-mini { display: flex; flex-direction: column; gap: 14px; }
.fm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fm-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin-top: 3px; }
.fm-time { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink); }
.fm-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px;
  font-size: 12px; color: var(--ink-3);
}
.fm-meta i { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); opacity: .6; }
.fm-taskname { color: var(--accent); font-weight: 600; }

.fm-guard {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border-radius: var(--r);
  background: var(--bg-2);
  border: 1px solid transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
[data-theme="dark"] .fm-guard { background: var(--card-2); }
.fm-guard.is-on { background: var(--accent-soft); border-color: rgba(255, 90, 31, .22); }
.fm-shield {
  flex: none; width: 30px; height: 30px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--card);
  color: var(--ink-3);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.fm-shield svg { width: 17px; height: 17px; }
.fm-guard.is-on .fm-shield { background: var(--accent); color: #fff; }
.fm-guard-body { flex: 1; min-width: 0; }
.fm-guard-title { font-size: 13.5px; font-weight: 700; }
.fm-guard-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.fm-guard.is-on .fm-guard-sub { color: var(--accent-deep); }

.fm-actions { display: flex; gap: 10px; }
.fm-actions .btn-primary { flex: 1.6; }
.fm-actions .btn-ghost { flex: 1; }

/* ============ 今日 · 布局 ============ */
.home-grid, .home-main, .home-side { display: flex; flex-direction: column; gap: var(--gap-card); }
.home-grid { max-width: var(--maxw); margin: 0 auto; }
#pageToday .glass { border-radius: 18px; }

/* 今日安排：标题与列表同卡，平板下两列卡片从同一条基线开始 */
.schedule-card { overflow: hidden; padding: 0; }
.schedule-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px var(--pad-card) 12px;
}
.schedule-title { min-width: 0; }
.schedule-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: 0; }
.schedule-meta { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.footnote { padding: 10px var(--pad-card) 16px; font-size: 12px; color: var(--ink-3); line-height: 1.7; }

/* ============ 今日 · 时间线（iOS 分组列表） ============ */
.timeline { overflow: hidden; }
.tl-item { position: relative; display: flex; gap: 14px; padding: 15px var(--pad-card); cursor: pointer; transition: background .15s; }
.tl-item:active { background: var(--card-2); }
.tl-item + .tl-item { border-top: 1px solid var(--hairline); }
.tl-time { flex: none; width: 48px; padding-top: 1px; }
.tl-time b { display: block; font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tl-time i { display: block; font-style: normal; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: 1px; }
.tl-card { flex: 1; min-width: 0; }
.tl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tl-title { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; }
.tl-status { flex: none; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; }
.tl-status svg { width: 13px; height: 13px; }
.tl-item.is-todo .tl-status { background: var(--bg-2); color: var(--ink-3); }
.tl-item.is-done .tl-status { background: var(--ok); }
.tl-item.is-done .tl-title { color: var(--ink-3); }
.tl-item.is-done .tl-time b { color: var(--ink-3); }
.tl-item.is-skipped .tl-status { background: var(--danger-soft); color: var(--danger); }
.tl-item.is-skipped .tl-title { color: var(--ink-3); text-decoration: line-through; }
.tl-item.is-skipped .tl-time b { color: var(--ink-3); }
.tl-note { margin: 3px 0 0; font-size: 12px; color: var(--ink-3); }
.tl-bar { margin-top: 9px; height: 4px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.tl-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.tl-item.is-now { background: var(--accent-soft); }
.tl-item.is-now + .tl-item { border-top-color: transparent; }
.tl-item.is-now .tl-time b,
.tl-item.is-now .tl-title { color: var(--accent); }

/* ============ 专注页 ============ */
.focus-grid { max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.pomo-stage { padding: 22px 22px 26px; display: flex; flex-direction: column; align-items: center; }

.seg {
  position: relative;
  display: inline-flex;
  padding: 3px;
  background: var(--bg-2);
  border-radius: 11px;
}
[data-theme="dark"] .seg { background: var(--card-2); }
.seg button {
  position: relative; z-index: 1;
  height: 32px; padding: 0 18px;
  border-radius: 9px;
  font-size: 12px; font-weight: 600;
  color: var(--ink-3);
  transition: color .2s, transform .15s var(--spring);
}
.seg button:active { transform: scale(.96); }
.seg button.on { color: var(--ink); }
.seg-glider {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(33.333% - 4px);
  background: var(--card);
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(28, 28, 32, .12);
  transition: transform .28s var(--spring);
  z-index: 0;
}
[data-theme="dark"] .seg-glider { background: #48484e; box-shadow: none; }
.range-seg { margin: 6px 0 24px; }
.range-seg .seg-glider { width: calc(50% - 4px); }

/* 番茄钟计时方向切换（倒计时 / 正计时） */
.pomo-mode {
  display: flex;
  position: relative;
  margin: 0 auto 10px;
  width: min(240px, 100%);
  padding: 4px;
  gap: 2px;
  background: var(--bg-2);
  border-radius: 999px;
}
.pomo-mode button {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.pomo-mode button.on { color: var(--ink); }
.pomo-mode .seg-glider { width: calc(50% - 4px); }
[data-theme="dark"] .pomo-mode { background: var(--card-2); }

/* 正计时下预设退化为「节拍提示」，弱化存在感 */
.pomo-presets.is-beat { opacity: .72; }
.pomo-presets.is-beat button { padding: 0 12px; font-size: 12px; }

.pomo-ring-wrap { position: relative; width: 224px; height: 224px; margin: 30px 0 10px; }
.pomo-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.pomo-ring circle { fill: none; }
.pomo-track { stroke: var(--hairline); stroke-width: 12; }
.pomo-fill {
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 540.35;
  stroke-dashoffset: 540.35;
  transition: stroke-dashoffset .5s linear, stroke .3s;
}
.pomo-ring.is-break .pomo-fill { stroke: var(--ok); }
.pomo-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.pomo-phase { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .1em; }
.pomo-time { font-size: clamp(48px, 13.5vw, 64px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pomo-ring.is-break + .pomo-center .pomo-time { color: var(--ok); }
.pomo-sub { font-size: 12px; color: var(--ink-3); }

.pomo-dots { display: flex; gap: 8px; margin: 18px 0 6px; }
.pomo-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-2); }
.pomo-dots i.done { background: var(--accent); }
.pomo-dots i.now { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }

.pomo-task { font-size: 13px; color: var(--ink-2); margin: 6px 0 20px; }
.pomo-task b { color: var(--ink); font-weight: 700; }
.pomo-actions { display: flex; gap: 10px; width: 100%; max-width: 400px; }
.pomo-actions .btn { flex: 1; }
.pomo-skip { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--ink-3); transition: color .2s; }
.pomo-skip:active { color: var(--ink); }

.pomo-side { display: flex; flex-direction: column; gap: 16px; }
.pomo-summary { display: flex; padding: 18px 8px; }
.pomo-summary .ps { flex: 1; text-align: center; }
.pomo-summary .ps i { display: block; font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.pomo-summary .ps b { display: block; font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pomo-summary .ps small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { margin: 3px 0 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.focus-heatmap-card { grid-column: 1 / -1; }
.heatmap-wrap { overflow-x: auto; padding-top: 14px; }
.heatmap-hours, .heatmap-row { display: grid; grid-template-columns: 28px repeat(24, minmax(10px, 1fr)); gap: 4px; min-width: 620px; align-items: center; }
.heatmap-hours { color: var(--ink-3); font-size: 9px; text-align: center; margin-bottom: 5px; }
.heatmap-day { color: var(--ink-3); font-size: 10px; }
.heatmap-cell { display: block; aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--accent) calc(var(--heat) * 100%), var(--bg-2)); }
.heatmap-legend { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 10px; color: var(--ink-3); font-size: 10px; }
.heatmap-legend i { width: 11px; height: 11px; border-radius: 3px; background: color-mix(in srgb, var(--accent) calc(var(--heat) * 100%), var(--bg-2)); }
.chart-card { padding: var(--pad-card); }
.chart-legend { font-size: 12px; font-weight: 600; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.dot-accent { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }

.pomo-log { display: flex; flex-direction: column; }
.pomo-log-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  align-items: baseline;
}
.pomo-log-row:first-child { border-top: none; padding-top: 0; }
.pomo-log-row .t { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.pomo-log-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pomo-log-row .m { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============ 柱状图 ============ */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 136px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-val { font-size: 11px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar-track { width: 100%; max-width: 18px; flex: 1; display: flex; align-items: flex-end; border-radius: 999px; overflow: hidden; background: var(--bg-2); }
.bar-fill { width: 100%; height: 0; background: var(--bg-2); border-radius: 999px; transition: height .7s var(--ease); }
.bar-col.is-today .bar-fill { background: var(--accent); }
.bar-col.is-today .bar-track { background: var(--accent-soft); }
.bar-label { font-size: 10px; font-weight: 600; color: var(--ink-3); }
.bar-col.is-today .bar-label { color: var(--accent); }

/* ============ 统计页 ============ */
.stats-grid { max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* 周期卡片：7/30 天切换时一起做一次短促的呼吸高亮，明确「变的是这一段」 */
.period-card.is-period-flash {
  animation: statsPeriodFlash .58s var(--ease);
}
@keyframes statsPeriodFlash {
  0% { opacity: .45; transform: translateY(3px); }
  100% { opacity: 1; transform: none; }
}
body:not(.motion) .period-card.is-period-flash { animation: none; }

/* 按月回顾：可折叠头 + 折叠后的日历 */
.stats-month-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  margin-top: 2px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.stats-month-toggle-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stats-month-toggle .card-title { display: block; }
.stats-month-chevron {
  flex: none;
  width: 20px; height: 20px;
  color: var(--ink-3);
  transition: transform .28s var(--ease);
}
.stats-month-toggle[aria-expanded="true"] .stats-month-chevron { transform: rotate(180deg); }
.calendar-card.is-collapsed { display: none; }
body:not(.motion) .stats-month-chevron { transition: none; }
.stats-section-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 14px 2px 2px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}
.stats-section-label .card-title { margin: 0; }
.stats-section-note { margin: 2px 0 0; font-size: 12px; line-height: 1.6; color: var(--ink-3); }

/* 概览：统计页的唯一视觉重心，数字要比其他卡片显著更大 */
.stat-hero { display: grid; grid-template-columns: 1fr 1fr; padding: 0; overflow: hidden; }
.stat-hero .stat-block { padding: 22px 20px 20px; border-bottom: 1px solid var(--hairline); }
.stat-hero .stat-block:nth-child(odd) { border-right: 1px solid var(--hairline); }
.stat-hero .stat-block:nth-last-child(-n+2) { border-bottom: none; }
.stat-hero .stat-block .k { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .01em; }
.stat-hero .stat-block .v {
  font-size: 40px;
  font-weight: 800;
  margin-top: 8px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
}
.stat-hero .stat-block:first-child .v { color: var(--accent); }
.stat-hero .stat-block .v small { font-size: 14px; font-weight: 600; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.stat-hero .stat-block .s { font-size: 12px; color: var(--ink-3); margin-top: 7px; }

.subject-list { display: flex; flex-direction: column; }
.subject-row {
  display: grid;
  grid-template-columns: 56px 1fr 48px;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}
.subject-row:first-child { border-top: none; padding-top: 0; }
.subject-name { font-size: 13px; font-weight: 700; }
.subject-track { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.subject-fill { height: 100%; width: 0; border-radius: 999px; transition: width .7s var(--ease); }
.subject-time { font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

.empty-state { padding: 28px 8px; font-size: 13px; color: var(--ink-3); line-height: 2; text-align: center; }

.heatmap { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.heat-cell { aspect-ratio: 1; background: var(--bg-2); border-radius: 4px; }
.heat-cell.l1, .heat-cell.h1 { background: var(--accent-soft); }
.heat-cell.l2, .heat-cell.h2 { background: rgba(255, 90, 31, .32); }
.heat-cell.l3, .heat-cell.h3 { background: rgba(255, 90, 31, .6); }
.heat-cell.l4, .heat-cell.h4 { background: var(--accent); }
[data-theme="dark"] .heat-cell.l2, [data-theme="dark"] .heat-cell.h2 { background: rgba(255, 107, 61, .38); }
[data-theme="dark"] .heat-cell.l3, [data-theme="dark"] .heat-cell.h3 { background: rgba(255, 107, 61, .66); }
.heat-cell.is-today { outline: 2px solid var(--accent); outline-offset: 1px; }
.heat-legend { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 11px; color: var(--ink-3); }
.heat-legend i { width: 10px; height: 10px; border-radius: 3px; }
.heat-legend .h0 { background: var(--bg-2); }
.heat-legend .h1 { background: var(--accent-soft); }
.heat-legend .h2 { background: rgba(255, 90, 31, .32); }
.heat-legend .h3 { background: rgba(255, 90, 31, .6); }
.heat-legend .h4 { background: var(--accent); }

.report-list { display: flex; flex-direction: column; }
.report-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
}
.report-row:first-child { border-top: none; padding-top: 0; }
.report-row span { color: var(--ink-3); }
.report-row b { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.report-card { padding: var(--pad-card); }

/* ============ 设置页 ============ */
.settings-grid { max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.settings-col { display: flex; flex-direction: column; gap: 16px; }
.group-label { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 6px 12px 0; }
.list-card { padding: 0; overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 13px; padding: 13px 16px; }
.row + .row::before {
  content: '';
  position: absolute; top: 0; left: 59px; right: 16px;
  height: 1px; background: var(--hairline);
}
.row-icon {
  width: 32px; height: 32px; flex: none;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.row-icon svg { width: 17px; height: 17px; }
.icon-blue { background: #ebf3ff; color: #3478f6; }
.icon-violet { background: #f3ebff; color: #af52de; }
.icon-teal { background: #e5f6fb; color: #32ade6; }
.icon-amber { background: var(--warn-soft); color: var(--warn); }
.icon-indigo { background: #ebecff; color: #5856d6; }
.icon-pink { background: #ffebf1; color: #ff2d78; }
.icon-red { background: var(--danger-soft); color: var(--danger); }
[data-theme="dark"] .icon-blue { background: rgba(52, 120, 246, .18); color: #6da4ff; }
[data-theme="dark"] .icon-violet { background: rgba(175, 82, 222, .18); color: #c98af0; }
[data-theme="dark"] .icon-teal { background: rgba(50, 173, 230, .18); color: #64c3ee; }
[data-theme="dark"] .icon-indigo { background: rgba(88, 86, 214, .18); color: #9391f0; }
[data-theme="dark"] .icon-pink { background: rgba(255, 45, 120, .18); color: #ff7aa8; }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 14px; font-weight: 600; }
.row-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

.backup-list { display: grid; gap: 8px; margin: 8px 16px 16px; }
.backup-item {
  width: 100%;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card-2);
  color: var(--ink);
  text-align: left;
}
.backup-item span {
  color: var(--ink-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.backup-item small {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.backup-item b { color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }
.backup-item:active { transform: scale(.99); }

/* 行内删除按钮：两次点击确认 */
.row-del {
  position: relative;
  width: 34px; height: 34px; flex: none;
  border-radius: 11px;
  background: var(--danger-soft);
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s, transform .15s var(--spring);
}
/* 视觉 34px，命中区补到 ~48px */
.row-del::after { content: ''; position: absolute; inset: -7px; border-radius: 16px; }
.row-del svg { width: 15px; height: 15px; }
.row-del:active { transform: scale(.88); }
.row-del.armed { background: var(--danger); color: #fff; }

/* 任务弹层底部删除按钮 */
.btn.btn-del { color: var(--danger); gap: 7px; }
.btn.btn-del.armed { background: var(--danger); color: #fff; }

.switch { position: relative; display: inline-block; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i {
  display: block;
  width: 50px; height: 30px;
  background: var(--bg-2);
  border-radius: 999px;
  position: relative;
  transition: background .25s var(--ease);
}
.switch i::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 26px; height: 26px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .25s var(--spring);
}
.switch.on i, .switch input:checked + i { background: var(--ok); }
.switch.on i::after, .switch input:checked + i::after { transform: translateX(20px); }

.mini-select {
  height: 32px;
  padding: 0 26px 0 12px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 12px; font-weight: 600;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23a3a3a8' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
[data-theme="dark"] .mini-select { background-color: var(--card-2); }
.mini-select option { background: var(--card); color: var(--ink); }

.about-card { padding: 26px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.about-logo { display: flex; margin-bottom: 14px; }
.about-logo svg {
  display: block;
  width: 64px; height: 64px;
  border-radius: 20px;
  box-shadow: 0 6px 16px rgba(255, 90, 31, .22);
}
.about-title { font-size: 16px; font-weight: 800; }
.about-sub { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.about-ver { font-size: 11px; color: var(--ink-3); margin-top: 12px; }
.about-hint { font-size: 11px; color: var(--ink-3); opacity: .6; margin-top: 2px; }

/* ============ 底部导航 ============ */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  height: calc(58px + var(--sab));
  padding: 0 6px var(--sab);
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  border-top: 1px solid var(--hairline);
  transition: transform .3s var(--ease);
}
[data-theme="dark"] .tabbar { background: rgba(24, 24, 28, .82); }
body.kb-open .tabbar { transform: translateY(105%); }
.tab-indicator { display: none; }
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: var(--ink-3);
  transition: color .2s, transform .15s var(--spring);
}
.tab:active { transform: scale(.92); }
.tab svg { width: 23px; height: 23px; }
.tab span { font-size: 10px; font-weight: 600; }
.tab.is-active { color: var(--accent); }


/* ============ 首页 · 进行中卡片里的「沉浸」开关 ============ */
.now-card .hero-guard { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.now-card .hero-guard .gdot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  transition: background .2s var(--ease), box-shadow .25s var(--ease);
}
.now-card .hero-guard.is-on { background: rgba(255, 255, 255, .3); }
.now-card .hero-guard.is-on .gdot { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .32); }
.now-actions { gap: 8px; }
.now-actions .btn { padding: 0 12px; font-size: 14px; }
@media (max-width: 400px) {
  .now-actions .btn { font-size: 13px; padding: 0 6px; }
}

/* ============ 极简专注界面 ============ */
.immerse {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  background: #14110E;
  color: #F6F2EA;
  opacity: 0; visibility: hidden;
  transition: opacity .34s var(--ease), visibility .34s;
}
.immerse.open { opacity: 1; visibility: visible; }

.im-glow {
  position: absolute; left: -10%; right: -10%; top: -18%; height: 66%;
  background: radial-gradient(ellipse 62% 70% at 50% 0%, rgba(255, 90, 31, .26), transparent 72%);
  opacity: 0; transition: opacity .9s var(--ease);
  pointer-events: none;
}
.immerse.open .im-glow { opacity: 1; }

.im-wrap {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 28px 7vh; text-align: center;   /* 略微上移，视觉重心落在黄金位置 */
  width: 100%; max-width: 620px;
}
.im-eyebrow {
  font-size: 11px; font-weight: 600;
  letter-spacing: .36em; text-transform: uppercase;
  color: rgba(246, 242, 234, .38);
}
.im-time {
  margin-top: 16px;
  font-size: clamp(84px, 21vw, 204px);
  font-weight: 800; line-height: .96;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  color: #FBF7F0;
}
.im-track {
  margin-top: 22px;
  width: min(300px, 58vw); height: 2px; border-radius: 2px;
  background: rgba(255, 255, 255, .13);
  overflow: hidden;
}
.im-track i {
  display: block; height: 100%; width: 0;
  background: var(--accent); border-radius: 2px;
  transition: width .95s linear;
}
.im-line {
  margin-top: 26px;
  font-size: 15px; line-height: 1.75;
  letter-spacing: .02em;
  color: rgba(246, 242, 234, .58);
  max-width: 21em;
  min-height: 3.5em;
}
.im-actions { display: flex; gap: 12px; margin-top: 34px; }
.im-btn {
  height: 46px; padding: 0 30px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600;
  transition: transform .16s var(--spring), background .2s, opacity .2s;
}
.im-btn:active { transform: scale(.96); }
.im-btn.ghost {
  background: rgba(255, 255, 255, .07);
  color: rgba(246, 242, 234, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13);
}
.im-task {
  margin-top: 24px; min-height: 1em;
  font-size: 12px; letter-spacing: .04em;
  color: rgba(246, 242, 234, .3);
}

/* 入场：逐层浮起 */
@keyframes imIn { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes imFade { from { opacity: 0; } to { opacity: 1; } }
.immerse.open .im-eyebrow { animation: imIn .62s var(--ease) both; }
.immerse.open .im-time { animation: imIn .72s var(--ease) both .05s; }
.immerse.open .im-track { animation: imFade .6s ease both .22s; }
.immerse.open .im-line { animation: imIn .62s var(--ease) both .26s; }
.immerse.open .im-actions { animation: imIn .62s var(--ease) both .36s; }
.immerse.open .im-task { animation: imFade .6s ease both .44s; }

body:not(.motion) .immerse * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .immerse * { animation: none !important; } }

@media (max-width: 520px) {
  .im-line { font-size: 14px; margin-top: 22px; }
  .im-actions { margin-top: 28px; }
  .im-btn { padding: 0 24px; height: 44px; }
}

/* ============ 退出专注 / 单任务完成 ============ */
.pomo-exit, .task-complete {
  position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(12, 10, 9, .62); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s;
}
.pomo-exit.open, .task-complete.open { opacity: 1; visibility: visible; }
.pomo-exit-card, .task-complete-card {
  width: min(390px, 100%); padding: 25px 22px 20px; border-radius: 24px; background: var(--card); color: var(--ink);
  box-shadow: 0 26px 70px rgba(0,0,0,.3); text-align: center; transform: translateY(18px) scale(.97); transition: transform .34s var(--spring);
}
.pomo-exit.open .pomo-exit-card, .task-complete.open .task-complete-card { transform: none; }
.pomo-exit-mark { width: 50px; height: 50px; margin: 0 auto 14px; display:flex; align-items:center; justify-content:center; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.pomo-exit-mark svg { width: 25px; height: 25px; }
.pomo-exit-kicker, .task-complete-kicker { font-size: 10px; font-weight: 800; letter-spacing: .13em; color: var(--ink-3); }
.pomo-exit-card h2, .task-complete-card h2 { margin: 7px 0 6px; font-size: 21px; font-weight: 800; }
.pomo-exit-card p, .task-complete-card p { margin: 0; color: var(--ink-3); font-size: 12px; line-height: 1.65; }
.pomo-exit-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.pomo-exit-actions .btn { height: 44px; }
.task-complete { z-index: 145; background: rgba(21, 30, 25, .38); }
.task-complete-card { border: 1px solid rgba(52, 199, 89, .18); }
.task-complete-icon { width: 52px; height: 52px; margin: 0 auto 14px; display:flex; align-items:center; justify-content:center; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.task-complete-icon svg { width: 28px; height: 28px; }
.task-complete-kicker { color: var(--ok); }
.task-complete-time { margin: 15px 0 6px; font-size: 18px; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; }
.task-complete-card .btn { width: 100%; height: 44px; margin-top: 16px; background: var(--ok); box-shadow: 0 6px 16px rgba(52, 199, 89, .25); }
.plan-choice-list { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.plan-choice { display:flex; align-items:center; gap: 12px; width:100%; padding: 13px 12px; border-radius: var(--r-card); background: var(--bg-2); color:var(--ink); text-align:left; }
.plan-choice:active { transform: scale(.985); }
.plan-choice-icon { width: 36px; height: 36px; flex:none; display:flex; align-items:center; justify-content:center; border-radius: 11px; background:var(--accent-soft); color:var(--accent); font-weight:800; }
.plan-choice span:nth-child(2) { flex:1; min-width:0; }
.plan-choice b, .plan-choice small { display:block; }
.plan-choice b { font-size: 14px; }
.plan-choice small { margin-top: 3px; color:var(--ink-3); font-size:11px; }
.plan-choice i { color:var(--ink-3); font-size:24px; font-style:normal; }

/* ============ 弹层 ============ */
.sheet-layer { position: fixed; inset: 0; z-index: 80; visibility: hidden; }
.sheet-layer.open { visibility: visible; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 15, 18, .45);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.sheet-layer.open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 88%;
  overflow-y: auto;
  padding: 8px 22px calc(var(--sab) + 24px + var(--kb));
  background: var(--card);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(104%);
  transition: transform .42s var(--spring);
  scrollbar-width: none;
}
.sheet-panel::-webkit-scrollbar { display: none; }
.sheet-layer.open .sheet-panel { transform: none; }
body:not(.motion) .sheet-panel, body:not(.motion) .sheet-backdrop { transition: none; }

.sheet-grabber { width: 38px; height: 5px; border-radius: 999px; background: var(--bg-2); margin: 6px auto 16px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.sheet-eyebrow { font-size: 12px; font-weight: 700; color: var(--accent); }
.sheet-title { margin: 5px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.sheet-meta { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.sheet-close {
  position: relative;
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s var(--spring);
}
.sheet-close::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; }
.sheet-close:active { transform: scale(.9); }
.sheet-close svg { width: 13px; height: 13px; }

.sheet-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--bg-2);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
}
[data-theme="dark"] .sheet-note { background: var(--card-2); }

.sheet-stats { display: flex; gap: 8px; margin-top: 16px; }
.sheet-stat {
  flex: 1;
  padding: 12px 8px;
  border-radius: var(--r);
  background: var(--bg-2);
  text-align: center;
}
[data-theme="dark"] .sheet-stat { background: var(--card-2); }
.sheet-stat q { display: block; quotes: none; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.sheet-stat q::before, .sheet-stat q::after { content: none; }
.sheet-stat b { display: block; font-size: 16px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }

.focus-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--r-card);
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
[data-theme="dark"] .focus-panel { background: var(--card-2); }
.focus-time { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.focus-label { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.focus-btns { display: flex; gap: 8px; }
.focus-btns .btn { height: 40px; padding: 0 16px; font-size: 13px; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.action {
  min-height: 52px;
  padding: 10px 8px;
  border-radius: var(--r);
  background: var(--bg-2);
  font-size: 12px; font-weight: 700;
  color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  transition: transform .15s var(--spring);
}
.action:active { transform: scale(.96); }
[data-theme="dark"] .action { background: var(--card-2); }
.action svg { width: 19px; height: 19px; color: var(--ink-2); }
.action.warn { background: var(--warn-soft); color: #b97406; }
.action.warn svg { color: var(--warn); }
[data-theme="dark"] .action.warn { color: var(--warn); }
.action.ok { background: var(--ok-soft); color: var(--ok); }
.action.ok svg { color: var(--ok); }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet-actions .btn { flex: 1; }

/* ============ 表单 ============ */
.form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.field {
  padding: 9px 14px;
  border-radius: var(--r);
  background: var(--bg-2);
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
[data-theme="dark"] .field { background: var(--card-2); }
.field label { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.field input, .field textarea, .field select { font-size: 15px; padding: 2px 0; width: 100%; }
.field textarea { min-height: 60px; resize: none; line-height: 1.6; }
.field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23a3a3a8' stroke-width='1.6' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 2px center;
}
.field select option { background: var(--card); color: var(--ink); }

.toggle-row {
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 600;
}
[data-theme="dark"] .toggle-row { background: var(--card-2); }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--sab) + 84px);
  transform: translateX(-50%) translateY(14px);
  z-index: 90;
  max-width: 82%;
  padding: 12px 22px;
  background: rgba(28, 28, 32, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 13px; font-weight: 600;
  text-align: center;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s, transform .28s var(--spring);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   响应式
   ========================================================= */
@media (min-width: 640px) {
  .scroll { padding-left: 26px; padding-right: 26px; }
  .action-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-hero { grid-template-columns: repeat(4, 1fr); }
  .stat-block { border-bottom: none; border-right: none; border-left: 1px solid var(--hairline); }
  .stat-block:first-child { border-left: none; }
}

@media (min-width: 760px) and (min-height: 600px) {
  :root { --pad-card: 22px; --gap-card: 20px; }
  .scroll { padding: calc(var(--sat) + 28px) 36px calc(var(--sab) + 128px); }
  .home-grid {
    display: grid;
    grid-template-columns: 1fr 1.06fr;
    grid-template-areas: "main exam" "main side";
    gap: var(--gap-card);
    align-items: start;
  }
  .home-main { grid-area: main; }
  .exam-banner { grid-area: exam; }
  .home-side { grid-area: side; }
  .home-grid:has(> .exam-banner[hidden]) { grid-template-areas: "main side"; }
  .focus-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 20px; align-items: start; }
  .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .calendar-card, .stat-hero, .goal-card, .stats-grid [data-detail="daily"], .stats-grid [data-detail="category"], .report-card, .stats-section-label { grid-column: span 2; }
  /* 平板/大屏空间充足：与 JS 的 760px 阈值保持一致，日历直接展开 */
  .calendar-card.is-collapsed { display: block; }
  .stats-month-toggle { cursor: default; }
  .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  .tabbar {
    left: 50%; right: auto; bottom: calc(var(--sab) + 22px);
    transform: translateX(-50%);
    width: 460px;
    height: 58px;
    padding: 0 4px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    box-shadow: var(--shadow-lg);
  }
  body.kb-open .tabbar { transform: translateX(-50%) translateY(160%); }
  .sheet-panel {
    left: 50%; right: auto;
    width: 560px;
    bottom: auto; top: 50%;
    max-height: 84%;
    transform: translate(-50%, -47%);
    border-radius: 26px;
    opacity: 0;
    transition: transform .38s var(--spring), opacity .3s;
  }
  .sheet-layer.open .sheet-panel { transform: translate(-50%, -50%); opacity: 1; }
}

@media (min-width: 900px) {
  .scroll { padding-left: 44px; padding-right: 44px; }
  .stats-grid { grid-template-columns: repeat(6, 1fr); }
  .calendar-card, .stat-hero, .stats-section-label { grid-column: span 6; }
  .goal-card, .stats-grid [data-detail="daily"], .stats-grid [data-detail="category"], .report-card { grid-column: span 3; }
  .sheet-panel { width: 640px; }
}

@media (min-width: 1200px) {
  .home-grid, .focus-grid { gap: 28px; }
  .stats-grid, .settings-grid { gap: 24px; }
}

@media (min-width: 760px) and (min-height: 900px) {
  html, body { font-size: 15px; }
  .ring-wrap { width: 120px; height: 120px; }
  .ring-center b { font-size: 32px; }
  .progress-meta .big { font-size: 58px; }
  .now-title { font-size: 30px; }
  .now-timer b { font-size: 48px; }
  .tl-item { padding: 18px 20px; }
  .tl-title { font-size: 15px; }
  .pomo-ring-wrap { width: 264px; height: 264px; }
  .stat-block .v { font-size: 38px; }
  .bars { height: 168px; }
  .chart-card { padding: 26px; }
}

@media (min-width: 900px) and (max-height: 860px) {
  .scroll { padding-top: calc(var(--sat) + 14px); }
  .date-line { margin-top: 14px; }
  .progress-card { padding: 18px; }
  .pomo-ring-wrap { width: 194px; height: 194px; margin: 20px 0 8px; }
  .bars { height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ 账户与头像 ============ */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
}
.profile-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.profile-mail {
  font-size: 12px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-phone { font-size: 11px; color: var(--ink-3); }

.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  user-select: none;
}
.avatar-lg { width: 52px; height: 52px; font-size: 20px; box-shadow: 0 4px 14px rgba(28, 28, 32, .12); }
.avatar-dashed {
  background: var(--bg-2) !important;
  color: var(--ink-3);
  border: 1.5px dashed var(--ink-3);
}
.avatar-dashed svg { width: 26px; height: 26px; }

.avatar-section { margin-top: 16px; }
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.avatar-opt {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s var(--spring);
}
.avatar-opt:active { transform: scale(.88); }
.avatar-opt.is-picked { box-shadow: 0 0 0 3px var(--card), 0 0 0 5.5px var(--accent); }
.avatar-opt svg { width: 55%; height: 55%; }

/* 登录表单 */
.field-row { flex-direction: row; align-items: center; gap: 10px; padding: 12px 14px; }
.field-row input { flex: 1; font-size: 15px; }
.field-row .pill-btn.cool {
  background: var(--bg);
  color: var(--ink-3);
  pointer-events: none;
  min-width: 76px;
  text-align: center;
}
.auth-hint {
  margin-top: 4px;
  padding: 11px 14px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.55;
}

/* ============ 极度沉浸 ============ */
.guard-row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  max-width: 400px;
  margin: 4px 0 18px;
  padding: 11px 15px;
  border-radius: var(--r);
  background: var(--bg-2);
  text-align: left;
}
[data-theme="dark"] .guard-row { background: var(--card-2); }
.guard-ico {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.guard-ico svg { width: 19px; height: 19px; }
.guard-row .row-title { font-size: 13.5px; font-weight: 700; }
.guard-row .row-sub { font-size: 11px; }

/* ============ 卡片详情 · 自定义头像 ============ */
.tap-card { cursor: pointer; position: relative; }
.tap-card:active { transform: scale(.994); }
.tap-card::after {
  content: '';
  position: absolute;
  right: 16px;
  bottom: 10px;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
  opacity: .32;
  transition: opacity .2s var(--ease);
  pointer-events: none;
}
.tap-card:active::after { opacity: .7; }
/* 概览卡是 4 格数据平铺，右下角没有“详情”语义，不画箭头 */
.stat-hero.tap-card::after, .stat-hero .tap-card::after { content: none; }

.detail-wrap { padding-top: 4px; }
.detail-table { display: flex; flex-direction: column; }
.detail-row {
  display: grid;
  grid-template-columns: 1.5fr .8fr .8fr .9fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.detail-row:last-child { border-bottom: none; }
.detail-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-head {
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--hairline);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.detail-row .d-day { color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.detail-row .d-v { color: var(--ink-2); text-align: right; }
.detail-row .d-strong { color: var(--ink); font-weight: 700; text-align: right; }
.detail-head .d-v, .detail-head .d-strong { color: var(--ink-3); font-weight: 700; }
.d-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; display: inline-block; }
.detail-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--bg-2);
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.7;
}
[data-theme="dark"] .detail-note { background: var(--card-2); }

.avatar-photo { padding: 0; overflow: hidden; background: var(--bg-2); }
.avatar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-custom { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.avatar-custom .avatar-lg { width: 62px; height: 62px; font-size: 24px; flex: none; }
.avatar-custom-btns { display: flex; flex-direction: column; gap: 8px; }

/* ============ 倒计时 / 遗留 / 复盘 / 目标 ============ */
.exam-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 16px var(--pad-card);
  cursor: pointer;
  text-align: left;
  background: var(--card);
}
.exam-banner .eb-main { flex: 1; min-width: 0; }
.exam-banner .eb-title { margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.exam-banner .eb-days { display: flex; align-items: baseline; gap: 4px; color: var(--accent); }
.exam-banner .eb-days b {
  font-size: clamp(38px, 8.5vw, 54px); font-weight: 800;
  line-height: .9; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.exam-banner .eb-days span { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.exam-banner .eb-date { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.leftover-row {
  display: flex; align-items: center; gap: 8px;
  width: calc(100% - 2 * var(--pad-card));
  margin: 0 var(--pad-card) 10px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--warn-soft);
  color: #b97406;
  font-size: 12.5px; font-weight: 600;
  text-align: left;
}
.leftover-row b { font-weight: 800; }
.leftover-row .lb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); flex: none; }
.leftover-row span:last-child { margin-left: auto; font-weight: 700; }
[data-theme="dark"] .leftover-row { color: var(--warn); }

.review-bar {
  display: flex; align-items: center; gap: 10px;
  width: calc(100% - 2 * var(--pad-card));
  margin: 0 var(--pad-card) 6px;
  padding: 11px 12px;
  border-radius: var(--r);
  background: var(--bg-2);
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-2);
}
[data-theme="dark"] .review-bar { background: var(--card-2); }
.review-bar .rv-label { flex: none; font-weight: 700; color: var(--ink-2); }
.review-bar .rv-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-bar .rv-go { flex: none; color: var(--accent); font-weight: 700; }
.review-bar.is-done { background: var(--accent-soft); }
.review-bar.is-done .rv-label,
.review-bar.is-done .rv-text { color: var(--accent-deep); }

.stats-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 24px; }
.stats-tools .range-seg { margin: 0; }

.goal-card { padding: var(--pad-card); }
.goal-numbers { display: flex; align-items: baseline; gap: 8px; }
.goal-numbers b { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.goal-numbers span { font-size: 12px; color: var(--ink-3); }
.goal-numbers i { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); }
.goal-track { margin-top: 10px; height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.goal-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .7s var(--ease); }
.goal-empty { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; }
.ms-wrap { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.ms-chip {
  padding: 5px 10px; border-radius: 999px;
  background: var(--bg-2); color: var(--ink-3);
  font-size: 11px; font-weight: 600;
}
.ms-chip.on { background: var(--accent-soft); color: var(--accent-deep); }
.goal-note { margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }

/* ============ 打卡日历 ============ */
.calendar-card { padding: var(--pad-card); }
.cal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cal-layout { display: flex; align-items: stretch; gap: 24px; }
.cal-main { flex: 0 1 500px; min-width: 0; }
.cal-side {
  flex: 1; min-width: 190px;
  border-left: 1px solid var(--hairline);
  padding-left: 24px;
  display: flex; flex-direction: column; justify-content: center;
}
.cal-side-title { margin-bottom: 14px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cal-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.cal-stat b { display: block; font-size: 27px; line-height: 1.05; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.cal-stat span { display: block; margin-top: 4px; font-size: 11px; color: var(--ink-3); }
.cal-nav { display: flex; gap: 6px; }
.cal-btn {
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--bg-2); color: var(--ink-2);
  font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .cal-btn { background: var(--card-2); }
.cal-btn:disabled { opacity: .35; }
.cal-month { margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dows { margin-bottom: 5px; }
.cal-dow { text-align: center; font-size: 10px; font-weight: 600; color: var(--ink-3); }
.cal-day {
  position: relative;
  aspect-ratio: 1;
  border-radius: 9px;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .cal-day { background: var(--card-2); }
.cal-day.out { background: transparent; }
.cal-day.future { opacity: .38; }
.cal-day.l1 { background: var(--accent-soft); }
.cal-day.l2 { background: rgba(255, 90, 31, .28); }
.cal-day.l3 { background: rgba(255, 90, 31, .58); color: #fff; }
.cal-day.l4 { background: var(--accent); color: #fff; }
.cal-day.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-day.checked::after {
  content: ''; position: absolute; bottom: 4px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
}
.cal-day.l3.checked::after, .cal-day.l4.checked::after { background: #fff; }
.cal-legend { display: flex; align-items: center; gap: 5px; margin-top: 16px; font-size: 10.5px; color: var(--ink-3); }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--bg-2); }
.cal-legend i.h1 { background: var(--accent-soft); }
.cal-legend i.h2 { background: rgba(255, 90, 31, .28); }
.cal-legend i.h3 { background: rgba(255, 90, 31, .58); }
.cal-legend i.h4 { background: var(--accent); }
.cal-tip { margin-top: 8px; font-size: 10.5px; color: var(--ink-3); }

@media (min-width: 760px) and (max-width: 899px) {
  .cal-layout { gap: 18px; }
  .cal-main { flex-basis: 420px; }
  .cal-side { min-width: 160px; padding-left: 18px; }
  .cal-stat b { font-size: 23px; }
}

@media (max-width: 759px) {
  .cal-layout { flex-direction: column; gap: 14px; }
  .cal-main { flex: auto; max-width: none; }
  .cal-side { flex: auto; min-width: 0; border-left: 0; border-top: 1px solid var(--hairline); padding: 14px 0 0; }
  .cal-side-title { margin-bottom: 10px; }
  .cal-summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .cal-stat b { font-size: 18px; }
  .cal-stat span { font-size: 10px; }
  .cal-legend { margin-top: 10px; }
}

.weekly-text {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: var(--r);
  background: var(--bg-2);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-2);
}
[data-theme="dark"] .weekly-text { background: var(--card-2); }

/* ============ 每日打卡动效 ============ */
.celebrate {
  position: fixed; inset: 0; z-index: 130;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(12, 10, 9, .58);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s;
  overflow: hidden;
}
.celebrate.open { opacity: 1; visibility: visible; }

.cb-glow {
  position: absolute;
  width: min(520px, 120vw); height: min(520px, 120vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 90, 31, .5), transparent 68%);
  filter: blur(6px);
  opacity: 0; transform: scale(.6);
  transition: opacity .7s var(--ease), transform 1.1s var(--ease);
  pointer-events: none;
}
.celebrate.open .cb-glow { opacity: 1; transform: scale(1); }

.cb-card {
  position: relative; z-index: 1;
  width: min(360px, 100%);
  padding: 26px 22px 20px;
  border-radius: 30px;
  background: var(--card);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  transform: translateY(26px) scale(.92);
  opacity: 0;
  transition: transform .55s var(--spring), opacity .35s var(--ease);
}
.celebrate.open .cb-card { transform: none; opacity: 1; }

.cb-ring { position: relative; width: 108px; height: 108px; margin: 2px auto 12px; }
.cb-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cb-ring-svg { transform: rotate(-90deg); }
.cb-track { fill: none; stroke: var(--bg-2); stroke-width: 9; }
.cb-fill {
  fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset 1s var(--ease) .12s;
}
.celebrate.open .cb-fill { stroke-dashoffset: 0; }
.cb-check path {
  fill: none; stroke: var(--accent); stroke-width: 7;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset .42s var(--ease) .92s;
}
.celebrate.open .cb-check path { stroke-dashoffset: 0; }

.cb-seal {
  position: absolute; right: 18px; top: 18px;
  width: 60px; height: 60px; border-radius: 50%;
  border: 2px dashed rgba(255, 90, 31, .55);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; line-height: 1.15; letter-spacing: .06em;
  transform: rotate(-12deg) scale(1.7);
  opacity: 0;
  transition: transform .42s var(--spring) .72s, opacity .3s .72s;
}
.celebrate.open .cb-seal { opacity: 1; transform: rotate(-12deg) scale(1); }

.cb-eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  color: var(--ink-3);
}
.cb-title { margin: 6px 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.cb-stats {
  display: flex;
  margin: 16px 0 12px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.cb-stats div { flex: 1; min-width: 0; }
.cb-stats b { display: block; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cb-stats i { display: block; margin-top: 2px; font-style: normal; font-size: 10.5px; color: var(--ink-3); }
.cb-note { margin-bottom: 14px; font-size: 11.5px; color: var(--ink-3); }
.cb-actions { display: flex; gap: 10px; }
.cb-actions .btn { flex: 1; height: 44px; font-size: 14px; }

.cb-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cb-confetti i {
  position: absolute; top: -8%;
  left: var(--x);
  width: var(--w); height: var(--h);
  background: var(--c);
  border-radius: 1px;
  opacity: 0;
  animation: confettiFall var(--d) linear var(--delay) forwards;
}
@keyframes confettiFall {
  0% { opacity: 0; transform: translate3d(0, -6vh, 0) rotate(var(--rot)); }
  8% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(-2vw, 110vh, 0) rotate(calc(var(--rot) + 680deg)); }
}

body:not(.motion) .celebrate * { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .celebrate * { animation: none !important; transition: none !important; }
}


