:root {
  color-scheme: light;
  --ink: #172e32;
  --muted: #51656a;
  --pine: #155752;
  --green: #17665f;
  --border: #d6dfdc;
  --soft: #eef5f2;
  --warn: #8a491f;
  --wrong: #a23732;
  --radius: 16px;
  font: 16px/1.6 "Inter", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: #f4f7f5;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, select, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, summary:focus-visible, select:focus-visible { outline: 3px solid #e1a647; outline-offset: 3px; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { line-height: 1.35; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1rem; }
.wrap { width: min(1140px, calc(100% - 72px)); margin: 0 auto; }
.topbar { background: #173c3d; color: #fff; }
.topbar-inner { min-height: 63px; display: flex; align-items: center; justify-content: space-between; }
.identity, .local-label { display: inline-flex; align-items: center; }
.identity { gap: 12px; font-size: 1.12rem; font-weight: 680; letter-spacing: .035em; }
.app-icon { display: grid; grid-template: repeat(2,5px)/repeat(2,8px); gap: 3px; align-content: center; justify-content: center; width: 31px; height: 32px; border-radius: 7px; background: #c4edcf; transform: rotate(-4deg); }
.app-icon i { border: 1.5px solid #245548; border-radius: 2px; }
.app-icon i:first-child,.app-icon i:last-child { background: #245548; }
.local-label { gap: 9px; font-size: .84rem; font-weight: 550; color: #e0efea; }
.local-label i { width: 8px; height: 8px; border-radius: 50%; background: #93d4ae; }
main.wrap { padding-bottom: 68px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 39px 0 27px; }
.paper-label { color: var(--pine); font-size: .88rem; font-weight: 650; letter-spacing: .045em; }
.page-head h1 { margin: 7px 0 7px; font-size: clamp(2rem,3.3vw,2.7rem); letter-spacing: -.045em; }
#page-intro, .muted, .panel-lead { color: var(--muted); }
.steps { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; white-space: nowrap; }
.steps button { display: inline-flex; background: none; border: 0; align-items: center; gap: 7px; padding: 3px; font-size: .87rem; font-weight: 600; color: var(--muted); }
.steps button span { width: 23px; height: 23px; display: grid; place-items: center; background: #e4eae6; border-radius: 50%; font-size: .77rem; font-variant-numeric: tabular-nums; }
.steps button[aria-current] { color: var(--pine); }
.steps button[aria-current] span { background: var(--pine); color: #fff; }
.steps button:disabled { cursor: default; }
.steps>i { width: 21px; height: 1px; background: #c3d0ca; }
#notice { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; background: #ffefeb; border: 1px solid #edc6be; color: #88322b; border-radius: 9px; padding: 12px 16px; margin-bottom: 16px; white-space: pre-line; }
#notice button { background: transparent; border: 0; color: inherit; font-weight: bold; }
.upload-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(265px,.45fr); gap: 20px; align-items: start; }
.panel { background: white; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 5px 18px #152d2906; }
.upload-panel,.content-panel { padding: 26px; }
.panel-lead { font-size: .92rem; margin: 5px 0 20px; }
.drop-area { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-height: 260px; padding: 24px 15px; border: 1.5px dashed #8cafa1; border-radius: 12px; background: #f3f8f5; transition: background .15s, border-color .15s; }
.drop-area.dragging { border-color: var(--green); background: #e3f2e8; }
.drop-area h3 { margin: 14px 0 2px; font-size: 1.11rem; }
.drop-area>p { font-size: .86rem; color: var(--muted); }
.file-actions { display: flex; gap: 9px; margin-top: 14px; }
.card-art { width: 100px; height: 65px; position: relative; }
.art-front,.art-back { position: absolute; width: 57px; height: 65px; background: white; border: 1.5px solid #6d9084; border-radius: 5px; padding: 8px 6px; box-shadow: 1px 4px 0 #b8cbbd54; }
.art-back { top: 2px; left: 15px; transform: rotate(-15deg); background: #e5f1e8; }
.art-front { top: 0; left: 34px; transform: rotate(10deg); }
.art-front i,.art-back i { display: block; width: 23px; height: 3px; background: #50796a; }
.art-front b,.art-back b { display: block; width: 37px; height: 6px; margin: 4px 0; border: 1px solid #a7c0b1; }
.art-grid { height: 29px; width: 39px; background: radial-gradient(ellipse 2.6px 1.6px at center,#719986 80%,transparent) 0 0/8px 6px; }
.art-check { width: 22px; height: 22px; display: grid; place-items: center; position: absolute; right: 0; bottom: 0; border-radius: 50%; background: #357554; border: 2px solid #f4f8f4; color: white; font: bold 13px/1 system-ui; }
.btn { border-radius: 8px; min-height: 40px; padding: 8px 16px; font-size: .9rem; font-weight: 650; border: 1px solid #c9d6cf; background: white; color: var(--ink); }
.btn:hover:not(:disabled),.tab:hover,.option:hover { background: #eef4f0; }
.btn.primary { background: var(--green); border-color: var(--green); color: white; }
.btn.primary:hover:not(:disabled) { background: #0d514b; }
.btn:disabled { background: #e4eae6; color: #64736e; border-color: #dbe2dc; }
.btn.quiet { min-height: 32px; padding: 4px 10px; font-size: .84rem; }
.camera,.mobile-upload-title { display: none; }
.upload-bottom,.section-head,.dialog-head,.footer-bar,.button-group,.controls,.mini-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.upload-bottom { margin-top: 20px; }
.upload-bottom>span,.footer-bar>span { color: var(--muted); font-size: .9rem; }
.upload-bottom strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.info-panel { overflow: hidden; }
.info-hero { padding: 24px; background: #245756; color: #fff; position: relative; isolation: isolate; overflow: hidden; }
.info-hero::after { content: ""; position: absolute; z-index: -1; width: 165px; height: 165px; right: -77px; top: -55px; border: 1px solid #bfe6cb28; border-radius: 50%; box-shadow: 0 0 0 17px #ffffff08,0 0 0 35px #ffffff08,0 0 0 54px #ffffff08; }
.info-hero>p { color: #d4e6df; font-size: .85rem; }
.info-hero h2 { margin: 6px 0 12px; }
.paper-metrics { display: flex; align-items: center; gap: 18px; line-height: 1; }
.paper-metrics strong { font: 600 1.65rem/1.2 "Inter",Arial,sans-serif; letter-spacing: -.035em; }
.paper-metrics span { color: #dde9e2; font-size: .81rem; margin-left: 4px; }
.paper-metrics i { width: 1px; height: 19px; background: #72918a; }
.info-content { padding: 20px 24px; }
.info-content h3 { font-size: .95rem; }
.page-meta { display: flex; gap: 11px; align-items: center; margin-top: 14px; }
.page-no { display: grid; place-items: center; border: 1px solid #d3e1d7; background: #edf4ed; width: 34px; height: 34px; border-radius: 7px; font: 600 .88rem/1 "Inter",Arial,sans-serif; color: #396051; }
.page-meta strong,.page-meta small { display: block; }
.page-meta strong { font-size: .9rem; }
.page-meta small { color: var(--muted); font-size: .8rem; }
.hint { margin-top: 18px; padding-top: 15px; border-top: 1px solid #e0e7e2; }
.hint p,.help { color: var(--muted); font-size: .86rem; line-height: 1.65; margin-top: 5px; }
#file-progress,.info-note { padding: 10px 13px; background: #edf5ef; color: var(--pine); border-radius: 8px; margin-top: 13px; font-size: .92rem; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #e2e8e3; }
.file-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.file-main>div { min-width: 0; }
.file-thumb { width: 46px; height: 33px; object-fit: contain; background: #f3f5f4; border: 1px solid var(--border); border-radius: 4px; }
.file-main strong,.file-main small { display: block; }
.file-main strong { font-size: .9rem; }
.file-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.mini-actions { gap: 5px; flex-shrink: 0; }
.text-btn { font-size: .86rem; font-weight: 600; padding: 6px; border: 0; color: var(--pine); background: transparent; }
.text-btn:hover { text-decoration: underline; }
.controls { flex-wrap: wrap; margin: 18px 0 8px; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 5px; padding: 4px; border: 1px solid #d9e3dc; background: #f4f7f4; border-radius: 9px; }
.tab { font-size: .86rem; padding: 5px 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 600; }
.tab.active { color: var(--pine); border-color: #d7e3da; background: white; box-shadow: 0 1px 2px #19362e0c; }
.review-list,.question-list { margin-top: 10px; }
.review-item { display: grid; grid-template-columns: minmax(230px,.9fr) minmax(270px,1.1fr); gap: 8px 22px; align-items: center; border-top: 1px solid #e0e7e1; padding: 15px 0; }
.q-summary { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.q-summary strong { font-size: .96rem; }
.crop { display: block; width: min(100%,400px); height: auto; border: 1px solid #d8dfdb; border-radius: 4px; }
.tag { font-size: .78rem; font-weight: 650; border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.tag.warn { background: #fff0df; color: var(--warn); }
.tag.wrong { background: #fcece8; color: var(--wrong); }
.tag.good { background: #e4f1e7; color: var(--pine); }
.tag.blank { background: #eef1f1; color: #526066; }
.choices { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.option { min-height: 34px; min-width: 35px; padding: 3px 8px; border: 1px solid #cbd8d0; background: white; border-radius: 6px; font-weight: 600; font-size: .88rem; }
.option.chosen { border-color: var(--green); background: var(--green); color: white; }
.option.mode { color: var(--muted); font-weight: 500; }
.option.mode.chosen { color: var(--pine); border: 1px solid #a0bdae; background: #e5f2e9; }
.confirm-row { margin-top: 7px; display: flex; gap: 10px; align-items: center; }
.confirm-row .text-btn { padding: 2px 4px; }
.empty { padding: 27px 14px; color: var(--muted); text-align: center; font-size: .93rem; }
.pager { display: flex; justify-content: flex-end; gap: 9px; align-items: center; padding: 12px 0 0; color: var(--muted); font-size: .84rem; }
.pager:empty { display: none; }
.footer-bar { padding-top: 17px; margin-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.button-group { justify-content: flex-start; flex-wrap: wrap; gap: 7px; }
.results-summary { display: grid; grid-template-columns: minmax(190px,.75fr) 1.25fr; align-items: center; color: white; padding: 23px 28px; background: #245756; border-radius: var(--radius); gap: 20px; }
.summary-title { margin-bottom: 3px; font-size: .93rem; color: #dbebe2; }
.score-line { display: flex; align-items: baseline; gap: 8px; line-height: 1.2; }
.score-line strong { font: 650 clamp(2.4rem,5vw,3.6rem)/1.08 "Inter",Arial,sans-serif; letter-spacing: -.06em; }
.score-line span { font-size: .9rem; color: #e0ece6; }
.summary-figures { display: flex; align-items: center; justify-content: space-evenly; border-left: 1px solid #72928a; }
.summary-figures div { display: grid; text-align: center; }
.summary-figures strong { font: 600 1.65rem/1.25 "Inter",Arial,sans-serif; }
.summary-figures span { font-size: .85rem; color: #dbe9e1; }
.results-stack { display: grid; gap: 16px; margin-top: 16px; }
.score-table { width: 100%; border-collapse: collapse; font-size: .91rem; margin-top: 12px; }
.score-table th,.score-table td { padding: 7px 9px; text-align: right; border-bottom: 1px solid #e2e8e3; font-variant-numeric: tabular-nums; }
.score-table th { color: #4a6259; font-size: .83rem; background: #f0f5f0; }
.score-table th:first-child,.score-table td:first-child { text-align: left; }
.score-table tbody tr:last-child td { border-bottom: none; }
.question { border-top: 1px solid #dce4de; }
.question summary { display: grid; grid-template-columns: 70px minmax(95px,.75fr) minmax(170px,1fr) auto 14px; gap: 10px; align-items: center; padding: 12px 0; cursor: pointer; list-style: none; font-size: .88rem; }
.question summary::-webkit-details-marker { display: none; }
.question summary::after { content: ""; justify-self: center; width: 7px; height: 7px; border: solid #6f8478; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.question[open] summary::after { transform: rotate(225deg); }
.question .q-section,.answer-pair { color: var(--muted); }
.answer-pair { display: flex; flex-wrap: wrap; gap: 10px; }
.answer-pair b { color: var(--ink); }
.explanation { padding: 0 12px 15px; font-size: .91rem; color: #334946; line-height: 1.8; overflow-wrap: anywhere; }
.explanation h3 { margin: 6px 0; }
.explanation p { margin: 5px 0; white-space: pre-line; }
.explanation img,.explanation svg,.explanation table { max-width: 100%; height: auto; }
.explanation math { overflow-wrap: normal; }
dialog { width: min(900px,95vw); max-height: 90vh; padding: 15px; border: 1px solid var(--border); border-radius: 12px; color: var(--ink); }
dialog::backdrop { background: #0f2121aa; }
.dialog-head { margin-bottom: 8px; }
dialog img { display: block; width: 100%; height: auto; }
#print-report { display: none; }
@media (pointer:coarse), (max-width:650px) {
  .camera { display: inline-flex; align-items: center; }
  .mobile-upload-title { display: inline; }
  .desktop-upload-title { display: none; }
}
@media (max-width:850px) {
  .wrap { width: calc(100% - 38px); }
  .upload-layout { grid-template-columns: minmax(0,1.6fr) minmax(240px,1fr); gap: 12px; }
  .upload-panel,.content-panel { padding: 20px; }
  .info-hero,.info-content { padding: 18px; }
  .page-head { flex-wrap: wrap; gap: 15px; padding: 25px 0 20px; }
  .steps { margin: 0; }
}
@media (max-width:650px) {
  .wrap { width: calc(100% - 28px); }
  .topbar-inner { min-height: 53px; }
  .page-head { display: grid; padding-top: 21px; }
  .page-head h1 { font-size: 2rem; }
  #page-intro { font-size: .9rem; }
  .upload-layout { display: grid; grid-template-columns: 1fr; }
  .upload-panel,.content-panel { padding: 16px; }
  .drop-area { min-height: 215px; }
  .review-item { grid-template-columns: 1fr; }
  .crop { width: min(100%,450px); }
  .section-head { flex-wrap: wrap; }
  .controls { gap: 7px; }
  .results-summary { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .summary-figures { border-left: none; border-top: 1px solid #72928a; padding-top: 13px; justify-content: space-between; }
  .score-table th,.score-table td { padding: 7px 3px; font-size: .81rem; }
  .question summary { grid-template-columns: 58px minmax(84px,1fr) auto 13px; gap: 4px 7px; }
  .question .answer-pair { grid-column: 1/5; grid-row: 2; }
  .question summary::after { grid-column: 4; grid-row: 1; }
  .footer-bar { align-items: flex-start; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition: none !important; } }
@media print {
  @page { size: A4; margin: 15mm; }
  :root,body { background: white; color: black; font: 10pt/1.45 "Microsoft YaHei",sans-serif; }
  body > :not(#print-report) { display: none !important; }
  #print-report { display: block; }
  #print-report h1 { font-size: 19pt; margin: 0 0 4mm; }
  #print-report h2 { font-size: 13pt; margin: 6mm 0 2mm; }
  #print-report table { border-collapse: collapse; width: 100%; margin-top: 2mm; }
  #print-report th,#print-report td { padding: 2mm; border-bottom: 1px solid #bbb; text-align: left; }
  #print-report thead { display: table-header-group; }
  #print-report tr { break-inside: avoid; }
}
