/* ============================================================
 * 智练 · 刷题小程序  样式表
 * 设计语言：奶油白底 + 豆沙玫瑰 + 淡藕荷，柔光阴影，衬线数字
 * ============================================================ */

:root {
  /* 底色 */
  --bg: #FCF8F5;
  --bg-warm: #F7EEE9;
  --card: #FFFFFF;

  /* 文字 */
  --ink: #443639;
  --ink-2: #8B7B7E;
  --ink-3: #BBAFB2;

  /* 主色：豆沙玫瑰 */
  --rose: #C67B84;
  --rose-deep: #B0666F;
  --rose-soft: #FBEDEE;
  --rose-line: #F3DBDD;

  /* 辅助色 */
  --lilac: #9B89C4;
  --lilac-soft: #F3EFFB;
  --mint: #6FA98C;
  --mint-soft: #EBF5EF;
  --amber: #C2914F;
  --amber-soft: #FAF1E1;
  --clay: #C96A5B;
  --clay-soft: #FBEAE7;

  /* 线 & 阴影 */
  --line: #F2E8E4;
  --line-2: #F8F1EE;
  --shadow: 0 12px 32px -14px rgba(178, 138, 140, .34);
  --shadow-sm: 0 6px 18px -10px rgba(178, 138, 140, .38);
  --shadow-lift: 0 16px 40px -16px rgba(178, 138, 140, .42);

  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --num: -apple-system, "Segoe UI", "Helvetica Neue", "PingFang SC", system-ui, sans-serif;

  --tab-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: #F4EBE6;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* 关键：窗口本身永不滚动，滚动只发生在 .view 内部 */
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* 桌面端模拟手机画布：锁死视口高度，内部滚动 */
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100%;
  min-height: 0;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@supports (height: 100dvh) {
  .app { height: 100dvh; }
}

@media (min-width: 560px) {
  body { padding: 24px 0; align-items: center; overflow: auto; }
  .app {
    height: 86vh;
    max-height: 900px;
    min-height: 560px;
    border-radius: 34px;
    box-shadow: 0 30px 80px -30px rgba(120, 84, 86, .4), 0 0 0 1px rgba(255,255,255,.7);
  }
  @supports (height: 86dvh) {
    .app { height: 86dvh; }
  }
}

/* ---------------- 视图切换 ---------------- */
.view {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
/* 动画不做 fill，避免滚动容器长期带着 transform 影响 iOS 惯性滚动 */
.view.is-active { display: flex; animation: viewIn .32s cubic-bezier(.22,.9,.3,1); }

/* 视图内的子块按内容撑开，绝不被 flex 压缩（否则页头会被挤扁、内容错位） */
.view > * { flex: 0 0 auto; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pad { padding: 0 20px; }

/* ---------------- 首页头部 ---------------- */
.home-hd {
  position: relative;
  padding: calc(26px + env(safe-area-inset-top)) 20px 6px;
  background: linear-gradient(170deg, #FBEDEC 0%, #FCF6F3 46%, var(--bg) 100%);
  overflow: hidden;
}
.home-hd::before,
.home-hd::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(0px); pointer-events: none;
}
.home-hd::before {
  width: 220px; height: 220px; right: -78px; top: -96px;
  background: radial-gradient(circle at 34% 34%, rgba(214,155,160,.5), rgba(214,155,160,0) 68%);
}
.home-hd::after {
  width: 180px; height: 180px; left: -76px; top: 26px;
  background: radial-gradient(circle at 60% 40%, rgba(178,166,214,.36), rgba(178,166,214,0) 70%);
}

.hd-row {
  position: relative;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.hd-hi {
  margin: 0 0 4px; font-size: 12.5px; color: var(--ink-2);
  letter-spacing: .06em;
  display: flex; align-items: center; flex-wrap: wrap;
}
.hd-sep { opacity: .45; margin: 0 5px; }
.exam-pill {
  background: none; border: none; padding: 0;
  font-family: var(--font); font-size: 12.5px;
  color: var(--rose-deep); cursor: pointer;
  border-bottom: 1px dashed rgba(198, 123, 132, .42);
  letter-spacing: .02em; line-height: 1.35;
}
.exam-pill.warn { color: var(--clay); border-bottom-color: rgba(201, 106, 91, .4); }
.hd-title {
  margin: 0; font-size: 23px; line-height: 1.34; font-weight: 600;
  letter-spacing: .01em; color: var(--ink);
}
.hd-title em {
  font-style: normal; color: var(--rose-deep);
  position: relative;
}
.hd-title em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 6px;
  background: rgba(198,123,132,.16); border-radius: 3px; z-index: -1;
}

.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.9);
  background: linear-gradient(140deg, #EDC3C6, #D9A7B4);
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .04em;
  box-shadow: 0 6px 16px -6px rgba(190,120,130,.6);
  cursor: pointer;
}

/* 今日卡片 */
.today-card {
  position: relative;
  margin-top: 18px;
  padding: 15px 18px 16px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.95);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.tc-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px;
}
.tc-label {
  font-size: 11px; color: var(--ink-3); letter-spacing: .12em;
}
.tc-numrow {
  display: flex; align-items: baseline; gap: 7px;
  margin: 2px 0 10px;
}
.today-num {
  font-family: var(--num); font-size: 40px; line-height: 1;
  font-weight: 600; color: var(--rose-deep); letter-spacing: -.03em;
}
.today-unit {
  font-size: 12px; color: var(--ink-3); letter-spacing: .02em;
}
.today-unit em { font-style: normal; color: var(--ink-2); font-family: var(--num); }
.tc-pct {
  margin-left: auto; font-family: var(--num); font-size: 14px;
  color: var(--rose); letter-spacing: .02em;
}
.today-bar {
  height: 6px; border-radius: 4px; background: #F5E7E4; overflow: hidden;
}
.today-bar i {
  display: block; height: 100%; width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #E3A8AB, var(--rose));
  transition: width .7s cubic-bezier(.22,.9,.3,1);
}
.tc-tip {
  margin: 9px 0 0; font-size: 11px; color: var(--ink-3); letter-spacing: .02em;
}
.streak {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--amber);
  background: var(--amber-soft);
  padding: 4px 9px; border-radius: 20px;
  letter-spacing: .02em;
}

/* ---------------- 数据格子 ---------------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-top: 14px;
}
.stat {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 13px 6px 11px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255,255,255,.8);
}
.stat-num {
  font-family: var(--num); font-size: 19px; font-weight: 600; line-height: 1.1;
  letter-spacing: -.01em;
}
.stat-lab { font-size: 10.5px; color: var(--ink-3); margin-top: 5px; letter-spacing: .02em; }
.stat.c-rose .stat-num { color: var(--rose-deep); }
.stat.c-mint .stat-num { color: var(--mint); }
.stat.c-clay .stat-num { color: var(--clay); }
.stat.c-amber .stat-num { color: var(--amber); }

/* ---------------- 区块标题 ---------------- */
.sec {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 26px 0 12px;
}
.sec h2 {
  margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: .02em;
}
.sec h2::before {
  content: ""; display: inline-block; width: 3px; height: 13px;
  background: linear-gradient(180deg, #E0A7AC, var(--rose));
  border-radius: 2px; margin-right: 8px; vertical-align: -1px;
}
.sec-note { font-size: 11.5px; color: var(--ink-3); }
.sec-act {
  font-size: 11.5px; color: var(--rose); background: none; border: none;
  padding: 2px; cursor: pointer; font-family: var(--font);
}

/* ---------------- 入口行 ---------------- */
.entry-list { display: flex; flex-direction: column; gap: 10px; }
.entry {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 16px;
  background: var(--card);
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  text-align: left; width: 100%; font-family: var(--font);
  color: var(--ink);
}
.entry:active { transform: scale(.982); box-shadow: var(--shadow); }
.entry-ic {
  flex: none; width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--rose-soft);
}
.entry-ic.lilac { background: var(--lilac-soft); }
.entry-ic.mint  { background: var(--mint-soft); }
.entry-ic.amber { background: var(--amber-soft); }
.entry-tx { flex: 1; min-width: 0; }
.entry-tx b {
  display: block; font-size: 14.5px; font-weight: 600; letter-spacing: .01em;
  margin-bottom: 3px;
}
.entry-tx span { font-size: 11.5px; color: var(--ink-3); letter-spacing: .01em; }
.entry-arrow { flex: none; color: #DCCFCC; }

/* ---------------- 题型卡 ---------------- */
.type-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
}
.type-card {
  padding: 14px 8px 12px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line-2);
  text-align: center;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
  font-family: var(--font); color: var(--ink);
}
.type-card:active { transform: scale(.965); }
.type-tag {
  display: inline-block; font-size: 10.5px; padding: 2px 9px; border-radius: 20px;
  letter-spacing: .06em; margin-bottom: 8px;
}
.type-tag.t-single { background: var(--rose-soft); color: var(--rose-deep); }
.type-tag.t-judge  { background: var(--mint-soft); color: var(--mint); }
.type-tag.t-multi  { background: var(--lilac-soft); color: var(--lilac); }
.type-num {
  font-family: var(--num); font-size: 21px; font-weight: 600; line-height: 1.1;
}
.type-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------------- 薄弱项 ---------------- */
.weak-card {
  background: var(--card); border-radius: var(--r-lg);
  padding: 6px 16px 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255,255,255,.9);
}
.weak-row { padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.weak-row:last-child { border-bottom: none; }
.weak-top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; margin-bottom: 7px;
}
.weak-name { color: var(--ink); }
.weak-name i {
  font-style: normal; font-size: 10.5px; color: var(--ink-3); margin-left: 6px;
}
.weak-pct { font-family: var(--num); font-size: 12.5px; }
.weak-bar { height: 5px; border-radius: 3px; background: #F6EEEC; overflow: hidden; }
.weak-bar i {
  display: block; height: 100%; border-radius: 3px;
  transition: width .7s cubic-bezier(.22,.9,.3,1);
}
.weak-bar i.good { background: linear-gradient(90deg, #A8CFB9, var(--mint)); }
.weak-bar i.mid  { background: linear-gradient(90deg, #E8CE9E, var(--amber)); }
.weak-bar i.bad  { background: linear-gradient(90deg, #E3A8AB, var(--rose)); }

/* 空态 */
.empty {
  text-align: center; padding: 26px 16px;
  color: var(--ink-3); font-size: 12.5px; line-height: 1.9;
}
.empty-ic { font-size: 26px; display: block; margin-bottom: 8px; opacity: .7; }

/* 小贴士 */
.tips {
  background: linear-gradient(150deg, #FFF9F7, #FDF2F1);
  border: 1px solid #F7E5E3;
  border-radius: var(--r-lg);
  padding: 15px 16px;
  font-size: 12px; line-height: 1.95; color: #7A686B;
}
.tips b { color: var(--rose-deep); font-weight: 600; }
.tips p { margin: 0; }
.tips p + p { margin-top: 6px; }

/* 底部留白 */
/* 底部导航是 .app 的 flex 子元素，始终贴在画布底部，不需要占位留白 */
.safe-bottom { height: 22px; flex: none; }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: relative; z-index: 30;
  display: flex; flex: none;
  height: var(--tab-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,252,250,.93);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: #C4B7B9; font-family: var(--font); font-size: 10px;
  letter-spacing: .04em; padding: 6px 0;
  transition: color .2s;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-on { color: var(--rose-deep); }
.tab-dot {
  position: absolute; top: 8px; margin-left: 16px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px; background: var(--rose); color: #fff;
  font-size: 9px; line-height: 15px; text-align: center;
  font-family: var(--font);
}

/* ============================================================
 * 答题页
 * ============================================================ */
.quiz { background: var(--bg); overflow: hidden; }

.quiz-hd {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.quiz-hd.scrolled { border-bottom-color: var(--line); background: rgba(252,248,245,.96); backdrop-filter: blur(10px); }

.icon-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line);
  color: var(--ink-2); cursor: pointer;
  transition: transform .16s, color .16s, background .16s;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn.on { color: var(--amber); background: var(--amber-soft); border-color: #F2E0C6; }

.qp-track {
  flex: 1; height: 5px; border-radius: 3px; background: #F0E5E2; overflow: hidden;
}
.qp-track i {
  display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, #E7B4B7, var(--rose));
  transition: width .35s cubic-bezier(.22,.9,.3,1);
}
.quiz-meta {
  flex: none; font-size: 11.5px; color: var(--ink-3);
  font-family: var(--num); letter-spacing: .03em; min-width: 42px; text-align: right;
}
.quiz-timer {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--num); font-size: 12.5px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 5px 10px;
}
.quiz-timer.warn { color: var(--clay); border-color: #F5D9D3; background: var(--clay-soft); }
.quiz-timer[hidden] { display: none !important; }

/* 题目区独立滚动：头部进度条、底部按钮始终固定可见 */
.quiz-body {
  flex: 1 1 auto; min-height: 0;
  padding: 18px 20px 8px;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.q-tags { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; }
.chip {
  font-size: 10.5px; padding: 3px 9px; border-radius: 20px;
  letter-spacing: .04em; white-space: nowrap;
}
.chip.type-single { background: var(--rose-soft); color: var(--rose-deep); }
.chip.type-judge  { background: var(--mint-soft); color: var(--mint); }
.chip.type-multi  { background: var(--lilac-soft); color: var(--lilac); }
.chip.ch { background: #F5F1EF; color: var(--ink-2); }
.chip.exam { background: var(--amber-soft); color: var(--amber); }
.chip.multi-hint { background: #FFF; color: var(--amber); border: 1px dashed #EBD9BC; }

.q-stem {
  margin: 0 0 20px;
  font-size: 16.5px; line-height: 1.72; font-weight: 500;
  letter-spacing: .01em; color: var(--ink);
}
.q-hint {
  margin: -12px 0 16px;
  font-size: 11.5px; color: var(--amber); letter-spacing: .02em;
}

/* 选项 */
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 11px;
  width: 100%; text-align: left;
  padding: 14px 15px;
  background: #fff; border: 1.5px solid #F4EAE7;
  border-radius: var(--r-md);
  font-family: var(--font); font-size: 14px; line-height: 1.6; color: var(--ink);
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .14s, box-shadow .18s;
}
.opt:active { transform: scale(.99); }
.opt-key {
  flex: none; width: 22px; height: 22px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; font-family: var(--num);
  background: #F7F2F0; color: var(--ink-3);
  transition: background .18s, color .18s;
  margin-top: 1px;
}
.opt-tx { flex: 1; min-width: 0; }
.opt-mark { flex: none; width: 18px; display: grid; place-items: center; margin-top: 2px; }

.opt.selected {
  border-color: var(--rose);
  background: #FFFAFA;
  box-shadow: inset 0 0 0 .5px var(--rose), 0 6px 18px -10px rgba(198,123,132,.55);
}
.opt.selected .opt-key { background: var(--rose); color: #fff; }

.opt.correct {
  border-color: #A8CFB9; background: #F6FBF8;
}
.opt.correct .opt-key { background: var(--mint); color: #fff; }
.opt.wrong {
  border-color: #E9B6AE; background: #FEF7F5;
}
.opt.wrong .opt-key { background: var(--clay); color: #fff; }
.opt.dim { opacity: .55; }
.opt[disabled] { cursor: default; }

/* 解析 */
.explain {
  margin-top: 18px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: explIn .34s cubic-bezier(.22,.9,.3,1) both;
}
@keyframes explIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ex-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px 0;
}
.ex-verdict {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
}
.ex-verdict.ok { color: var(--mint); }
.ex-verdict.no { color: var(--clay); }
.ex-ans {
  margin-left: auto; font-size: 11.5px; color: var(--ink-2);
  font-family: var(--num); letter-spacing: .04em;
}
.ex-body {
  padding: 9px 16px 15px;
  font-size: 13px; line-height: 1.92; color: #6E5F62;
}
.ex-body b { color: var(--rose-deep); font-weight: 600; }
.ex-kp {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 11px; font-size: 10.5px; color: var(--ink-3);
  background: #F8F4F2; padding: 4px 10px; border-radius: 20px;
}
.ex-acts {
  display: flex; gap: 8px; padding: 0 16px 14px;
}
.ex-acts .mini-btn { flex: none; }

.ex-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 12px;
}
.ex-foot .ex-kp { margin-top: 0; }
.ex-star {
  flex: none; font-family: var(--font); font-size: 11px;
  color: var(--ink-3); background: #F8F4F2;
  border: none; padding: 5px 11px; border-radius: 20px;
  cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s;
}
.ex-star.on { background: var(--amber-soft); color: var(--amber); }

/* 分题型小计 */
.type-res {
  background: #fff; border-radius: var(--r-md);
  padding: 2px 16px; text-align: left;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,.9);
  margin-bottom: 4px;
}
.tr-title {
  font-size: 10.5px; color: var(--ink-3); letter-spacing: .14em;
  padding: 12px 0 4px;
}
.tr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line-2);
  font-size: 12px; color: var(--ink-2);
}
.tr-row:last-child { border-bottom: none; }
.tr-name { width: 54px; flex: none; letter-spacing: .02em; color: var(--ink); }
.tr-bar { flex: 1; height: 5px; border-radius: 3px; background: #F6EEEC; overflow: hidden; }
.tr-bar i { display: block; height: 100%; border-radius: 3px; transition: width .6s cubic-bezier(.22,.9,.3,1); }
.tr-val {
  width: 76px; flex: none; text-align: right;
  font-family: var(--num); font-size: 12px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* 底部操作 */
.quiz-ft {
  flex: none;
  display: flex; gap: 10px;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.btn {
  flex: 1; height: 50px; border-radius: 16px;
  border: none; cursor: pointer;
  font-family: var(--font); font-size: 14.5px; font-weight: 500;
  letter-spacing: .06em;
  transition: transform .16s, opacity .16s, box-shadow .18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, #D3919A, var(--rose-deep));
  color: #fff;
  box-shadow: 0 12px 26px -12px rgba(176,102,111,.75);
}
.btn-primary:disabled {
  background: #F7EDEB; color: #C2AEAD; box-shadow: none; cursor: default;
}
.btn-ghost {
  flex: none; width: 116px;
  background: #fff; color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-soft {
  background: var(--rose-soft); color: var(--rose-deep);
}

/* ============================================================
 * 成绩页
 * ============================================================ */
.result-wrap { padding: 10px 20px 20px; text-align: center; }
.score-ring {
  width: 152px; height: 152px; margin: 6px auto 18px; position: relative;
}
.score-ring svg { transform: rotate(-90deg); }
.score-ring .ring-bg { stroke: #F3E9E6; }
.score-ring .ring-fg {
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(.22,.9,.3,1);
}
.score-in {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 2px;
}
.score-num {
  font-family: var(--num); font-size: 46px; font-weight: 500; line-height: 1;
  letter-spacing: -.03em;
}
.score-unit { font-size: 11px; color: var(--ink-3); letter-spacing: .1em; }
.result-title { font-size: 18px; font-weight: 600; margin: 0 0 6px; letter-spacing: .02em; }
.result-sub { font-size: 12.5px; color: var(--ink-2); margin: 0 0 22px; line-height: 1.8; }

.res-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
  margin-bottom: 18px;
}
.res-cell {
  background: #fff; border-radius: var(--r-md); padding: 13px 6px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,.9);
}
.res-cell b {
  display: block; font-family: var(--num); font-size: 18px; font-weight: 600;
}
.res-cell span { font-size: 10.5px; color: var(--ink-3); }

.review-list {
  background: #fff; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); text-align: left;
}
.review-item {
  display: flex; gap: 10px; padding: 13px 15px;
  border-bottom: 1px solid var(--line-2); font-size: 12.5px; line-height: 1.7;
}
.review-item:last-child { border-bottom: none; }
.review-no {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--clay-soft); color: var(--clay);
  font-size: 10.5px; display: grid; place-items: center; margin-top: 1px;
  font-family: var(--num);
}
.review-tx b { display: block; color: var(--ink); font-weight: 500; }
.review-tx span { color: var(--ink-3); font-size: 11.5px; }

/* ============================================================
 * 错题本
 * ============================================================ */
.page-hd {
  padding: calc(24px + env(safe-area-inset-top)) 20px 4px;
  background: linear-gradient(170deg, #FBEDEC 0%, var(--bg) 78%);
}
.page-hd h1 { margin: 0 0 5px; font-size: 21px; font-weight: 600; letter-spacing: .02em; }
.page-hd p { margin: 0; font-size: 12px; color: var(--ink-2); }

.seg {
  display: flex; gap: 6px; padding: 14px 20px 4px;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
}
.seg button {
  flex: 1; padding: 8px 4px; border-radius: 12px;
  border: 1px solid transparent; background: #F6EEEC;
  font-family: var(--font); font-size: 12px; color: var(--ink-2);
  cursor: pointer; letter-spacing: .02em;
  transition: all .2s;
}
.seg button.on {
  background: #fff; color: var(--rose-deep);
  border-color: var(--rose-line);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.wrong-list { padding: 12px 20px 0; display: flex; flex-direction: column; gap: 8px; }
.wrong-item {
  background: #fff; border-radius: 20px; padding: 13px 15px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,.9);
}
.wi-top { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.wi-time { margin-left: auto; font-size: 10.5px; color: var(--ink-3); font-family: var(--num); }
.wi-stem {
  font-size: 13.5px; line-height: 1.62; color: var(--ink); margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wi-foot { display: flex; align-items: center; gap: 6px; }
.wi-stat { font-size: 10.5px; color: var(--ink-3); margin-right: auto; }
.mini-btn {
  font-family: var(--font); font-size: 11px; padding: 5px 12px;
  border-radius: 20px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer;
  transition: all .16s;
}
.mini-btn:active { transform: scale(.95); }
.mini-btn.rose { background: var(--rose-soft); color: var(--rose-deep); border-color: var(--rose-line); }
.mini-btn.text {
  border: none; background: none; color: var(--rose);
  padding: 5px 4px; font-weight: 500;
}

/* ============================================================
 * 我的
 * ============================================================ */
.mine-hd {
  padding: calc(26px + env(safe-area-inset-top)) 20px 22px;
  background: linear-gradient(165deg, #FBEDEC, #FCF7F4 80%);
  position: relative; overflow: hidden;
}
.mine-hd::after {
  content: ""; position: absolute; width: 200px; height: 200px; right: -70px; top: -80px;
  background: radial-gradient(circle, rgba(178,166,214,.3), transparent 70%);
  border-radius: 50%;
}
.mine-row { display: flex; align-items: center; gap: 13px; position: relative; }
.mine-av {
  width: 54px; height: 54px; border-radius: 20px;
  background: linear-gradient(140deg, #EDC3C6, #D5A0AE);
  display: grid; place-items: center; color: #fff;
  font-size: 19px; font-weight: 600;
  box-shadow: 0 10px 22px -10px rgba(190,120,130,.7);
}
.mine-name { font-size: 16.5px; font-weight: 600; margin-bottom: 4px; letter-spacing: .02em; }
.mine-sub { font-size: 11.5px; color: var(--ink-2); }

.chart-card {
  background: #fff; border-radius: var(--r-lg); padding: 17px 16px 12px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,.9);
}
.chart-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
}
.chart-hd b { font-size: 13.5px; font-weight: 600; }
.chart-hd span { font-size: 10.5px; color: var(--ink-3); }
.bars {
  display: flex; align-items: flex-end; justify-content: space-between;
  height: 96px; gap: 8px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; max-width: 26px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #F0D2D4, #E3B3B8);
  min-height: 4px;
  transition: height .8s cubic-bezier(.22,.9,.3,1);
}
.bar.today { background: linear-gradient(180deg, #D3919A, var(--rose-deep)); }
.bar.zero {
  width: 5px; height: 5px !important; border-radius: 50%;
  background: #E7D9D6; min-height: 0;
}
.bar-lab { font-size: 9.5px; color: var(--ink-3); letter-spacing: .02em; }
.bar-val { font-size: 9.5px; color: var(--ink-2); font-family: var(--num); }

.set-list {
  background: #fff; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(255,255,255,.9);
}
.set-row {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; border-bottom: 1px solid var(--line-2);
  font-size: 13.5px; cursor: pointer; background: none; border-left: none;
  border-right: none; border-top: none; width: 100%; font-family: var(--font);
  color: var(--ink); text-align: left;
}
.set-row:last-child { border-bottom: none; }
.set-row .sr-note { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-family: var(--num); }
.set-row .switch { margin-left: 6px; }

.switch {
  margin-left: auto; width: 42px; height: 24px; border-radius: 12px;
  background: #EDE3E0; position: relative; transition: background .22s; flex: none;
}
.switch i {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
  box-shadow: 0 2px 5px rgba(0,0,0,.12);
  transition: transform .22s cubic-bezier(.22,.9,.3,1);
}
.switch.on { background: var(--rose); }
.switch.on i { transform: translateX(18px); }

/* ============================================================
 * 弹层
 * ============================================================ */
.mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(60,44,46,.36);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .24s;
}
.mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 430px;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.22,.9,.3,1);
  max-height: 86vh; overflow-y: auto;
}
.mask.show .sheet { transform: translateY(0); }
.sheet-bar {
  width: 38px; height: 4px; border-radius: 3px; background: #E5D9D6;
  margin: 6px auto 16px;
}
.sheet-title {
  font-size: 15.5px; font-weight: 600; text-align: center; margin: 0 0 4px;
  letter-spacing: .02em;
}
.sheet-sub {
  font-size: 12px; color: var(--ink-2); text-align: center;
  margin: 0 0 20px; line-height: 1.7;
}
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }

/* 日期选择：iOS/Android 原生控件高度与圆角差异较大，统一处理 */
.date-input {
  width: 100%; min-height: 50px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit; font-size: 15px; color: var(--ink);
  outline: none;
  -webkit-appearance: none; appearance: none;
  line-height: 1.4;
}
.date-input:focus { border-color: var(--rose-line); }

/* 答题卡 */
.card-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px;
  margin-bottom: 14px;
}
.card-cell {
  aspect-ratio: 1; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--num); font-size: 13px;
  background: #fff; border: 1px solid var(--line);
  color: var(--ink-2); cursor: pointer;
  transition: all .16s;
}
.card-cell.done { background: var(--rose-soft); border-color: var(--rose-line); color: var(--rose-deep); }
.card-cell.flag { box-shadow: inset 0 0 0 1.5px var(--amber); }
.card-cell.cur { background: var(--rose); color: #fff; border-color: var(--rose); }
.card-legend {
  display: flex; gap: 14px; justify-content: center;
  font-size: 10.5px; color: var(--ink-3); margin-bottom: 4px;
}
.card-legend i {
  display: inline-block; width: 9px; height: 9px; border-radius: 3px;
  margin-right: 4px; vertical-align: -1px;
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px);
  background: rgba(68,54,57,.92); color: #fff;
  padding: 10px 20px; border-radius: 20px;
  font-size: 12.5px; letter-spacing: .03em;
  opacity: 0; pointer-events: none; z-index: 200;
  transition: opacity .24s, transform .24s;
  max-width: 84vw; text-align: center; line-height: 1.6;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 数字等宽，避免跳动 */
.stat-num, .type-num, .score-num, .today-num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------
 * 屏蔽托管平台注入的右下角推广徽标（Netlify 免费版 HUD）
 *
 * 它由服务端在页面末尾插入 <script src="/.netlify/scripts/hud">，
 * 运行时创建一个 position:fixed、z-index:2147483645 的 iframe，
 * 固定占据右下角约 181×48px。它自带的碰撞避让只在页面加载时做一次
 * 快照，而本应用各页面是 display:none 切换的，加载时它看不见这些
 * 按钮，于是直接压住底部主按钮，并且吞掉该区域的点击。
 *
 * 用多重选择器兜底：万一平台换了 id，只要还是 id 以 nl- 开头、
 * 或 iframe 标题含 Netlify、或指向 hud 脚本，仍然会被隐藏。
 * display 用 !important 压过它写在 style 属性上的定位样式。
 * ------------------------------------------------------------- */
iframe#nl-badge-frame,
iframe#nl-hud-frame,
iframe[id^="nl-"],
iframe[title*="Netlify" i],
iframe[src*="/.netlify/scripts/hud"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}
