
:root {
  --paper: #fffdf9;
  --ink: #18181b;
  --muted: #6b7280;
  --accent: #c1121f;
  --line: #d7d3cb;
  --soft: #f7f2ea;
  --redline-print-columns: 4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(193,18,31,.05), transparent 38%),
    linear-gradient(180deg, #fff 0, var(--paper) 100%);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
.spread { width: 100%; }
.wrap { max-width: 1480px; margin: 0 auto; padding: 20px 24px 32px; }
.header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.5;
}
.header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
}
.header nav a:hover { border-color: var(--accent); color: var(--accent); }
.header nav a:focus-visible,
.region-nav a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pages { padding-top: 18px; }
.page {
  display: grid;
  grid-template-columns: repeat(var(--redline-print-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 1), minmax(0, auto));
  align-items: stretch;
  gap: 10mm;
  min-height: 404mm;
  break-after: page;
  page-break-after: always;
}
.page:last-child { break-after: auto; page-break-after: auto; }
.layout-block { display: contents; }
.fold-column {
  min-width: 0;
  display: grid;
  grid-template-rows: subgrid;
  grid-row: 1 / -1;
  row-gap: 6mm;
}
.card {
  padding: 1.4em;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  break-inside: avoid;
  page-break-inside: avoid;
  display: flex;
  flex-direction: column;
  gap: 1em;
  font-size: 9.5pt;
}
.card h2 {
  margin: 0;
  font-size: 1.35em;
  line-height: 1.5;
}
.card .meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.875em;
}
.fields {
  display: grid;
  gap: 0.45em;
}
.field {
  padding-top: 0.45em;
  border-top: 1px dotted var(--line);
}
.field:first-child {
  padding-top: 0;
  border-top: 0;
}
.field dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.875em;
  letter-spacing: .08em;
}
.field dd {
  margin: 0.2em 0 0;
  font-size: 1em;
  line-height: 1.5;
  word-break: break-word;
}
.value {
  white-space: pre-wrap;
}
.value .insert {
  color: var(--accent);
  font-weight: 700;
}
.value del {
  color: #7a1f24;
  text-decoration-line: line-through;
  text-decoration-style: double;
  text-decoration-thickness: from-font;
}
.value .muted {
  color: var(--muted);
}
.empty {
  color: var(--muted);
  font-size: 10pt;
  padding: 10mm 0;
}
.prose {
  margin: 0;
  padding: 5mm;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.92);
  break-inside: avoid;
  page-break-inside: avoid;
}
.prose h2 {
  margin: 0 0 4mm;
  font-size: 16pt;
  line-height: 1.5;
}
.prose p {
  margin: 0 0 3mm;
  line-height: 1.5;
}
.prose p:last-child { margin-bottom: 0; }
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .header { display: none; }
  .pages { padding-top: 0; }
  .card { box-shadow: none; }
}
@media screen and (max-width: 1200px) {
.page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 720px) {
  .wrap { padding: 16px; }
  .page { grid-template-columns: 1fr; }
  .header h1 { font-size: 22px; }
}
.index-section { display: block; padding: 24px 0 48px; }
.logic-table { border-collapse: collapse; width: 100%; margin: 16px 0 32px; font-size: 15px; }
.logic-table th, .logic-table td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.logic-table thead th { background: var(--soft); font-weight: 600; }
.logic-table th:first-child { width: 120px; white-space: nowrap; }
.logic-table td { line-height: 1.6; }
.stats-table { border-collapse: collapse; width: 100%; margin: 16px 0 32px; font-size: 15px; }
.stats-table th, .stats-table td { border: 1px solid var(--line); padding: 10px 14px; text-align: right; }
.stats-table th { background: var(--soft); font-weight: 600; }
.stats-table td:first-child, .stats-table th:first-child { text-align: left; }
.stats-table td.flag { color: #c00; font-weight: 600; }
.region-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 24px; }
.region-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 4px; font-size: 15px; text-decoration: none; color: inherit; }
.region-nav a:hover { background: var(--soft); }
.flag-list { list-style: disc; margin: 4px 0 24px 20px; font-size: 15px; line-height: 1.7; }
