:root {
  --ink: #18272e;
  --ink-soft: #4f6269;
  --teal: #0b6a70;
  --teal-deep: #073f49;
  --mint: #e7f3ef;
  --cream: #f3f0e7;
  --paper: #fffef9;
  --paper-edge: #d8d5ca;
  --gold: #d7aa4c;
  --warning: #fff8df;
  --warning-line: #e7cf82;
  --red: #8d342f;
  --shadow: 0 18px 50px rgb(24 39 46 / 9%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 112px; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, rgb(130 184 173 / 22%), transparent 34rem),
    linear-gradient(rgb(24 39 46 / 2%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(24 39 46 / 2%) 1px, transparent 1px),
    var(--cream);
  background-size: auto, 32px 32px, 32px 32px, auto;
  font-family: "Avenir Next", "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

a { color: var(--teal); text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, summary, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.22; }
p { line-height: 1.65; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 100; background: white; padding: 12px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.site-top {
  max-width: 1460px;
  margin: auto;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.brand { color: var(--ink); font: 700 23px/1.2 Georgia, "Songti TC", serif; text-decoration: none; }
.site-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; }
.shell { max-width: 1460px; margin: auto; padding: 0 30px 80px; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fffaf0;
  background: linear-gradient(122deg, #092e3b 0%, #0d535e 58%, #35766f 100%);
  border-radius: 24px;
  padding: 42px 48px;
  box-shadow: var(--shadow);
}
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; }
.hero::before { width: 370px; height: 370px; right: -120px; top: -210px; border: 1px solid rgb(255 255 255 / 20%); box-shadow: 0 0 0 48px rgb(255 255 255 / 3%), 0 0 0 92px rgb(255 255 255 / 2%); }
.hero::after { width: 180px; height: 180px; right: 24%; bottom: -145px; background: rgb(226 188 100 / 10%); }
.hero .eyebrow { color: #98e0dc; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }
.hero h1 { margin: 13px 0; font: 700 clamp(38px, 5vw, 67px)/1.04 Georgia, "Songti TC", serif; letter-spacing: -1.5px; }
.hero p { max-width: 900px; margin-bottom: 22px; color: #dbe8e6; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-facts span { padding: 9px 14px; border: 1px solid rgb(255 255 255 / 20%); border-radius: 9px; background: rgb(255 255 255 / 6%); font-size: 13px; }
.hero-facts b { color: #f2cf7a; margin-right: 7px; font-size: 18px; }

.toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin: 16px 0 25px;
  padding: 12px 14px;
  background: rgb(255 254 249 / 94%);
  border: 1px solid var(--paper-edge);
  border-radius: 13px;
  box-shadow: 0 8px 24px rgb(24 39 46 / 8%);
  backdrop-filter: blur(14px);
}
.filters { display: flex; flex-wrap: wrap; gap: 5px; }
.filters button, .action-btn {
  min-height: 40px;
  border: 1px solid #ccd5d2;
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}
.filters button:hover, .action-btn:hover { border-color: var(--teal); background: #f4faf7; }
.filters button[aria-pressed="true"] { color: white; border-color: var(--teal-deep); background: var(--teal-deep); }
.action-danger { color: var(--red); }
.translation-control { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--teal); }
.mobile-jump { display: none; min-height: 40px; border: 1px solid #ccd5d2; border-radius: 8px; background: white; padding: 7px 10px; }
.toolbar-status { color: var(--ink-soft); font-size: 11px; white-space: nowrap; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 27px; align-items: start; }
.side {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 115px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--paper-edge);
  border-radius: 15px;
  background: rgb(255 254 249 / 86%);
  scrollbar-width: thin;
}
.side h2 { font-size: 18px; }
.progress-info { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 12px; }
progress { width: 100%; height: 8px; margin: 11px 0 18px; accent-color: var(--teal); }
.page-nav { display: grid; gap: 4px; }
.page-nav a { display: grid; grid-template-columns: 29px 1fr; gap: 7px; padding: 9px 7px; border-radius: 7px; color: var(--ink); font-size: 12px; line-height: 1.45; text-decoration: none; }
.page-nav a:hover, .page-nav a[aria-current] { color: var(--teal-deep); background: var(--mint); }
.page-nav .num { color: var(--teal); font-size: 11px; font-weight: 800; }
.page-nav small { display: block; color: var(--ink-soft); font-size: 9px; letter-spacing: .3px; }
.storage-disclaimer { color: var(--ink-soft); font-size: 12px; line-height: 1.75; }

.source-warning { margin: 0 0 25px; padding: 17px 19px; border: 1px solid var(--warning-line); border-radius: 11px; background: var(--warning); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.source-warning p { margin: 7px 0 0; }
.source-warning code { font-size: 11px; }
.source-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; padding-top: 11px; border-top: 1px solid rgb(176 145 62 / 25%); }
.source-actions a { font-weight: 700; }
.audit-state { color: var(--red); font-size: 11px; font-weight: 700; letter-spacing: .25px; }

.page { margin: 0 0 31px; overflow: hidden; scroll-margin-top: 105px; border: 1px solid var(--paper-edge); border-radius: 17px; background: var(--paper); box-shadow: var(--shadow); }
.page[hidden] { display: none !important; }
.page-heading { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 21px 28px; border-bottom: 1px solid var(--paper-edge); background: linear-gradient(105deg, #eef6f1, #fbf8ee 72%); }
.page-heading h2 { margin: 7px 0; font: 700 clamp(20px, 2.2vw, 28px)/1.22 Georgia, "Songti TC", serif; }
.page-heading p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.page-heading .eyebrow { color: var(--teal); font-size: 10px; letter-spacing: 1.2px; }
.read-check { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; }

.source-paper { padding: 35px 39px; color: #171b1b; font: 18px/1.46 "Times New Roman", "Songti TC", serif; }
.source-paper p { margin: 0 0 17px; line-height: 1.5; }
.source-paper h2 { font-size: 25px; }
.source-paper h3 { font-size: 20px; }
.source-paper ul, .source-paper ol { line-height: 1.55; }
.bilingual { margin-bottom: 17px; }
.bilingual > :first-child { margin-bottom: 0; }
.translation { margin: 7px 0 5px; padding: 5px 0 5px 11px; border-left: 3px solid #bddbd0; color: #326865; font: 400 13px/1.75 "Avenir Next", "PingFang TC", "Microsoft JhengHei", sans-serif; }
.hide-translation .translation { display: none; }
.paper-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 12px; border-top: 1px solid #d2d1c8; color: #666; font-size: 12px; }
.page-proof { margin-top: 25px; border: 1px solid #b5d1c5; border-radius: 10px; background: #edf6f0; color: var(--ink); font: 13px/1.6 "Avenir Next", "PingFang TC", sans-serif; }
.page-proof summary { padding: 13px 15px; cursor: pointer; font-weight: 700; }
.page-proof p { margin: 0; padding: 0 15px 14px; color: var(--ink-soft); }

.cover { position: relative; min-height: 920px; padding-top: 155px; }
.cover-corner { position: absolute; top: 0; left: 0; font: 700 15px/1.25 "Trebuchet MS", sans-serif; }
.cover-corner::after { content: ""; position: absolute; left: -35px; top: 75px; width: 215px; height: 3px; background: #333; transform: rotate(-45deg); }
.level-stamp { position: absolute; top: 0; right: 0; padding: 6px 11px; border: 2px solid #444; text-align: center; font-family: "Trebuchet MS", sans-serif; }
.level-stamp strong { display: block; font-size: 62px; line-height: .95; }
.level-stamp span { font-size: 10px; font-weight: 700; }
.authority { margin-bottom: 50px; text-align: center; font: 15px/1.8 "Trebuchet MS", sans-serif; }
.cover > h2 { margin: 30px 0; text-align: center; font-family: "Trebuchet MS", sans-serif; }
.cover-instructions { margin-top: 58px; font: 15px/1.5 "Trebuchet MS", sans-serif; }
.cover-instructions h3 { margin: 28px 0 18px; font-size: 15px; }
.exam-notice { width: max-content; max-width: 100%; margin: 85px 0 15px auto; padding: 8px 18px; border: 1px solid #555; text-align: center; font: 13px/1.3 "Trebuchet MS", sans-serif; }
.copyright-notice { margin-top: 28px; font: 12px/1.35 "Trebuchet MS", "PingFang TC", sans-serif; }
.source-document-title { margin-bottom: 18px !important; text-align: center; font-weight: 700; }
.turn-page { position: relative; width: max-content; max-width: calc(100% - 30px); margin: 28px 22px 8px auto !important; padding: 5px 13px 5px 10px; border: 2px solid #333; font: 700 12px/1.15 "Trebuchet MS", sans-serif; }
.turn-page::after { content: ""; position: absolute; top: 50%; right: -20px; width: 26px; height: 26px; border-top: 2px solid #333; border-right: 2px solid #333; background: var(--paper); transform: translateY(-50%) rotate(45deg); }
.situation { padding: 18px 22px; border: 1px solid #555; }
.contents { padding-left: 25px; }
.contents li { padding: 8px 0; }
.contents a { display: flex; justify-content: space-between; gap: 20px; color: inherit; text-decoration: none; }
.contents a span { border-bottom: 1px dotted #888; flex: 1; }
.contents a b { min-width: 24px; text-align: center; }

.notes-sheet { padding: 14px; border: 1px solid #555; }
.notes-sheet label { display: block; margin: 0 0 8px; font-weight: 700; text-decoration: underline; }
.notes-sheet textarea { min-height: 124px; margin-bottom: 18px; }
.notes-sheet textarea:last-child { margin-bottom: 0; }
textarea { display: block; width: 100%; min-height: 80px; resize: vertical; padding: 11px 13px; border: 1px solid #aebfb8; border-radius: 7px; color: var(--ink); background: repeating-linear-gradient(#fffef9 0, #fffef9 31px, #d7e1dc 31px, #d7e1dc 32px); font: 17px/32px Georgia, serif; }

.email { margin-bottom: 18px; overflow: hidden; border: 1px solid #666; background: #fff; }
.mail-tools { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; padding: 8px 10px; border-bottom: 1px solid #777; text-align: center; font: 10px/1.3 "Trebuchet MS", sans-serif; }
.mail-tools span::before { content: "◇"; display: block; color: #444; font-size: 20px; }
.email-head { padding: 9px 12px; border-bottom: 1px solid #777; background: #efefea; font-size: 16px; line-height: 1.42; }
.sent { float: right; padding-left: 12px; }
.email-body { padding: 19px 14px 9px; }
.email-body .bilingual:last-child { margin-bottom: 8px; }

.dialogue { padding: 13px; border: 1px solid #555; }
.speech { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 15px; margin-bottom: 11px; }
.speaker { font-weight: 700; }
.chat { padding: 13px 15px 20px; border: 1px solid #666; background: linear-gradient(110deg, #f7f7f2, #fff); }
.chat-date { text-align: center; font-size: 16px; }
.bubble { position: relative; width: fit-content; max-width: 92%; margin: 15px 0 22px; padding: 10px 13px; border: 3px solid #555; border-radius: 15px; line-height: 1.35; }
.bubble::after { content: ""; position: absolute; bottom: -13px; width: 24px; height: 19px; border-bottom: 3px solid #555; transform: skew(-38deg); }
.incoming::after { left: 15px; border-left: 3px solid #555; }
.outgoing::after { right: 15px; border-right: 3px solid #555; }
.bubble .bilingual { margin: 0; }
.bubble .bilingual p { line-height: 1.4; }
.incoming { margin-right: auto; background: white; }
.outgoing { margin-left: auto; background: repeating-linear-gradient(45deg, #e9e9e6 0, #e9e9e6 1px, #f4f4f0 1px, #f4f4f0 4px); text-align: right; }
.bubble .translation { text-align: left; }

.article-box, .notice, .forum, .comments, .report-box { padding: 16px 20px; border: 1px solid #555; }
.article-title { margin-bottom: 23px; text-align: center; }
.byline { text-align: right; }
.forum-post, .comment { padding: 10px 12px; border-bottom: 1px solid #aaa; }
.forum-post:last-child, .comment:last-child { border-bottom: 0; }
.comment-head { display: flex; justify-content: space-between; gap: 15px; margin: -10px -12px 8px; padding: 7px 12px; background: #ededE8; font-weight: 700; }

.table-scroll { max-width: 100%; overflow-x: auto; border: 1px solid transparent; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 9px; border: 1px solid #666; text-align: left; vertical-align: top; }
th { background: #eeeeE9; }
.price-key { max-width: 360px; margin: 20px auto 0; }

.chart-set { display: grid; gap: 25px; }
.chart { padding: 18px; border: 1px solid #aaa; background: #fff; }
.chart h3 { text-align: center; }
.bars { display: flex; align-items: end; gap: 20px; min-height: 260px; padding: 15px 16px 0; border-left: 1px solid #555; border-bottom: 1px solid #555; background: repeating-linear-gradient(to top, transparent 0, transparent 24px, #dde0dc 25px); }
.bar-group { flex: 1; min-width: 92px; text-align: center; }
.bar { display: flex; justify-content: center; align-items: flex-start; min-height: 3px; padding-top: 5px; color: white; background: #1e2f35; font: 700 13px/1.2 "Trebuchet MS", sans-serif; }
.bar.alt { color: var(--ink); border: 1px solid #596b72; background: repeating-linear-gradient(45deg, #fff 0, #fff 5px, #596b72 5px, #596b72 8px); }
.bar.dots { color: var(--ink); border: 1px solid #596b72; background: radial-gradient(#18272e 1.5px, transparent 1.5px) 0 0 / 7px 7px; }
.bar-label { display: block; margin-top: 8px; font: 12px/1.3 "Trebuchet MS", sans-serif; }
.data-table { margin-top: 14px; font: 12px/1.4 "Trebuchet MS", sans-serif; }
.pie-wrap { display: grid; grid-template-columns: 240px 1fr; gap: 25px; align-items: center; }
.pie { width: 220px; aspect-ratio: 1; border: 2px solid #333; border-radius: 50%; background: conic-gradient(#fff 0 73%, #777 73% 85%, #333 85% 100%); }
.legend { display: grid; gap: 8px; font: 14px/1.4 "Trebuchet MS", sans-serif; }
.legend span::before { content: "■"; display: inline-block; width: 20px; color: #333; }
.legend span:first-child::before { color: #fff; text-shadow: 0 0 0 #333; }
.legend span:nth-child(2)::before { color: #777; }
.end-marker { margin: 35px 0 10px; text-align: center; font-weight: 700; }
.site-footer { padding: 10px; color: var(--ink-soft); font-size: 12px; line-height: 1.9; text-align: center; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media (max-width: 1120px) {
  .layout { grid-template-columns: 205px minmax(0, 1fr); gap: 18px; }
  .side { padding: 15px; }
  .source-paper { padding: 27px; font-size: 17px; }
  .sent { float: none; display: block; padding: 0; }
}

@media (max-width: 820px) {
  .site-top { padding: 17px; }
  .site-links { gap: 11px; }
  .shell { padding: 0 13px 42px; }
  .hero { padding: 28px 25px; border-radius: 18px; }
  .hero h1 { letter-spacing: -.5px; }
  .hero p { font-size: 14px; }
  .toolbar { gap: 8px; margin: 13px 0 18px; padding: 10px; border-radius: 10px; }
  .filters { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .filters button { padding: 8px 5px; font-size: 11px; }
  .translation-control { margin-left: 0; }
  .action-btn { padding: 8px 9px; }
  .mobile-jump { display: block; margin-left: auto; max-width: 48%; font-size: 12px; }
  .toolbar-status { width: calc(50% - 5px); }
  .layout { display: block; }
  .side { display: none; }
  .page { scroll-margin-top: 168px; }
  .page-heading { padding: 18px; }
  .page-heading h2 { font-size: 22px; }
  .source-paper { padding: 24px 20px; font-size: 17px; }
  .cover { padding-top: 145px; }
  .authority { font-size: 12px; }
  .speech { grid-template-columns: 88px minmax(0, 1fr); gap: 8px; }
  .pie-wrap { grid-template-columns: 1fr; justify-items: center; }
  .bars { min-width: 540px; }
}

@media (max-width: 460px) {
  .site-top { align-items: flex-start; }
  .site-links { display: grid; text-align: right; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .translation-control { width: 100%; }
  .mobile-jump { max-width: 100%; width: 100%; margin: 0; }
  .toolbar-status { width: 100%; }
  .read-check { font-size: 0; }
  .read-check input { width: 21px; height: 21px; }
  .source-paper { padding: 20px 15px; }
  .level-stamp strong { font-size: 50px; }
  .speech { display: block; }
  .speaker { display: block; margin-bottom: 4px; }
  .bubble { max-width: 98%; padding: 9px; font-size: 16px; }
  .mail-tools { font-size: 8px; }
  .source-actions { display: grid; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { color: #000; background: white; }
  .site-top, .hero, .toolbar, .side, .source-warning, .page-heading .read-check, .site-footer, .page-proof, .storage-disclaimer, noscript { display: none !important; }
  .shell { max-width: none; padding: 0; }
  .layout { display: block; }
  .page { margin: 0; break-after: page; border: 0; border-radius: 0; box-shadow: none; }
  .page:last-child { break-after: auto; }
  .page-heading { padding: 0 0 7mm; background: none; }
  .source-paper { padding: 0; font-size: 11.5pt; }
  .translation { color: #333; }
  .table-scroll { overflow: visible; }
  .bars { min-width: 0; }
  textarea { border-color: #777; background: repeating-linear-gradient(#fff 0, #fff 31px, #bbb 31px, #bbb 32px); }
}
