/* ============================================================
   四级真题 · 水墨刷题  —  设计系统
   墨 #1c1a17 / 宣纸 #f5f1e6 / 朱砂 #b93a32 / 淡墨 #8a867c
   ============================================================ */
:root {
  --ink: #1c1a17;
  --ink-70: rgba(28, 26, 23, .72);
  --ink-45: rgba(28, 26, 23, .45);
  --ink-12: rgba(28, 26, 23, .12);
  --paper: #f5f1e6;
  --paper-2: #fdfbf4;
  --gray: #8a867c;
  --line: #d9d2bf;
  --red: #b93a32;
  --red-soft: rgba(185, 58, 50, .12);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --kai: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "SimSun", serif;
  --safe-top: max(env(safe-area-inset-top, 0px), 36px);
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), 20px);
}

html { touch-action: manipulation; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  /* 宣纸底纹 */
}
button { font-family: inherit; border: none; background: none; color: inherit; cursor: pointer; }
b, strong { font-weight: 800; }

.view { min-height: 100%; }

/* hidden 属性必须始终优先于任何 display 声明（否则 .modal-wrap 的 display:flex 会让隐藏弹窗仍可见并拦截点击） */
[hidden] { display: none !important; }
.container { max-width: 640px; margin: 0 auto; padding: 14px 16px calc(90px + var(--safe-bottom)); }

/* ============ 顶部栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-top) + 10px) 56px 10px;
  background: rgba(245, 241, 230, .96);
  border-bottom: 2px solid var(--ink);
}
.ex-title { flex: 1; text-align: center; font-family: var(--kai); font-size: 17px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-count { flex: 0 0 auto; font-size: 13px; color: var(--gray); font-family: var(--sans); font-weight: 600; }
.tb-btn {
  padding: 6px 10px; font-size: 13px; font-weight: 700; letter-spacing: .5px;
  border: 2px solid var(--ink); background: var(--paper-2); color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink-12); white-space: nowrap;
}
.tb-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.tb-btn-solid { background: var(--ink); color: var(--paper-2); }
.tb-btn.on { background: var(--red); border-color: var(--red); color: #fff; }

/* ============ 首页 hero ============ */
.home-hero {
  position: relative; overflow: hidden; color: var(--paper-2);
  background: var(--ink);
  padding: calc(var(--safe-top) + 46px) 20px 40px;
}
.hero-lines {
  position: absolute; inset: -60%;
  background: repeating-conic-gradient(from 0deg, rgba(245,241,230,.05) 0deg 3deg, transparent 3deg 10deg);
  animation: herospin 90s linear infinite;
}
@keyframes herospin { to { transform: rotate(360deg); } }
.hero-inner { position: relative; max-width: 600px; margin: 0 auto; }
.hero-title {
  font-family: var(--kai); font-weight: 900;
  font-size: clamp(44px, 11vw, 64px); letter-spacing: 6px; line-height: 1.15;
}
.hero-sub { margin-top: 6px; font-size: 13px; letter-spacing: 3px; color: rgba(245,241,230,.55); }
.seal {
  position: absolute; right: 4px; top: -18px;
  width: 62px; height: 62px; display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--red); border-radius: 6px; color: var(--red);
  font-family: var(--kai); font-size: 15px; font-weight: 800; line-height: 1.25; text-align: center;
  transform: rotate(6deg); opacity: .92;
  box-shadow: inset 0 0 0 1px rgba(185,58,50,.35), 0 0 0 3px rgba(185,58,50,.08);
}
.hero-stats { display: flex; gap: 26px; margin-top: 26px; }
.hstat b { display: block; font-size: 30px; font-weight: 900; line-height: 1; font-family: var(--kai); }
.hstat b.days { font-size: 26px; color: #ffd9d4; }
.hstat span { font-size: 11px; letter-spacing: 2px; color: rgba(245,241,230,.5); }

/* ============ 底部标签栏（首页） ============ */
.tabbar {
  position: sticky; top: 0; z-index: 25;
  display: flex; background: var(--paper); border-bottom: 2px solid var(--ink);
}
.tb-item {
  flex: 1; padding: 11px 0 9px; font-size: 14px; font-weight: 700; letter-spacing: 2px;
  color: var(--gray); border-bottom: 3px solid transparent;
}
.tb-item.on { color: var(--ink); border-bottom-color: var(--red); }

/* ============ 卡片 ============ */
.card {
  position: relative; background: var(--paper-2);
  border: 2px solid var(--ink); margin-bottom: 14px;
}
.card::after {
  content: ""; position: absolute; z-index: -1;
  right: -5px; bottom: -5px; width: 100%; height: 100%;
  background: var(--ink-12);
}
.yr-head {
  font-family: var(--kai); font-size: 15px; font-weight: 800; letter-spacing: 2px;
  margin: 22px 2px 10px; display: flex; align-items: center; gap: 10px;
}
.yr-head::after { content: ""; flex: 1; height: 3px; background: var(--ink); opacity: .85; }
.paper-row {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-bottom: 1px solid var(--line);
}
.paper-row:last-child { border-bottom: none; }
.paper-row:active { background: var(--red-soft); }
.pr-name { flex: 1; font-size: 15px; font-weight: 700; }
.pr-name small { display: block; font-size: 11px; color: var(--gray); font-weight: 500; margin-top: 1px; }
.pr-tag { font-size: 10px; padding: 2px 7px; border: 1.5px solid var(--red); color: var(--red); font-weight: 700; }
.pr-prog { width: 64px; height: 8px; border: 1.5px solid var(--ink); position: relative; }
.pr-prog i { position: absolute; inset: 0; right: auto; background: var(--ink); }
.pr-pct { font-size: 11px; font-weight: 700; color: var(--gray); width: 34px; text-align: right; }

/* ============ 章节标签 ============ */
.sec-tabs {
  position: sticky; top: calc(var(--safe-top) + 51px); z-index: 29;
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px;
  background: rgba(245,241,230,.96); border-bottom: 1.5px solid var(--line);
  scrollbar-width: none;
}
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tab {
  flex-shrink: 0; padding: 6px 14px; font-size: 13px; font-weight: 700; letter-spacing: 1px;
  border: 2px solid var(--ink-45); color: var(--ink-70); background: var(--paper-2);
}
.sec-tab.on { border-color: var(--ink); color: var(--ink); background: var(--ink); color: var(--paper-2); }
.sec-tab .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50% 42% 55% 45%; background: var(--ink); margin-left: 6px; vertical-align: 1px; }
.sec-tab .dot.r { background: var(--red); }

/* ============ 题目 ============ */
.ex-body { max-width: 640px; margin: 0 auto; padding: 14px 16px calc(60px + var(--safe-bottom)); }
.q-card { margin-bottom: 20px; }
.q-num { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 6px; font-family: var(--kai); font-weight: 900; font-size: 16px; background: var(--ink); color: var(--paper-2); }
.q-stem { font-size: 15.5px; margin: 10px 0 4px; line-height: 1.75; user-select: text; -webkit-user-select: text; }
.dir-box { font-size: 12.5px; color: var(--ink-70); background: rgba(28,26,23,.045); border-left: 3px solid var(--ink-45); padding: 8px 10px; margin: 10px 0; line-height: 1.6; user-select: text; -webkit-user-select: text; }
.passage { font-size: 14.5px; line-height: 1.85; margin: 12px 0; white-space: pre-wrap; user-select: text; -webkit-user-select: text; }
.para-label { font-family: var(--kai); font-weight: 800; margin-right: 6px; color: var(--red); }
.bank-words { font-size: 14px; line-height: 2; margin: 10px 0; padding: 10px 12px; border: 1.5px dashed var(--ink-45); user-select: text; -webkit-user-select: text; }
.bank-words b { font-family: var(--kai); color: var(--red); margin-right: 4px; }

.opt {
  position: relative; display: flex; gap: 9px; align-items: baseline;
  padding: 10px 12px; margin: 8px 0; font-size: 14.5px; line-height: 1.6;
  border: 1.5px solid transparent; user-select: text; -webkit-user-select: text; text-align: left;
}
.opt:active { background: rgba(28,26,23,.04); }
.opt-key { position: relative; font-family: var(--kai); font-weight: 900; font-size: 15px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 20px; padding: 1px 5px; }
.opt-text { flex: 1; }
/* 圈选：仅套在字母上 */
.opt-key svg.circle { position: absolute; inset: -8px -10px; width: calc(100% + 20px); height: calc(100% + 16px); pointer-events: none; overflow: visible; }
.opt svg.circle path {
  fill: none; stroke: var(--red); stroke-width: 2.6; stroke-linecap: round;
  filter: url(#f-ink); opacity: .92;
}
.opt.sel .opt-key { color: var(--red); }
@keyframes drawCircle { from { stroke-dashoffset: var(--len, 900); } to { stroke-dashoffset: 0; } }
.opt svg.circle path { stroke-dasharray: var(--len, 900); animation: drawCircle .38s ease-out forwards; }
@keyframes fadeCircle { to { opacity: 0; } }
.opt svg.circle.bye path { animation: fadeCircle .16s ease-in forwards; }

.listen-note {
  margin: 10px 0; padding: 9px 12px; font-size: 12.5px; color: var(--red);
  border: 1.5px dashed var(--red); background: var(--red-soft); line-height: 1.6;
}

/* 写作/翻译 */
.free-box { margin-top: 10px; border: 2px solid var(--ink); background: var(--paper-2); }
.free-title { padding: 8px 12px; font-size: 13px; font-weight: 700; letter-spacing: 2px; border-bottom: 2px solid var(--ink); background: rgba(28,26,23,.05); }
.free-paper { padding: 12px 14px 40px; min-height: 120px; font-size: 14px; color: var(--ink-45);
  background-image: repeating-linear-gradient(transparent 0 27px, var(--line) 27px 28px); font-family: var(--kai); }

/* ============ 答题卡抽屉 ============ */
.mask { position: fixed; inset: 0; z-index: 40; background: rgba(28,26,23,.42); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: min(82vw, 340px); background: var(--paper);
  border-left: 2.5px solid var(--ink);
  transform: translateX(105%); transition: transform .28s cubic-bezier(.22,.8,.3,1);
  overflow-y: auto; padding-bottom: var(--safe-bottom);
}
.drawer.open { transform: translateX(0); }
.dw-head {
  position: sticky; top: 0; display: flex; align-items: baseline; gap: 10px;
  padding: calc(var(--safe-top) + 14px) 16px 10px; background: var(--paper);
  border-bottom: 2px solid var(--ink); font-family: var(--kai); font-size: 16px; letter-spacing: 2px;
}
.dw-progress { font-family: var(--sans); font-size: 12px; color: var(--gray); font-weight: 700; }
.sh-group { padding: 12px 16px 4px; }
.sh-group h4 { font-size: 12px; letter-spacing: 2px; color: var(--gray); margin-bottom: 8px; font-weight: 700; }
.sh-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sh-n {
  position: relative; height: 38px; font-size: 13.5px; font-weight: 700;
  border: 1.5px solid var(--ink-45); color: var(--ink-70); background: var(--paper-2);
}
.sh-n.done { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.sh-n.cur { outline: 2.5px solid var(--red); outline-offset: 1.5px; color: var(--red); border-color: transparent; }
.sh-n.done.cur { color: var(--paper-2); }
.legend { display: flex; gap: 14px; padding: 14px 16px; font-size: 11px; color: var(--gray); }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; border: 1.5px solid var(--ink-45); }
.legend .l-done i { background: var(--ink); border-color: var(--ink); }
.legend .l-cur i { outline: 2px solid var(--red); outline-offset: 1px; }

/* ============ 查词浮层 ============ */
#dict-pop {
  position: fixed; z-index: 60; max-width: min(330px, 88vw);
  background: var(--paper-2); border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink-12); padding: 12px 14px 10px;
  font-size: 14px; line-height: 1.6;
}
#dict-pop .dp-w { font-family: var(--kai); font-weight: 900; font-size: 19px; }
#dict-pop .dp-ph { color: var(--red); font-size: 13px; margin: 2px 0 6px; }
#dict-pop .dp-tr { color: var(--ink-70); max-height: 34vh; overflow-y: auto; -webkit-overflow-scrolling: touch; user-select: text; -webkit-user-select: text; }
#dict-pop .dp-tag { display: inline-block; font-size: 10px; color: var(--red); border: 1.5px solid var(--red); padding: 1px 6px; margin-left: 8px; vertical-align: 2px; }
.dp-row { display: flex; gap: 8px; margin-top: 10px; }
.dp-btn { flex: 1; padding: 7px 0; text-align: center; font-size: 13px; font-weight: 700; border: 2px solid var(--ink); background: var(--paper); }
.dp-btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.dp-miss { color: var(--gray); font-size: 13px; }

/* ============ 单词本 ============ */
.seg { display: flex; max-width: 640px; margin: 12px auto 0; padding: 0 16px; gap: 0; }
.seg-i { flex: 1; padding: 9px 0; font-size: 13.5px; font-weight: 700; letter-spacing: 1px; border: 2px solid var(--ink-45); color: var(--gray); background: var(--paper-2); }
.seg-i + .seg-i { border-left: none; }
.seg-i.on { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.word-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.word-row .w { font-family: var(--kai); font-weight: 800; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-row .m { flex: 1; font-size: 12.5px; color: var(--gray); white-space: normal; line-height: 1.6; word-break: break-word; }
.word-row .star { color: var(--red); font-size: 17px; padding: 4px 6px; }
.empty-tip { text-align: center; color: var(--gray); font-size: 13.5px; padding: 48px 20px; line-height: 2; }
.empty-tip .big { font-family: var(--kai); font-size: 40px; color: var(--ink-12); display: block; }

/* ============ 闪卡 ============ */
.flash-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 78vh; padding: 16px; }
.flip-wrap { perspective: 1200px; width: min(84vw, 320px); height: 400px; }
.flip-card {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .45s cubic-bezier(.3,.9,.35,1.1);
}
.flip-card.back { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 3px solid var(--ink); background: var(--paper-2);
  box-shadow: 7px 7px 0 var(--ink-12);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 22px; text-align: center;
}
.flip-face.bk { transform: rotateY(180deg); border-color: var(--red); box-shadow: 7px 7px 0 var(--red-soft); }
.fc-word { font-family: var(--kai); font-weight: 900; font-size: 34px; word-break: break-all; }
.fc-ph { color: var(--red); margin-top: 8px; font-size: 15px; }
.fc-tag { margin-top: 10px; font-size: 10px; color: var(--red); border: 1.5px solid var(--red); padding: 1px 8px; }
.fc-tr { font-size: 16px; line-height: 1.9; color: var(--ink-70); max-height: 220px; overflow-y: auto; }
.fc-hint { position: absolute; bottom: 14px; font-size: 11px; letter-spacing: 2px; color: var(--ink-45); }
.flash-btns { display: flex; gap: 14px; margin-top: 26px; width: min(84vw, 320px); }
.fb { flex: 1; padding: 13px 0; font-size: 15px; font-weight: 800; letter-spacing: 3px; border: 2.5px solid var(--ink); background: var(--paper-2); }
.fb:active { transform: translate(2px,2px); box-shadow: none; }
.fb.know { background: var(--ink); color: var(--paper-2); box-shadow: 4px 4px 0 var(--ink-12); }
.fb.again { color: var(--red); border-color: var(--red); box-shadow: 4px 4px 0 var(--red-soft); }
.flash-done { text-align: center; }
.flash-done .n { font-family: var(--kai); font-size: 52px; font-weight: 900; }

/* ============ Toast / 杂项 ============ */
#toast {
  position: fixed; left: 50%; bottom: calc(15vh + var(--safe-bottom)); z-index: 80;
  transform: translateX(-50%); background: var(--ink); color: var(--paper-2);
  font-size: 13px; padding: 9px 18px; letter-spacing: 1px; white-space: nowrap;
  animation: toastIn .2s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.foot-note { text-align: center; font-size: 11px; color: var(--ink-45); padding: 8px 0 20px; letter-spacing: 1px; }

/* ============ 模拟考条 ============ */
.exam-strip {
  position: sticky; top: calc(var(--safe-top) + 51px); z-index: 28;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; background: var(--ink); color: var(--paper-2);
}
.timer { font-family: var(--kai); font-weight: 900; font-size: 20px; letter-spacing: 1px; color: #ffd9d4; }
.timer.low { color: var(--red); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: .35; } }
.ex-mode-tip { flex: 1; font-size: 11px; opacity: .75; letter-spacing: 1px; }
.exam-go {
  margin-top: 22px; width: 100%; padding: 13px 0;
  font-family: var(--kai); font-size: 17px; font-weight: 800; letter-spacing: 4px;
  background: var(--red); color: #fff; border: 2.5px solid rgba(0,0,0,.25);
  box-shadow: 4px 4px 0 rgba(0,0,0,.35);
}
.exam-go:active { transform: translate(2px,2px); box-shadow: none; }

/* ============ 主观题输入 / 自评 / 查看答案 ============ */
.paper-input {
  width: 100%; min-height: 140px; border: none; outline: none; resize: vertical;
  background: transparent; font-family: var(--kai); font-size: 15px; line-height: 28px; color: var(--ink);
  background-image: repeating-linear-gradient(transparent 0 27px, var(--line) 27px 28px);
  padding: 0 2px; -webkit-user-select: text; user-select: text;
}
.comp-bar { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-top: 2px solid var(--ink); background: rgba(28,26,23,.04); }
.comp-bar label { font-size: 12px; font-weight: 700; color: var(--ink-70); white-space: nowrap; }
.comp-bar input { width: 76px; padding: 5px 8px; border: 1.5px solid var(--ink-45); background: var(--paper-2); font-size: 14px; font-family: var(--sans); }
.comp-bar .sp { flex: 1; }
.mini-btn { padding: 6px 10px; font-size: 12px; font-weight: 700; border: 1.5px solid var(--ink); background: var(--paper-2); color: var(--ink); }
.mini-btn:active { background: var(--ink); color: var(--paper-2); }

/* ============ 翻译模式 ============ */
.para-br { display: block; height: 0.55em; }
.sent { border-bottom: 1px dashed transparent; }
.trans-on .sent { border-bottom-color: var(--line); }
#trans-pop {
  position: fixed; z-index: 60; max-width: min(340px, 90vw);
  background: var(--ink); color: var(--paper-2);
  border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink-12);
  padding: 10px 13px; font-size: 14px; line-height: 1.75;
}
.tr-line {
  font-family: var(--kai); font-size: 13.5px; line-height: 1.8; color: var(--ink-70);
  background: rgba(185,58,50,.05); border-left: 3px solid var(--red);
  padding: 6px 10px; margin: 6px 0 10px;
}
.sent.hl, .tr-line.hl { background: var(--red-soft); outline: 1.5px dashed var(--red); }
.tr-whole { background: rgba(185,58,50,.08); border-left-width: 4px; font-size: 14px; }
.tr-whole::before { content: '整段译文'; display: block; font-size: 11px; color: var(--red); letter-spacing: 2px; font-weight: 700; margin-bottom: 3px; }
.tr-opt { font-family: var(--kai); font-size: 13px; color: var(--ink-45); }
.tr-note { font-size: 11px; color: var(--ink-45); padding: 2px 0 8px; letter-spacing: 1px; }

/* ============ 选词填空拖拽 ============ */
.bank-words { display: flex; flex-wrap: wrap; gap: 8px; }
.bank-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px;
  border: 1.5px solid var(--ink); background: var(--paper-2); font-size: 13.5px; font-weight: 700;
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.bank-chip b { font-family: var(--kai); color: var(--red); }
.bank-chip.used { opacity: .3; }
.bank-chip.dragging { opacity: .85; box-shadow: 3px 3px 0 var(--ink-12); }
#drag-ghost {
  position: fixed; z-index: 90; pointer-events: none; opacity: .9;
  padding: 5px 12px; border: 2px solid var(--red); color: var(--red);
  background: var(--paper-2); font-size: 14px; font-weight: 800; transform: rotate(-3deg);
  box-shadow: 4px 4px 0 var(--red-soft);
}
.blank {
  display: inline-block; min-width: 64px; padding: 0 8px; margin: 0 2px;
  border-bottom: 2.5px solid var(--ink-45); color: var(--red);
  font-family: var(--kai); font-weight: 800; text-align: center; line-height: 1.4;
  vertical-align: baseline;
}
.blank.filled { border-bottom-color: var(--red); }
.blank.over { background: var(--red-soft); outline: 1.5px dashed var(--red); }

/* ============ 选词填空：每页一题滑动 ============ */
.ra-slider {
  position: relative; overflow: hidden;
  border: 1.5px solid var(--line); border-radius: 2px;
  user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
}
.ra-track { display: flex; transition: transform .26s cubic-bezier(.22,.8,.3,1); }
.ra-slide { flex: 0 0 100%; padding: 4px 2px 2px; }
.ra-slide .q-card { margin-bottom: 0; }
.ra-slide .q-stem { user-select: text; -webkit-user-select: text; }
.ra-nav {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 12px 0 4px;
}
.ra-arrow {
  width: 38px; height: 38px; font-size: 18px; font-weight: 800;
  border: 2px solid var(--ink); background: var(--paper-2); color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink-12);
}
.ra-arrow:active { transform: translate(2px, 2px); box-shadow: none; }
.ra-cnt { font-family: var(--kai); font-size: 14px; font-weight: 800; letter-spacing: 1px; min-width: 72px; text-align: center; color: var(--ink-70); }

/* ============ 笔记 ============ */
.nt-hint { max-width: 640px; margin: 10px auto 0; padding: 0 16px; font-size: 12.5px; color: var(--gray); }
#note-pop { position: fixed; z-index: 70; }
.np-btn {
  padding: 8px 14px; font-size: 13px; font-weight: 700; letter-spacing: 1px;
  background: var(--ink); color: var(--paper-2); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink-12);
}
.note-card { position: relative; background: var(--paper-2); border: 2px solid var(--ink); margin-bottom: 14px; padding: 12px 14px; }
.note-card::after { content: ""; position: absolute; z-index: -1; right: -4px; bottom: -4px; width: 100%; height: 100%; background: var(--ink-12); }
.nk-quote { font-size: 13px; color: var(--ink-70); border-left: 3px solid var(--red); padding: 2px 0 2px 10px; margin-bottom: 8px; font-style: italic; }
.nk-text { font-size: 14.5px; line-height: 1.8; white-space: pre-wrap; }
.nk-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--gray); }
.nk-meta .sp { flex: 1; }
.nk-src { cursor: default; }
.note-card:active { background: #fffdf4; }

/* ============ 通用弹窗 ============ */
.modal-wrap { position: fixed; inset: 0; z-index: 75; background: rgba(28,26,23,.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal {
  width: 100%; max-width: 420px; max-height: 84vh; overflow-y: auto;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink-12);
}
.md-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 2px solid var(--ink); font-family: var(--kai); font-size: 16px; letter-spacing: 2px; }
.md-x { font-size: 22px; line-height: 1; padding: 0 6px; color: var(--ink-70); }
.md-quote { font-size: 13px; color: var(--ink-70); border-left: 3px solid var(--red); padding: 4px 10px; margin: 12px 14px 0; max-height: 88px; overflow-y: auto; font-style: italic; }
#nm-text {
  display: block; width: calc(100% - 28px); height: 120px; margin: 12px 14px 0;
  border: 1.5px solid var(--ink-45); background: var(--paper-2); outline: none; resize: vertical;
  font-family: var(--sans); font-size: 14px; line-height: 1.7; padding: 8px 10px;
  -webkit-user-select: text; user-select: text;
}
.md-row { display: flex; gap: 8px; padding: 12px 14px 4px; }
.md-row .dp-btn { flex: 1; }
.md-meta { padding: 6px 14px 12px; font-size: 11px; color: var(--gray); }
.ep-tip { padding: 10px 14px 0; font-size: 12px; color: var(--gray); line-height: 1.7; }
.ep-list { padding: 8px 14px 14px; }
.ep-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 10px; border-bottom: 1px solid var(--line); font-size: 14.5px; font-weight: 700;
}
.ep-row:active { background: var(--red-soft); }
.ep-row small { color: var(--gray); font-weight: 500; }
#rm-body { padding: 14px; font-size: 14px; line-height: 1.9; }
.rm-big { font-family: var(--kai); font-size: 44px; font-weight: 900; text-align: center; color: var(--red); }
.rm-grid { display: flex; gap: 10px; margin: 12px 0; }
.rm-cell { flex: 1; text-align: center; border: 2px solid var(--ink); padding: 8px 4px; background: var(--paper-2); }
.rm-cell b { display: block; font-size: 20px; font-family: var(--kai); }
.rm-cell span { font-size: 11px; color: var(--gray); }
.rm-sec { margin: 8px 0 4px; font-weight: 800; font-size: 13px; letter-spacing: 1px; }
.rm-inputs { display: flex; gap: 10px; margin: 8px 0 4px; }
.rm-inputs .rm-in { flex: 1; border: 1.5px solid var(--ink-45); padding: 8px 10px; background: var(--paper-2); }
.rm-in label { display: block; font-size: 11px; color: var(--gray); margin-bottom: 4px; }
.rm-in input { width: 100%; border: none; outline: none; background: transparent; font-size: 18px; font-weight: 800; font-family: var(--kai); color: var(--red); }
.ans-ref { border: 1.5px dashed var(--ink-45); padding: 10px 12px; margin: 8px 0; font-size: 13.5px; line-height: 1.9; white-space: pre-wrap; max-height: 240px; overflow-y: auto; -webkit-user-select: text; user-select: text; }
.rm-tip { font-size: 12px; color: var(--gray); }

/* ============ 核对答案 ============ */
.q-check {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 58px; height: 28px; padding: 0 9px; margin-left: 8px; vertical-align: top;
  border: 1.5px solid var(--red); background: var(--paper-2); color: var(--red);
  font-family: var(--kai); font-size: 13px; font-weight: 800; letter-spacing: 2px;
}
.q-check:active { background: var(--red); color: #fff; }
/* 正确圈：绿色，其余与选择圈一致 */
.opt svg.circle.ok path, .bank-chip b svg.circle.ok path { stroke: #2f8f5b; }
.bank-chip b { position: relative; display: inline-flex; }
.bank-chip b svg.circle {
  position: absolute; inset: -8px -10px; width: calc(100% + 20px); height: calc(100% + 16px);
  pointer-events: none; overflow: visible;
}
.bank-chip b svg.circle path {
  fill: none; stroke: var(--red); stroke-width: 2.6; stroke-linecap: round;
  filter: url(#f-ink); opacity: .92;
  stroke-dasharray: var(--len, 900); animation: drawCircle .38s ease-out forwards;
}

/* ============ 对错牌浮窗 ============ */
#judge-pop {
  position: fixed; left: 50%; top: 42%; z-index: 85; pointer-events: none;
  transform: translate(-50%, -50%); opacity: 0; transition: opacity .22s ease;
}
#judge-pop.show { opacity: 1; }
#judge-pop.fade { opacity: 0; }
#judge-pop .j-badge {
  transform: scale(.55); transition: transform .22s cubic-bezier(.2,.9,.3,1.15);
  text-align: center;
}
#judge-pop.show .j-badge { transform: scale(1); }
.j-seal { width: 92px; height: 92px; display: block; margin: 0 auto; filter: drop-shadow(3px 4px 0 rgba(28,26,23,.14)); }
.j-seal .j-fr { fill: rgba(245,241,230,.97); filter: url(#f-ink-sm); }
.j-seal .j-fr2 { fill: none; opacity: .55; }
.j-seal .j-mark { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.j-seal.ok .j-fr, .j-seal.ok .j-fr2, .j-seal.ok .j-mark { stroke: #2f8f5b; }
.j-seal.ok .j-fr { stroke-width: 6; } .j-seal.ok .j-fr2 { stroke-width: 2.5; } .j-seal.ok .j-mark { stroke-width: 11; }
.j-seal.no .j-fr, .j-seal.no .j-fr2, .j-seal.no .j-mark { stroke: var(--red); }
.j-seal.no .j-fr { stroke-width: 6; } .j-seal.no .j-fr2 { stroke-width: 2.5; } .j-seal.no .j-mark { stroke-width: 11; }
.j-seal.na .j-fr, .j-seal.na .j-fr2, .j-seal.na .j-mark { stroke: var(--gray); }
.j-seal.na .j-fr { stroke-width: 6; } .j-seal.na .j-fr2 { stroke-width: 2.5; } .j-seal.na .j-mark { stroke-width: 9; }
.j-label { margin-top: 7px; font-family: var(--kai); font-size: 20px; font-weight: 900; letter-spacing: 3px; }
.j-label.ok { color: #2f8f5b; } .j-label.no { color: var(--red); } .j-label.na { color: var(--gray); }
.j-extra { margin-top: 3px; font-size: 12.5px; color: var(--ink-70); letter-spacing: 1px; }

/* ============ 常规模式交卷判分 ============ */
.grade-fab {
  position: fixed; right: 16px; bottom: calc(var(--safe-bottom) + 16px); z-index: 35;
  padding: 11px 18px; font-size: 14px; font-weight: 800; letter-spacing: 2px;
  background: var(--red); color: #fff; border: 2px solid rgba(0,0,0,.25);
  box-shadow: 4px 4px 0 rgba(0,0,0,.3); font-family: var(--kai);
}
.grade-fab:active { transform: translate(2px,2px); box-shadow: none; }

/* ============ 成绩展示页 ============ */
.report-modal { max-width: 460px; }
.rp-card {
  position: relative; margin: 14px; padding: 18px 16px 14px; text-align: center;
  background: var(--paper-2); border: 2.5px solid var(--ink);
}
.rp-seal {
  position: absolute; right: 12px; top: 12px; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid var(--red); border-radius: 5px; color: var(--red);
  font-family: var(--kai); font-size: 19px; font-weight: 900; transform: rotate(7deg);
}
.rp-title { font-family: var(--kai); font-size: 21px; font-weight: 900; letter-spacing: 3px; }
.rp-sub { margin-top: 4px; font-size: 12.5px; color: var(--ink-70); }
.rp-score { margin: 14px 0 4px; }
.rp-score b { font-family: var(--kai); font-size: 56px; font-weight: 900; color: var(--red); }
.rp-score span { font-size: 14px; color: var(--ink-45); margin-left: 6px; }
.rp-lines { margin: 10px 0 6px; }
.rp-row { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-bottom: 1px dashed var(--line); }
.rp-row span { flex: 1; text-align: left; font-size: 13.5px; color: var(--ink-70); }
.rp-row b { font-family: var(--kai); font-size: 18px; color: var(--red); min-width: 64px; text-align: right; }
.rp-row small { font-size: 11px; color: var(--gray); min-width: 72px; text-align: right; }
.rp-diff { margin-top: 8px; font-size: 13.5px; font-weight: 700; }
.rp-diff.up { color: #2f8f5b; } .rp-diff.down { color: var(--red); } .rp-diff.na { color: var(--gray); font-weight: 600; }
.rp-ft { margin-top: 12px; padding-top: 10px; border-top: 2px solid var(--ink); font-family: var(--kai); font-size: 12.5px; color: var(--ink-70); letter-spacing: 2px; }

/* ============ 考试记录 ============ */
.rc-card { padding: 12px 14px; }
.rc-top { display: flex; align-items: baseline; gap: 10px; }
.rc-big b { font-family: var(--kai); font-size: 34px; font-weight: 900; color: var(--red); }
.rc-big span { font-size: 12px; color: var(--gray); margin-left: 2px; }
.rc-big .rc-diff { margin-left: 8px; font-size: 13px; }
.rc-meta { flex: 1; text-align: right; font-size: 11.5px; color: var(--gray); }
.rc-spark { display: block; width: 100%; height: 56px; margin: 10px 0 6px; }
.rc-actions { margin-top: 8px; }
.rc-sec { margin: 16px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: 2px; color: var(--ink-70); border-left: 3px solid var(--red); padding-left: 8px; }
.rc-chart { background: var(--paper-2); border: 1.5px solid var(--ink); padding: 10px; }
.rc-trend { display: block; width: 100%; height: auto; }
.rc-rec { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.rc-rec b { font-family: var(--kai); font-size: 18px; color: var(--red); min-width: 52px; }
.rc-date { color: var(--gray); font-size: 12px; min-width: 118px; }
.rc-det { flex: 1; color: var(--ink-70); font-size: 12px; }
.rc-diff { font-weight: 800; font-size: 12.5px; }
.rc-diff.up { color: #2f8f5b; } .rc-diff.down { color: var(--red); }
.rc-diffrow { display: flex; gap: 10px; align-items: flex-start; padding: 9px 2px; border-bottom: 1px dashed var(--line); }
.rc-dicon { flex-shrink: 0; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 900; }
.rc-dicon.gok { border: 2px solid #2f8f5b; color: #2f8f5b; }
.rc-dicon.gno { border: 2px solid var(--red); color: var(--red); }
.rc-dmain { flex: 1; }
.rc-dlabel { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.rc-dlist { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-chip {
  padding: 4px 10px; font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--ink-45); background: var(--paper-2); color: var(--ink-70);
}
.rc-chip:active { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.rc-none { font-size: 12px; color: var(--gray); }