/* 找错练习：叠在 styles.css 之上 */

#proofView { max-width: 720px; margin: 0 auto; }

/* ── 开始页 ── */
.proof-start { display: flex; flex-direction: column; align-items: center; padding: 28px 8px 8px; text-align: center; }
.proof-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 8px; }
.proof-lead { font-size: 14px; line-height: 1.7; color: var(--ink-2); margin: 0 0 18px; max-width: 460px; }
.proof-rules { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.proof-rule { font-size: 12px; font-weight: 600; color: var(--indigo); background: rgba(79,70,229,0.08); border-radius: 999px; padding: 4px 11px; }

.speed-row { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.speed-label { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.speed-group { display: flex; background: rgba(0,0,0,0.06); border-radius: 9px; padding: 3px; }
.speed-btn {
  border: none; background: transparent; color: var(--ink-2); font-family: inherit;
  font-size: 14px; font-weight: 500; padding: 7px 22px; border-radius: 7px; cursor: pointer;
  min-height: 36px; touch-action: manipulation;
}
.speed-btn.on { background: var(--card); color: var(--ink-1); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

.proof-history { width: 100%; margin-top: 30px; text-align: left; }
.proof-history h3 { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.8px; margin: 0 0 10px; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--fill); font-size: 13px; }
.hist-row:last-child { border-bottom: none; }
.hist-link { color: inherit; text-decoration: none; min-height: 44px; }
.hist-go { flex: 0 0 12px; color: var(--ink-3); font-size: 18px; }
.hist-date { flex: 0 0 46px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hist-style { flex: 0 0 52px; color: var(--ink-2); font-weight: 600; }
.hist-f1 { flex: 0 0 56px; font-weight: 800; color: var(--indigo); font-variant-numeric: tabular-nums; }
.hist-pr { flex: 1; text-align: right; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.type-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.type-name { flex: 0 0 104px; font-weight: 600; color: var(--ink-1); }
.type-track { flex: 1; height: 6px; background: var(--fill); border-radius: 3px; overflow: hidden; }
.type-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--indigo), var(--blue)); }
.type-fill.low { background: var(--rose); }
.type-num { flex: 0 0 72px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 12px; }

/* ── 做题页 ── */
.proof-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.proof-chip { font-size: 12px; font-weight: 700; color: var(--indigo); background: rgba(79,70,229,0.1); border-radius: 999px; padding: 3px 11px; }
.proof-marked { font-size: 12px; font-weight: 700; color: var(--rose); background: rgba(220,38,38,0.08); border-radius: 999px; padding: 3px 11px; font-variant-numeric: tabular-nums; }
.proof-prog { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.proof-bar { height: 2px; background: var(--ink-4); border-radius: 1px; overflow: hidden; margin-bottom: 14px; }
.proof-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--indigo), var(--blue)); transition: width 0.5s cubic-bezier(0.25,1,0.5,1); }

.proof-window {
  background: #FFFDF7; border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 18px; box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
.proof-viewport {
  --lh: 36px;
  position: relative; height: calc(var(--lh) * 5); overflow: hidden;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 21px; line-height: var(--lh); color: var(--ink-1);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
}
.proof-viewport::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; z-index: 2; pointer-events: none;
  background: linear-gradient(#FFFDF7, rgba(255,253,247,0));
}
.proof-flow { transition: transform 0.45s cubic-bezier(0.25,1,0.5,1); will-change: transform; }
.sent { animation: sentIn 0.5s ease both; }
@keyframes sentIn { from { opacity: 0; } to { opacity: 1; } }
.brk { display: block; height: 0; }
.indent { display: inline-block; width: 1.6em; }

.w { border-radius: 4px; padding: 0 1px; margin: 0 -1px; cursor: pointer; transition: background 0.08s ease; }
.w.on {
  background: rgba(220,38,38,0.16);
  text-decoration: underline wavy var(--rose); text-decoration-thickness: 2px; text-underline-offset: 4px;
}

.proof-hint { font-size: 12px; color: var(--ink-3); text-align: center; margin: 12px 0 0; line-height: 1.6; }
.proof-actions { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.btn-done {
  background: var(--ink-1); color: #fff; border: none; border-radius: var(--r-md);
  padding: 13px 46px; font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; min-height: 48px;
}
.btn-done:disabled { background: var(--ink-4); cursor: default; }
.btn-done:not(:disabled):active { transform: scale(0.98); }
.proof-auto { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 92px; }
.proof-auto.fail { color: var(--rose); font-weight: 700; font-size: 13px; line-height: 1.5; max-width: 220px; min-width: 0; }
.proof-fail-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(220,38,38,0.1); color: var(--rose); font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.proof-fail { color: var(--ink-1); font-size: 15px; font-weight: 600; }

/* ── 结果页 ── */
.result-head { text-align: center; padding: 6px 0 18px; }
.result-f1 { font-size: 72px; font-weight: 800; letter-spacing: -3px; line-height: 1; color: var(--indigo); font-variant-numeric: tabular-nums; }
.result-f1 small { font-size: 28px; letter-spacing: 0; margin-left: 2px; }
.result-label { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; color: var(--ink-3); margin-top: 6px; }
.result-word { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-top: 8px; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 6px 0 4px; }
.result-cell { background: var(--fill-2); border-radius: var(--r-md); padding: 12px 10px; text-align: center; }
.result-cell b { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-1); }
.result-cell span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.result-counts { display: flex; justify-content: center; gap: 18px; font-size: 13px; font-weight: 600; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.c-tp { color: var(--emerald); }
.c-fn { color: var(--amber); }
.c-fp { color: var(--rose); }

.result-title { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.8px; margin: 26px 0 10px; }
.result-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.result-essay { background: #FFFDF7; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px 2px; }
.result-essay p { margin: 0 0 14px; font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 17px; line-height: 1.95; color: var(--ink-1); }
.rw { border-radius: 4px; padding: 1px 1px; }
.r-hit { background: rgba(5,150,105,0.18); }
.r-miss { background: rgba(217,119,6,0.26); text-decoration: underline wavy var(--amber); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.r-fp { background: rgba(220,38,38,0.12); text-decoration: line-through; color: var(--ink-3); }

.err-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 4px 10px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--fill); }
.err-row:last-child { border-bottom: none; }
.err-mark { font-size: 15px; font-weight: 800; text-align: center; }
.err-row.ok .err-mark { color: var(--emerald); }
.err-row.no .err-mark { color: var(--amber); }
.err-fix { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 16px; color: var(--ink-1); }
.err-fix s { color: var(--rose); text-decoration-thickness: 2px; }
.err-fix b { color: var(--emerald); }
.err-type { font-size: 11px; font-weight: 700; color: var(--indigo); background: rgba(79,70,229,0.08); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.err-note { grid-column: 2 / 4; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.fp-list { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 15px; color: var(--ink-2); line-height: 1.9; }
.fp-list span { background: rgba(220,38,38,0.1); border-radius: 4px; padding: 1px 6px; margin-right: 6px; white-space: nowrap; }

.result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.result-actions .btn-start { padding: 14px 40px; }
.link-log { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--indigo); text-decoration: none; }

/* ── 复盘本 ── */
#logView { max-width: 720px; margin: 0 auto; }
.log-head { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.log-head div { background: var(--fill-2); border-radius: var(--r-md); padding: 12px 10px; text-align: center; }
.log-head b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-1); }
.log-head span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.trend { display: flex; align-items: flex-end; gap: 6px; height: 96px; padding: 4px 2px 0; margin-bottom: 14px; }
.trend-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.trend-bar { width: 100%; max-width: 26px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--blue), var(--indigo)); }
.trend-col span { font-size: 10px; color: var(--ink-3); margin-top: 4px; font-variant-numeric: tabular-nums; }
.focus-box { background: rgba(79,70,229,0.07); border-radius: var(--r-md); padding: 14px 16px; }
.focus-title { font-size: 12px; font-weight: 700; color: var(--indigo); margin-bottom: 6px; }
.focus-body { font-size: 14px; line-height: 1.75; color: var(--ink-1); }
.log-item { padding: 12px 0; border-bottom: 1px solid var(--fill); }
.log-item:last-child { border-bottom: none; }
.log-ctx { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 16px; line-height: 1.8; color: var(--ink-1); margin-bottom: 6px; }
.ctx-miss { background: rgba(217,119,6,0.26); text-decoration: underline wavy var(--amber); text-decoration-thickness: 2px; text-underline-offset: 4px; border-radius: 4px; padding: 0 1px; }
.ctx-fp { background: rgba(220,38,38,0.12); text-decoration: line-through; color: var(--ink-3); border-radius: 4px; padding: 0 1px; }
.log-fix { font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 15px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.log-fix s { color: var(--rose); text-decoration-thickness: 2px; }
.log-fix b { color: var(--emerald); }
.log-count { font-family: -apple-system, system-ui, sans-serif; font-size: 11px; font-weight: 700; color: var(--amber); }
.log-count.cleared { color: var(--emerald); }
.log-empty { font-size: 13px; color: var(--ink-3); margin: 6px 0 2px; }
.log-sub { font-size: 12px; font-weight: 700; color: var(--ink-2); margin: 14px 0 2px; }
.run-card { border-bottom: 1px solid var(--fill); }
.run-card summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; font-size: 13px; cursor: pointer; list-style: none; min-height: 44px; }
.run-card summary::-webkit-details-marker { display: none; }
.run-body { padding: 0 0 12px; }

@media (max-width: 480px) {
  .proof-viewport { --lh: 32px; font-size: 18px; }
  .proof-window { padding: 12px 14px; }
  .result-f1 { font-size: 60px; }
  .type-name { flex-basis: 92px; }
}
