/* =====================================================================
   练记 FitLog · 样式
   深色、单手可操作、iPhone 优先（安全区 / 44px 触控目标 / 16px 输入）
   ===================================================================== */

:root {
  color-scheme: dark;
  --bg: #0b0f13;
  --bg-soft: #0f151a;
  --card: #151c22;
  --card-2: #1b242c;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --txt: #eaf0f4;
  --muted: #94a2ad;
  --dim: #6b7883;
  --lime: #c9f75a;
  --lime-ink: #10180a;
  --mint: #5eead4;
  --amber: #fbbf24;
  --blue: #60a5fa;
  --rose: #fb7185;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(201, 247, 90, .10), transparent 60%),
    radial-gradient(80% 40% at 100% 0%, rgba(96, 165, 250, .08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 16px;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.1em; }
svg { display: block; }

.app { min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(var(--safe-top) + 14px) 18px 12px;
  background: rgba(11, 15, 19, .97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .045);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.topbar .hello { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.topbar .sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.topbar .week-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(201, 247, 90, .12);
  color: var(--lime);
  border: 1px solid rgba(201, 247, 90, .28);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------------- 主体 ---------------- */
.main { flex: 1; padding: 4px 16px calc(104px + var(--safe-bottom)); }
.view { display: flex; flex-direction: column; gap: 14px; animation: fade .18s ease; }
.view[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0)) , var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
}
.card.flush { padding: 0; overflow: hidden; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-hd h2 { font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.card-hd .hint { font-size: 12px; color: var(--dim); }
.section-title { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .08em; padding: 6px 2px 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; line-height: 1.6; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  background: var(--card-2);
  color: var(--txt);
  border: 1px solid var(--line);
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--lime); color: var(--lime-ink); border-color: transparent; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--txt); }
.btn-danger { background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .4); color: var(--rose); }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.icon-btn:active { background: rgba(255, 255, 255, .1); }

.chip {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip-strong { color: var(--lime-ink); background: var(--lime); border-color: transparent; }
.chip.on { color: var(--lime); border-color: rgba(201, 247, 90, .45); background: rgba(201, 247, 90, .1); }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
}
.tag-lime { background: rgba(201, 247, 90, .14); color: var(--lime); }
.tag-blue { background: rgba(96, 165, 250, .14); color: var(--blue); }
.tag-amber { background: rgba(251, 191, 36, .14); color: var(--amber); }
.tag-mint { background: rgba(94, 234, 212, .14); color: var(--mint); }
.tag-rose { background: rgba(251, 113, 133, .14); color: var(--rose); }

/* ---------------- 今日 ---------------- */
.today-card { position: relative; overflow: hidden; padding: 0; }
.today-card .glow {
  position: absolute; inset: -40% -30% auto auto; width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(201, 247, 90, .22), transparent 65%);
  pointer-events: none;
}
.today-inner { position: relative; padding: 18px 18px 16px; }
.today-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.today-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.today-focus { font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.55; }
.today-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.ex-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.ex-chip { font-size: 12px; color: var(--muted); padding: 5px 9px; border-radius: 8px; background: rgba(255, 255, 255, .05); }
.ex-chip b { color: var(--txt); font-weight: 600; }

.today-foot { padding: 0 18px 18px; display: flex; gap: 10px; }

.rest-card { text-align: left; }
.rest-emoji { font-size: 30px; }

/* 本周横条 */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-cell { text-align: center; padding: 8px 0; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid transparent; }
.day-cell .wd { font-size: 11px; color: var(--dim); }
.day-cell .dot { width: 8px; height: 8px; border-radius: 50%; margin: 8px auto 0; background: rgba(255, 255, 255, .14); }
.day-cell.is-today { border-color: rgba(201, 247, 90, .5); background: rgba(201, 247, 90, .07); }
.day-cell.is-today .wd { color: var(--lime); }
.day-cell.done .dot { background: var(--lime); box-shadow: 0 0 10px rgba(201, 247, 90, .6); }
.day-cell.plan .dot { background: rgba(201, 247, 90, .45); }
.day-cell.miss .dot { background: rgba(251, 113, 133, .6); }
.day-cell .lbl { font-size: 10px; color: var(--dim); margin-top: 4px; height: 12px; }

/* 每日打卡 */
.habit-grid { display: flex; flex-direction: column; gap: 8px; }
.habit {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line);
  text-align: left;
}
.habit .hb-icon { font-size: 19px; width: 24px; text-align: center; flex: none; }
.habit .hb-txt { flex: 1; min-width: 0; }
.habit .hb-txt b { display: block; font-size: 14px; font-weight: 600; }
.habit .hb-txt span { font-size: 11px; color: var(--dim); }
.habit .hb-check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.habit.on { border-color: rgba(201, 247, 90, .4); background: rgba(201, 247, 90, .08); }
.habit.on .hb-check { background: var(--lime); border-color: var(--lime); }
.habit.on .hb-check svg { stroke: var(--lime-ink); }
.habit .hb-check svg { width: 13px; height: 13px; stroke: transparent; stroke-width: 3; fill: none; }

/* ---------------- 计划 ---------------- */
.phase-card { position: relative; overflow: hidden; }
.phase-card .ph-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.phase-card h3 { font-size: 18px; font-weight: 800; }
.phase-card .ph-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.phase-card .ph-intro { font-size: 13px; line-height: 1.7; color: var(--muted); margin-top: 10px; }
.phase-rules { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.phase-rules li { font-size: 13px; line-height: 1.6; color: var(--muted); }
.phase-rules li::marker { color: var(--lime); }

.week-list { display: flex; flex-direction: column; }
.week-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.week-row:last-child { border-bottom: 0; }
.week-row .wk-n { width: 34px; font-size: 13px; font-weight: 800; color: var(--dim); flex: none; font-variant-numeric: tabular-nums; }
.week-row .wk-main { flex: 1; min-width: 0; }
.week-row .wk-main b { font-size: 15px; font-weight: 600; display: block; }
.week-row .wk-main span { font-size: 12px; color: var(--dim); }
.week-row.cur { background: rgba(201, 247, 90, .06); }
.week-row.cur .wk-n { color: var(--lime); }

.session-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .035); border: 1px solid var(--line); width: 100%; text-align: left; }
.session-card .s-badge { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 15px; background: rgba(201, 247, 90, .12); color: var(--lime); }
.session-card .s-main { flex: 1; min-width: 0; }
.session-card .s-main b { font-size: 15.5px; display: block; }
.session-card .s-main span { font-size: 12.5px; color: var(--dim); display: block; margin-top: 3px; line-height: 1.5; }

/* 动作库 */
.ex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ex-tile { text-align: left; padding: 13px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); }
.ex-tile b { display: block; font-size: 14.5px; font-weight: 600; }
.ex-tile span { display: block; margin-top: 5px; font-size: 11.5px; color: var(--dim); }

/* 训练日列表 */
.day-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-bottom: 1px solid var(--line); }
.day-row:last-child { border-bottom: 0; }
.day-row .d-wd { width: 46px; flex: none; font-size: 12.5px; color: var(--lime); font-weight: 700; }
.day-row .d-main { flex: 1; min-width: 0; }
.day-row .d-main b { display: block; font-size: 15px; }
.day-row .d-main span { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }
.chev { width: 16px; height: 16px; flex: none; stroke: var(--dim); stroke-width: 2; fill: none; }

/* ---------------- 记录 ---------------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { padding: 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .035); border: 1px solid var(--line); }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--dim); margin-top: 4px; }
.stat .u { font-size: 12px; color: var(--dim); font-weight: 600; margin-left: 3px; }

.chart { width: 100%; height: 120px; display: block; overflow: visible; }
.chart text { fill: var(--dim); font-size: 9px; }
.chart .grid-line { stroke: rgba(255, 255, 255, .06); stroke-width: 1; }
.chart .bar { fill: rgba(201, 247, 90, .28); }
.chart .bar.on { fill: var(--lime); }
.chart .line { fill: none; stroke: var(--lime); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: rgba(201, 247, 90, .1); }
.chart .pt { fill: var(--bg); stroke: var(--lime); stroke-width: 2; }

.log-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.log-row:last-child { border-bottom: 0; }
.log-row .l-date { width: 52px; flex: none; text-align: center; }
.log-row .l-date b { display: block; font-size: 17px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.log-row .l-date span { font-size: 10.5px; color: var(--dim); }
.log-row .l-main { flex: 1; min-width: 0; }
.log-row .l-main b { display: block; font-size: 14.5px; font-weight: 600; }
.log-row .l-main span { display: block; font-size: 11.5px; color: var(--dim); margin-top: 2px; }

.empty { padding: 26px 16px; text-align: center; color: var(--dim); font-size: 13px; line-height: 1.7; }

/* ---------------- 我的 ---------------- */
.profile-card { display: flex; align-items: center; gap: 14px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: linear-gradient(135deg, rgba(201, 247, 90, .9), rgba(94, 234, 212, .8)); color: #10180a; font-weight: 800; flex: none; }
.profile-main b { font-size: 18px; font-weight: 700; display: block; }
.profile-main span { display: block; font-size: 12.5px; color: var(--dim); margin-top: 3px; }

.set-row-list { display: flex; flex-direction: column; }
.set-row-list.pad { padding: 0 16px; }
.set-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.set-item:last-child { border-bottom: 0; }
.set-item .si-main { flex: 1; min-width: 0; }
.set-item .si-main b { display: block; font-size: 15px; font-weight: 600; }
.set-item .si-main span { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }
.set-item .si-val { font-size: 13px; color: var(--muted); }
.seg { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.seg button { flex: 1; min-height: 36px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--lime); color: var(--lime-ink); }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: rgba(13, 18, 22, .88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; color: var(--dim); font-size: 10.5px; font-weight: 600; border-radius: 12px; }
.tab svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--lime); }

/* ---------------- 训练全屏 ---------------- */
.screen {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: var(--bg);
  padding-top: var(--safe-top);
}
.screen[hidden] { display: none; }
.wk-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 8px; }
.wk-title { flex: 1; min-width: 0; }
.wk-title strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.wk-title span { display: block; font-size: 11.5px; color: var(--dim); margin-top: 1px; }
.wk-clock { font-size: 15px; font-weight: 700; color: var(--lime); font-variant-numeric: tabular-nums; padding: 6px 10px; border-radius: 10px; background: rgba(201, 247, 90, .1); }
.wk-progress { display: flex; align-items: center; gap: 10px; padding: 4px 16px 10px; }
.wk-progress .bar { flex: 1; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.wk-progress .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--lime)); transition: width .25s ease; }
.wk-progress span { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.wk-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px 24px; display: flex; flex-direction: column; gap: 12px; }

.ex-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.ex-card.cur { border-color: rgba(201, 247, 90, .35); box-shadow: 0 0 0 3px rgba(201, 247, 90, .06); }
.ex-card-hd { display: flex; align-items: center; gap: 10px; }
.ex-idx { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: rgba(255, 255, 255, .07); color: var(--muted); }
.ex-card.cur .ex-idx { background: var(--lime); color: var(--lime-ink); }
.ex-name { flex: 1; min-width: 0; }
.ex-name b { display: block; font-size: 15.5px; font-weight: 700; }
.ex-name span { display: block; font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.ex-go { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.ex-go svg { width: 15px; height: 15px; stroke: var(--muted); stroke-width: 2.4; fill: none; }
.ex-note { font-size: 11.5px; color: var(--dim); line-height: 1.55; margin: 8px 0 2px; padding-left: 36px; }
.ex-last { font-size: 11.5px; color: var(--mint); margin: 0 0 8px; padding-left: 36px; }
.set-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 12px minmax(0, 1fr) 44px; align-items: center; gap: 6px; margin-top: 8px; }
.set-row.no-load { grid-template-columns: 30px minmax(0, 1fr) 44px; }
.set-no { font-size: 12px; color: var(--dim); font-weight: 700; font-variant-numeric: tabular-nums; }
.field { position: relative; }
.field input {
  width: 100%; height: 44px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04); text-align: center; font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums; padding: 0 24px 0 8px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.field input:focus { border-color: rgba(201, 247, 90, .6); background: rgba(201, 247, 90, .06); }
.field .u { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--dim); pointer-events: none; }
.set-x { font-size: 11px; color: var(--dim); text-align: center; }
.set-check { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.set-check svg { width: 17px; height: 17px; stroke: var(--dim); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.set-row.done .field input { color: var(--lime); border-color: rgba(201, 247, 90, .35); background: rgba(201, 247, 90, .08); }
.set-row.done .set-check { background: var(--lime); border-color: var(--lime); }
.set-row.done .set-check svg { stroke: var(--lime-ink); }
.ex-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-left: 30px; }
.link-btn { font-size: 12.5px; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 6px 0; }

.wk-foot {
  display: flex; gap: 10px; padding: 10px 16px calc(10px + var(--safe-bottom));
  background: rgba(11, 15, 19, .94); border-top: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.wk-foot .btn { flex: 1; }
.wk-foot .btn-ghost { flex: 0 0 auto; padding: 0 16px; }

/* 休息计时条 */
.restbar {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(86px + var(--safe-bottom)); z-index: 70;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 18px;
  background: rgba(24, 32, 39, .96);
  border: 1px solid rgba(201, 247, 90, .3);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: rise .2s ease;
}
.restbar[hidden] { display: none; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.rest-time { font-size: 26px; font-weight: 800; color: var(--lime); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rest-label { flex: 1; font-size: 11px; color: var(--dim); line-height: 1.4; }
.rest-actions { display: flex; gap: 6px; }
.rest-actions .chip { min-height: 32px; padding: 0 10px; font-size: 12px; }
.restbar.done { border-color: var(--mint); }
.restbar.done .rest-time { color: var(--mint); }

/* ---------------- 弹层 ---------------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 80; }
.sheet-wrap[hidden] { display: none; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .2s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 88vh; display: flex; flex-direction: column;
  background: #12181e; border-radius: 26px 26px 0 0;
  border-top: 1px solid var(--line-strong);
  padding-bottom: var(--safe-bottom);
  animation: slideUp .26s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 38px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .16); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 6px; }
.sheet-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 16px 24px; }

.modal-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; }
.modal-wrap[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); backdrop-filter: blur(3px); }
.modal { position: relative; width: 100%; max-width: 320px; background: #171f26; border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 17px; font-weight: 800; }
.modal p { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin-top: 8px; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions .btn { flex: 1; min-height: 44px; font-size: 15px; }

.toast {
  position: fixed; left: 50%; bottom: calc(120px + var(--safe-bottom)); transform: translateX(-50%);
  z-index: 100; max-width: 82vw; padding: 11px 16px; border-radius: 12px;
  background: rgba(234, 240, 244, .96); color: #0b0f13; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); animation: rise .18s ease; text-align: center;
}
.toast[hidden] { display: none; }

/* ---------------- 内容排版 ---------------- */
.prose { font-size: 14px; line-height: 1.75; color: #c8d3db; }
.prose p { margin: 10px 0; }
.prose ul, .prose ol { margin: 8px 0; padding-left: 1.25em; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--lime); }
.prose b { color: var(--txt); }
.callout { margin: 12px 0; padding: 12px 14px; border-radius: 14px; background: rgba(201, 247, 90, .08); border: 1px solid rgba(201, 247, 90, .22); font-size: 13px; line-height: 1.65; color: #dbe7c9; }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.steps li { list-style: none; display: flex; gap: 10px; font-size: 13.5px; line-height: 1.6; color: #c8d3db; }
.steps li::before { counter-increment: s; content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(201, 247, 90, .14); color: var(--lime); font-size: 11px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--dim); }
.kv b { font-weight: 600; }

.detail-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 4px; }
.detail-head .dh-main { flex: 1; min-width: 0; }
.detail-head h3 { font-size: 20px; font-weight: 800; }
.detail-head .en { font-size: 11.5px; color: var(--dim); margin-top: 3px; letter-spacing: .02em; }
.detail-block { margin-top: 16px; }
.detail-block h4 { font-size: 12px; color: var(--lime); font-weight: 700; letter-spacing: .08em; margin-bottom: 7px; }
.detail-block p { font-size: 13.5px; line-height: 1.7; color: #c8d3db; }
.detail-block ol, .detail-block ul { font-size: 13.5px; line-height: 1.7; color: #c8d3db; padding-left: 1.2em; }
.detail-block li { margin: 6px 0; }

.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 4px; }
.wg-cell { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-size: 11px; color: var(--dim); background: rgba(255, 255, 255, .04); font-variant-numeric: tabular-nums; }
.wg-cell.has { background: rgba(201, 247, 90, .16); color: var(--lime); }
.wg-cell.done { background: var(--lime); color: var(--lime-ink); font-weight: 700; }

.a2hs { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: rgba(96, 165, 250, .1); border: 1px solid rgba(96, 165, 250, .26); }
.a2hs .i { font-size: 20px; }
.a2hs p { font-size: 12.5px; line-height: 1.6; color: #cfe0f5; }
.a2hs b { color: #fff; }
.a2hs button { margin-left: auto; }

.divider { height: 1px; background: var(--line); margin: 4px 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.nowrap { white-space: nowrap; }
