:root {
  --navy: #1f3a68;
  --navy-dark: #172b4d;
  --blue: #2f5aa8;
  --blue-soft: #eaf0fb;
  --ink: #1d2533;
  --muted: #6b7688;
  --line: #e4e9f2;
  --bg: #f4f6fa;
  --white: #fff;
  --green: #2e9e6b;
  --red: #d9534f;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(31, 58, 104, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, #eef2f9 0%, var(--bg) 240px, var(--bg) 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}
.hidden { display: none !important; }

.page {
  width: min(100% - 28px, 520px);
  margin: 0 auto;
  padding: 34px 0 40px;
}
.page-wide { width: min(100% - 28px, 760px); }

.hero { text-align: center; padding: 6px 4px 22px; }
.hero-school {
  color: var(--navy);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
}
.hero-exam { color: var(--muted); font-size: 15px; margin-top: 4px; }
.hero-title { font-size: 30px; line-height: 1.35; margin: 22px 0 12px; letter-spacing: 1px; }
.hero-rule { width: 46px; height: 3px; background: var(--navy); border-radius: 2px; margin: 0 auto; opacity: .85; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-bottom: 18px;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid #d8dfeb;
  border-radius: 10px;
  background: #fbfcfe;
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 90, 168, .12); }
.field input::placeholder { color: #a0a9b8; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s, background .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--blue); }
.btn-ghost { background: #f4f7fc; color: var(--navy); border-color: #d9e1ee; }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-block { width: 100%; height: 50px; font-size: 16px; margin-top: 4px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn { flex: 1 1 auto; }

.msg { margin: 12px 0 0; font-size: 14px; min-height: 20px; text-align: center; }
.msg-error { color: var(--red); }
.msg-ok { color: var(--green); }

.result-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.result-head .check {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  background: #e4f6ec; color: var(--green); display: grid; place-items: center; font-weight: 800; font-size: 18px;
}
.result-head h2 { margin: 0; font-size: 18px; color: var(--navy); }
.result-head p { margin: 0; font-size: 13px; color: var(--muted); }

.info-list { margin: 14px 0; }
.info-list > div { display: flex; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.info-list > div:last-child { border-bottom: 0; }
.info-list dt { width: 74px; flex: 0 0 74px; color: var(--muted); }
.info-list dd { margin: 0; font-weight: 600; word-break: break-all; }

.sub-title { font-size: 16px; color: var(--navy); margin: 20px 0 10px; }
.notice { background: #fff8e8; border-left: 3px solid #e6a23c; border-radius: 6px; padding: 10px 12px; font-size: 13px; color: #7a5a20; margin: 12px 0; }

.table-wrap { overflow-x: auto; }
.score-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.score-table th, .score-table td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.score-table th { color: var(--muted); font-weight: 600; background: #fafbfd; }
.score-table td strong { color: var(--navy); font-size: 15px; }
.bar { display: block; height: 4px; border-radius: 2px; background: #e9eef6; margin-top: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); }

.page-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.page-thumb {
  display: grid; place-items: center; min-height: 74px; border-radius: 8px;
  background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none;
}

.file-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #f8fafd; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 18px;
}
.file-icon {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 10px;
  background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800;
}
.file-meta { flex: 1 1 130px; min-width: 0; }
.file-name { font-size: 14px; font-weight: 700; word-break: break-all; }
.file-sub { font-size: 12px; color: var(--muted); }
.file-card .btn { flex: 1 1 100%; margin-top: 4px; }
.link-more { display: block; text-align: center; margin-top: 14px; color: var(--blue); font-size: 14px; text-decoration: none; }

.steps-title { font-size: 16px; color: var(--navy); margin: 0 0 12px; }
.steps ol { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.step-no {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue); display: inline-grid; place-items: center;
  font-size: 13px; font-weight: 800;
}
.tips { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.page-footer { text-align: center; color: #98a2b3; font-size: 12px; padding: 6px 0; }

/* 分享码错误 */
.gate { width: min(100% - 28px, 520px); margin: 60px auto; }
.gate-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 24px; text-align: center; }
.gate-icon { width: 50px; height: 50px; margin: 0 auto 14px; border-radius: 50%; background: #fff1f0; color: var(--red); display: grid; place-items: center; font-size: 26px; font-weight: 800; }
.gate-box h2 { margin: 0 0 10px; font-size: 20px; color: var(--navy); }
.gate-box p { color: var(--muted); font-size: 14px; }
.gate-code { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f5f7fb; border-radius: 8px; padding: 8px; color: var(--navy) !important; }
.gate-box .btn { margin-top: 10px; }

/* 报告详情页 */
.report-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.report-actions { display: flex; gap: 8px; }
.back { color: var(--blue); text-decoration: none; font-size: 14px; font-weight: 600; }
.loading, .empty-state { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty-state h2 { color: var(--navy); font-size: 18px; }
.report-card { padding: 0; overflow: hidden; }
.report-hero {
  background: linear-gradient(135deg, #223c6c, #345894);
  color: #fff; padding: 24px 20px;
}
.report-school { font-size: 13px; opacity: .85; }
.report-exam { font-size: 12px; opacity: .75; margin-top: 2px; }
.report-hero h1 { font-size: 20px; margin: 12px 0 6px; }
.report-info { font-size: 12px; opacity: .85; }
.report-card > .sub-title, .report-card > .notice, .report-card > .file-card, .report-card > .report-foot { margin-left: 20px; margin-right: 20px; }
.report-card > .table-wrap { margin: 0 12px; }
.report-card > .report-pages { margin: 0 20px 20px; }

/* Word 正文在线预览 */
.doc-preview { margin: 16px 20px; padding: 18px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.docx-body { font-size: 14px; line-height: 1.75; color: #263145; word-break: break-word; }
.docx-body h1 { font-size: 21px; line-height: 1.45; margin: 4px 0 14px; color: var(--navy); }
.docx-body h2 { font-size: 18px; line-height: 1.45; margin: 18px 0 10px; color: var(--navy); }
.docx-body h3, .docx-body h4, .docx-body h5, .docx-body h6 { font-size: 15px; margin: 14px 0 8px; color: var(--navy); }
.docx-body p { margin: 8px 0; }
.doc-image { margin: 12px 0; text-align: center; }
.doc-image img { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(31, 58, 104, .10); }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 12px 0; }
.doc-table td, .doc-table th { border: 1px solid var(--line); padding: 8px; vertical-align: top; }
.doc-table thead td { background: #f4f7fc; font-weight: 700; color: var(--navy); }
.report-pages { display: grid; gap: 16px; }
.report-page { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.report-page img { display: block; width: 100%; height: auto; }
.report-page figcaption { font-size: 12px; color: var(--muted); padding: 8px 10px; text-align: center; }
.report-page figcaption a { color: var(--blue); }
.pdf-viewer { width: 100%; height: 70vh; border: 0; }
.report-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 0 20px; }

/* 海报 */
.poster-body { background: #eef1f7; }
.poster-card { text-align: center; padding: 30px 20px 22px; }
.poster-school { color: var(--navy); font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.poster-exam { color: var(--muted); font-size: 16px; margin-top: 4px; }
.poster-title { font-size: 30px; line-height: 1.35; margin: 22px 0 20px; letter-spacing: 1px; }
.qr-frame { border: 1px solid #dbe3f0; border-radius: 8px; padding: 14px; width: min(100%, 370px); margin: 0 auto; background: #fff; }
.qrcode { line-height: 0; }
.qrcode canvas { width: 100%; height: auto; display: block; }
.poster-tip { font-size: 16px; font-weight: 600; margin: 20px 0 14px; }
.poster-steps { list-style: none; margin: 0; padding: 0; text-align: left; width: min(100%, 330px); margin: 0 auto; }
.poster-steps li { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 5px 0; color: #4a5568; }
.poster-steps .step-no { width: 26px; height: 26px; flex-basis: 26px; font-size: 14px; }
.poster-foot { margin-top: 18px; font-size: 11px; color: #a0a9b8; }
.share-url { font-size: 12px; color: var(--muted); word-break: break-all; background: #f6f8fc; border-radius: 8px; padding: 9px 11px; }

@media (max-width: 520px) {
  .hero-title, .poster-title { font-size: 26px; }
  .score-table thead { display: none; }
  .score-table, .score-table tbody, .score-table tr, .score-table td { display: block; width: 100%; }
  .score-table tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .score-table td { border: 0; padding: 3px 8px; display: flex; justify-content: space-between; }
  .score-table td::before { content: attr(data-label) '：'; color: var(--muted); font-size: 12px; }
  .score-table td:first-child::before { content: ''; }
  .score-table td:first-child { font-weight: 700; color: var(--navy); }
  .score-table td .bar { width: 45%; }
}

@media print {
  body { background: #fff; }
  .no-print, .report-header, .poster-tools, .page-footer, .gate { display: none !important; }
  .page { width: 100%; max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; margin: 0; padding: 0; }
  .poster-card { padding: 10mm; }
  .qrcode canvas { max-width: 90mm; }
  .report-page { break-inside: avoid; }
}
