/* 全局色彩、字体与移动端安全区域。 */
:root { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; color: #183c32; background: #f5f7f2; line-height: 1.6; font-synthesis: none; --green: #286e57; --muted: #708077; --line: #e0e7dd; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; }
button:disabled { opacity: .4; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #cc9154; outline-offset: 3px; }
.shell { width: min(940px, calc(100% - 48px)); margin: auto; padding: 32px 0 100px; }
.topbar, .brand, .section-heading, .count-row, .resume-banner, .little-note, .exam-toolbar, .exam-progress, .exam-actions, .result-actions, .wrong-controls, .review-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { justify-content: flex-start; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 14px; background: #204e3d; color: #f4efdb; font-weight: 800; font-size: 22px; }
.brand b, .brand small { display: block; }
.brand b { font-size: 19px; letter-spacing: 2px; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: 1px; }
.local-badge { font-size: 11px; color: var(--muted); }
.local-badge i { display: inline-block; width: 6px; height: 6px; margin-right: 7px; background: #6c9873; border-radius: 50%; }
.hero { display: flex; justify-content: space-between; align-items: center; padding: 62px 15px 54px; }
.eyebrow { color: #a57547; font-size: 10px; font-weight: 700; letter-spacing: 2px; }
.hero h1 { margin: 18px 0; font-size: clamp(40px, 6vw, 62px); line-height: 1.18; letter-spacing: -2px; }
.hero em { font-style: normal; color: #507b5c; }
.hero p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.hero-facts { display: flex; gap: 28px; margin-top: 23px; color: var(--muted); font-size: 12px; }
.hero-facts b { color: var(--green); margin-right: 5px; font-size: 20px; }
/* 使用 CSS 绘制卡片插画，无外部图片依赖。 */
.hero-art { width: 310px; height: 280px; position: relative; }
.art-orbit { position: absolute; inset: 12px 0; border: 1px solid #d9e2ca; border-radius: 50%; transform: rotate(-22deg); background: #eaf0e0; }
.art-card { position: absolute; width: 172px; height: 226px; border-radius: 15px; }
.back-card { left: 50px; top: 17px; background: #a7baa0; transform: rotate(-12deg); }
.front-card { left: 100px; top: 36px; padding: 21px; background: #fffdf4; box-shadow: 0 18px 30px #314b3220; transform: rotate(8deg); }
.front-card>span, .front-card>small { font-size: 7px; letter-spacing: 1px; color: #85947b; }
.front-card b { display: block; font-size: 22px; line-height: 1.5; margin: 18px 0 12px; }
.art-line { width: 95px; height: 3px; background: #e0e6d5; margin-top: 7px; }
.art-line.short { width: 68px; }
.art-check { position: absolute; right: 18px; bottom: 22px; width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; background: #54795b; color: white; }
.front-card>small { position: absolute; bottom: 15px; left: 18px; font-size: 6px; }
.art-star { position: absolute; left: 25px; bottom: 18px; color: #c18f58; font-size: 36px; }
.panel, .file-panel, .review-item { background: #fff; padding: 30px; border: 1px solid var(--line); border-radius: 22px; }
.panel { box-shadow: 0 12px 35px #243f2c05; }
.section-heading>div { display: flex; align-items: center; gap: 12px; }
h2 { font-size: 19px; margin: 0; }
.step { font-size: 12px; color: #829477; border: 1px solid #dfe6d7; padding: 2px 7px; border-radius: 7px; }
.text-button { background: none; color: var(--green); font-size: 12px; min-height: 44px; }
.section-help, .muted { font-size: 12px; color: var(--muted); }
.section-help { margin: 5px 0 18px; }
.bank-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-bottom: 24px; background: #edf2e7; border-radius: 8px; }
.mode-switch button { min-height: 44px; background: transparent; color: var(--muted); border-radius: 5px; font-size: 14px; }
.mode-switch button[aria-pressed="true"] { background: var(--green); color: white; font-weight: 600; }
.bank-spacing { height: 18px; }
.type-filter { display: flex; flex-wrap: wrap; gap: 8px 24px; min-width: 0; margin: 24px 0 0; padding: 0; border: 0; }
.type-filter legend { margin-bottom: 8px; padding: 0; font-size: 16px; font-weight: 600; }
.type-filter label { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: 14px; }
.type-filter input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.bank-card:has(input[type="radio"]) .checkmark { border-radius: 50%; }
.bank-card { display: flex; align-items: center; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; position: relative; }
.bank-card:has(input:checked) { background: #f6f9f2; border-color: #adc2a8; }
.bank-card input { position: absolute; opacity: 0; width: 1px; }
.bank-card:focus-within { outline: 2px solid #bc915f; }
.bank-icon { flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #e8efdf; color: #638158; font-weight: 700; }
.tone-1 .bank-icon { background: #faebe3; color: #b17863; }
.tone-2 .bank-icon { background: #f4eedb; color: #a08b49; }
.tone-3 .bank-icon { background: #e7edef; color: #64858d; }
.bank-copy { flex: 1; min-width: 0; }
.bank-copy b { display: block; font-size: 14px; }
.bank-copy small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.checkmark { display: grid; place-items: center; width: 19px; height: 19px; border: 1px solid #d5dfcf; border-radius: 5px; color: transparent; font-size: 12px; }
.bank-card:has(input:checked) .checkmark { background: #59845d; border-color: #59845d; color: white; }
.divider { height: 1px; background: #edf0e8; margin: 29px 0; }
.count-row { justify-content: flex-start; margin: 20px 0; }
.presets { display: flex; gap: 9px; }
.presets button { background: #f7f8f4; color: #647261; border: 1px solid #e0e5d9; padding: 10px 19px; border-radius: 9px; min-height: 46px; }
.presets button.chosen { background: #eef4e8; border-color: #9ab392; color: #3e6f47; }
.presets small { font-size: 11px; }
.custom-count { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; color: var(--muted); }
.custom-count input { width: 77px; border: 1px solid var(--line); border-radius: 9px; padding: 10px; background: white; color: #2a5940; text-align: center; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 15px; min-height: 46px; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.primary { background: #2d6149; color: #fff; }
.primary:hover { background: #224e39; }
.secondary { color: #416047; background: #edf2e7; }
.start-button { width: 100%; margin-top: 5px; min-height: 53px; }
.start-button span { font-size: 21px; }
.under-button { font-size: 10px; text-align: center; color: #76856f; margin: 12px 0 0; }
.little-note, .resume-banner { padding: 18px 22px; background: #eaf0e2; border-radius: 14px; margin-top: 18px; }
.little-note>span { font-size: 28px; color: #688765; }
.little-note>div { flex: 1; }
.little-note b, .resume-banner b { font-size: 13px; }
.little-note p, .resume-banner small { font-size: 11px; color: var(--muted); margin: 3px 0; display: block; }
.little-note a, .resume-banner button { font-size: 12px; color: #456648; background: none; white-space: nowrap; }
.resume-banner { margin: 0 0 18px; }
footer { text-align: center; color: #74836d; font-size: 10px; margin-top: 28px; }
.source-notice { margin: 0 0 18px; color: #7e7959; font-size: 11px; padding: 12px 16px; background: #f2efdf; border-radius: 10px; overflow-wrap: anywhere; }
.source-notice summary { cursor: pointer; }
.source-notice p { margin: 7px 0; }
/* 答题卡、选项和底部翻题操作。 */
.exam-toolbar { margin-top: 25px; }
.exam-progress { margin-top: 20px; }
.exam-progress b { font-size: 23px; }
.exam-progress span, .exam-progress small { font-size: 12px; color: var(--muted); }
.progress-track { background: #e1e8d9; height: 5px; border-radius: 6px; margin: 13px 0 25px; }
.progress-track i { display: block; height: 100%; background: #769467; border-radius: inherit; transition: width .2s; }
.answer-card { display: flex; gap: 9px; flex-wrap: wrap; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 18px; max-height: 270px; overflow: auto; }
.answer-card button { width: 44px; height: 44px; background: #f1f4eb; color: #6c7b63; border-radius: 7px; }
.answer-card .answered { background: #dce9d2; color: #3c6c37; }
.answer-card .current { outline: 2px solid #b18a53; }
.question-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.question-meta small { font-size: 11px; color: var(--muted); }
.type-badge, .wrong-count { background: #f3eedf; color: #9b7c48; padding: 4px 8px; border-radius: 5px; font-size: 11px; }
.question-panel h1 { font-size: 24px; line-height: 1.7; margin: 22px 0 8px; overflow-wrap: anywhere; }
.options { display: grid; gap: 12px; margin-top: 22px; }
.option { display: flex; text-align: left; align-items: center; gap: 13px; width: 100%; padding: 17px; border: 1px solid #e0e6dc; border-radius: 11px; background: #fff; color: #435944; font-size: 15px; }
.option-letter { flex: 0 0 30px; height: 30px; background: #f1f4eb; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.option.selected { border-color: #90af84; background: #f2f7eb; }
.selected .option-letter { background: #567d4f; color: white; }
.option>span:nth-child(2) { overflow-wrap: anywhere; min-width: 0; }
.option-tick { margin-left: auto; color: #507942; visibility: hidden; }
.selected .option-tick { visibility: visible; }
.exam-actions { margin-top: 22px; }
.exam-actions>button { min-width: 140px; }
.submit-early { display: block; margin: 15px auto 0; }
/* 判分结果、完整错题详情与文件备份工具。 */
.score-panel { background: #28533e; border-radius: 20px; color: #fcfbec; text-align: center; padding: 35px; margin-top: 30px; }
.score-panel .eyebrow { color: #c5d4ae; }
.score-panel h1 { font-size: 23px; font-weight: 500; }
.score-number { font-size: 78px; font-weight: 700; line-height: 1.2; }
.score-number small { font-size: 25px; }
.score-panel p { color: #cad7ba; font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 15px 0 23px; }
.stats>div { text-align: center; padding: 20px 8px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.stats b { display: block; font-size: 30px; }
.stats small { display: block; color: var(--muted); font-size: 11px; }
.stats .bad { color: #b06c4f; }
.stats .good { color: #4e7d41; }
.result-actions>* { flex: 1; }
.review-heading { margin: 35px 0 15px; }
.review-item { margin: 15px 0; }
.review-item h3 { font-size: 17px; line-height: 1.7; margin: 16px 0; }
.review-options { padding: 0; list-style: none; color: #63745c; font-size: 13px; }
.review-options li { padding: 6px 0; }
.review-options b { margin-right: 6px; }
.correct-option, .correct-text { color: #397334; }
.answer-detail { padding: 12px 15px; background: #f5f7f0; border-radius: 9px; font-size: 12px; }
.answer-detail p { margin: 8px 0; }
.answer-detail span { display: block; font-size: 10px; color: #74826a; margin-bottom: 3px; }
.analysis { font-size: 12px; color: #6d7b63; line-height: 1.8; }
.wrong-hero { display: flex; align-items: center; justify-content: space-between; padding: 42px 10px 30px; }
.wrong-hero h1 { font-size: 35px; line-height: 1.3; margin: 10px 0; }
.wrong-total { padding: 15px 25px; border-radius: 15px; background: #e4ecd8; color: #5d7f48; text-align: center; }
.wrong-total b { display: block; font-size: 40px; line-height: 1.3; }
.wrong-total span { font-size: 11px; }
.file-panel { padding: 22px; }
.file-panel>div:first-child { display: flex; align-items: center; gap: 12px; }
.file-icon { display: grid; place-items: center; width: 43px; height: 48px; background: #eaf0df; color: #6a8656; border-radius: 8px; font-size: 10px; font-weight: 700; }
.file-panel b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.file-panel small { display: block; font-size: 10px; color: var(--muted); }
.file-panel p { font-size: 12px; color: var(--muted); }
.file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.file-actions button { font-size: 12px; }
.wrong-controls { margin-top: 25px; align-items: flex-end; }
.search-box { flex: 1; font-size: 11px; color: var(--muted); }
.search-box input { display: block; width: 100%; min-width: 0; border: 1px solid var(--line); padding: 12px; border-radius: 9px; margin-top: 4px; font-size: 14px; }
.review-footer { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 10px; }
.review-footer small, .storage-note { font-size: 10px; color: var(--muted); }
.empty-state { text-align: center; padding: 55px 20px; background: white; border-radius: 16px; margin-top: 20px; color: #6e805e; }
.empty-state b { font-size: 20px; }
.empty-state p, .empty-state a { font-size: 13px; }
.bottom-nav { display: flex; gap: 35px; justify-content: center; margin-top: 25px; }
.bottom-nav a { font-size: 12px; color: #6b7d61; }
.bottom-nav span { margin-right: 5px; }
.bottom-nav b { font-size: 10px; padding: 2px 6px; border-radius: 5px; background: #e1e9d6; }
.bottom-nav .active { font-weight: 700; color: #2b5d3d; }
.warning { color: #9b6b3d !important; background: #faf0db; padding: 10px; border-radius: 7px; }
.boot { text-align: center; padding: 35vh 15px; color: #6f8762; }
#toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); padding: 13px 20px; background: #233d2fee; color: white; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 30; }
#toast.show { opacity: 1; }
dialog { width: min(430px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 20px; padding: 26px; color: #29452e; }
dialog::backdrop { background: #1a2e2370; backdrop-filter: blur(3px); }
dialog p { font-size: 14px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
/* 手机 320px 起适配，操作区为触控保留空间并避开底部手势条。 */
@media (max-width: 620px) {
  .shell { width: calc(100% - 28px); padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .brand { gap: 9px; }
  .brand b { font-size: 17px; }
  .brand small { font-size: 8px; letter-spacing: 0; }
  .local-badge { font-size: 9px; }
  .hero { padding: 34px 3px 28px; gap: 0; }
  .hero h1 { font-size: 38px; letter-spacing: -1px; }
  .hero .eyebrow { font-size: 7px; letter-spacing: 1px; }
  .hero p:not(.eyebrow) { font-size: 12px; }
  .hero-art { display: none; }
  .hero-facts { gap: 17px; font-size: 10px; }
  .hero-facts b { font-size: 17px; }
  .panel { padding: 19px; border-radius: 18px; }
  .bank-grid { grid-template-columns: 1fr; gap: 10px; }
  .bank-card { padding: 13px 11px; gap: 10px; }
  .bank-copy b { font-size: 13px; }
  .count-row { flex-wrap: wrap; gap: 13px; }
  .presets { flex: 1; }
  .presets button { flex: 1; padding: 10px 15px; }
  .custom-count { margin: 0; width: 100%; justify-content: flex-end; }
  .custom-count input { width: 90px; }
  .little-note { gap: 9px; padding: 17px 14px; }
  .little-note>span { display: none; }
  .little-note p { font-size: 10px; }
  .resume-banner { padding: 15px; gap: 6px; }
  .resume-banner small { font-size: 10px; }
  .section-heading h2 { font-size: 17px; }
  .question-panel h1 { font-size: 20px; }
  .option { padding: 15px 12px; font-size: 14px; gap: 10px; }
  .exam-actions>button { min-width: 0; flex: 1; }
  .wrong-hero { padding: 32px 0 25px; }
  .wrong-hero h1 { font-size: 27px; }
  .wrong-hero .eyebrow { font-size: 8px; }
  .wrong-total { padding: 12px 17px; }
  .wrong-total b { font-size: 32px; }
  .file-panel { padding: 18px; }
  .file-actions>button { flex: 1; padding: 10px; font-size: 11px; }
  .wrong-controls { gap: 8px; }
  .wrong-controls .primary { font-size: 12px; padding: 13px 12px; }
  .review-item { padding: 18px; }
  .review-item h3 { font-size: 15px; }
  .review-footer { flex-wrap: wrap; gap: 5px; }
  .result-actions { gap: 8px; }
  .result-actions>* { padding: 12px 8px; font-size: 13px; }
  .score-number { font-size: 62px; }
  .stats { gap: 8px; }
  .stats small { font-size: 9px; }
  .bottom-nav { position: fixed; left: 12px; right: 12px; bottom: 0; z-index: 10; display: flex; justify-content: space-around; border: 1px solid var(--line); border-bottom: none; border-radius: 17px 17px 0 0; background: #fffffff5; backdrop-filter: blur(12px); padding: 11px 15px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -5px 18px #38573308; }
  .bottom-nav a { min-width: 95px; min-height: 43px; font-size: 11px; text-align: center; }
  .bottom-nav span { display: block; font-size: 20px; line-height: 25px; margin: 0; }
}
