/* Shared main-site components. Design tokens and rules: /DESIGN.md in the project root. */
:root {
  color-scheme: light;
  --ink: #243142;
  --muted: #596879;
  --blue: #1664c3;
  --blue-deep: #104b94;
  --line: #dce2e9;
  --canvas: #f5f6f8;
  --paper: #fff;
  --soft: #edf5ff;
  --coral: #de5866;
  --focus: #dc7a18;
  --sans: Aptos, 'Microsoft JhengHei', 'PingFang TC', sans-serif;
  --serif: Georgia, 'Noto Serif TC', PMingLiU, serif;
  font: 16px/1.7 var(--sans);
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
p { margin: 0 0 16px; overflow-wrap: anywhere; }
button { font: inherit; }
img { max-width: 100%; }
::selection { background: #d7eaff; color: var(--ink); }
.shell { max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 10; background: var(--paper); padding: 10px; }
.skip-link:focus { top: 10px; }
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand > span { min-width: 0; }
.wordmark { display: block; font: 700 2.05rem/1 var(--serif); letter-spacing: -.045em; }
.brand-note { display: block; margin-top: 6px; font-size: .76rem; color: var(--muted); }
.language { display: flex; gap: 8px; flex-shrink: 0; }
.language button { min-height: 36px; padding: 6px 12px; border: 1px solid #bfcddd; border-radius: 3px; background: var(--paper); color: var(--blue); font-size: .8rem; font-weight: 700; cursor: pointer; }
.language button:hover { background: var(--soft); border-color: var(--blue); }
.language button[aria-pressed='true'] { background: var(--blue); color: #fff; border-color: var(--blue); }
.back-home { font-size: .85rem; }
.primary-nav { display: flex; align-items: center; gap: 28px; min-height: 52px; border-top: 1px solid #eef0f3; }
.primary-nav > a:not(.button-link) { display: flex; align-items: center; align-self: stretch; padding: 10px 0; border-bottom: 3px solid transparent; color: var(--ink); font-size: .9rem; font-weight: 700; }
.primary-nav > a[aria-current='page'] { border-bottom-color: var(--coral); }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 17px; border: 1px solid var(--blue); border-radius: 3px; background: var(--blue); color: #fff; font-size: .9rem; font-weight: 700; line-height: 1.35; text-align: center; }
.button-link:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; text-decoration: none; }
.primary-nav .button-link { margin: 6px 0 6px auto; }
.main-shell { padding-top: 26px; }
.site-layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; align-items: start; gap: 24px; }
.reading-surface { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; }
.section-heading { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.section-heading h1 { font-size: 1.5rem; letter-spacing: -.015em; }
.section-heading h2 { margin-top: 7px; font-size: .95rem; font-weight: 400; color: var(--muted); }
.news-row { padding: 24px; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.news-row:last-child { border-bottom: 0; }
.news-row .meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; margin-bottom: 12px; color: var(--muted); font-size: .78rem; }
.meta time { font-weight: 700; color: var(--blue); font-variant-numeric: tabular-nums; }
.news-row h3 { margin-bottom: 12px; font-size: 1.15rem; line-height: 1.6; }
.news-row p { font-size: .95rem; line-height: 1.9; }
.links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.links a { display: inline-flex; align-items: center; min-height: 32px; font-size: .83rem; text-decoration: underline; }
details { margin-top: 18px; border-top: 1px solid var(--line); }
summary { padding: 12px 0 0; color: var(--blue); font-size: .85rem; cursor: pointer; }
.record-image { display: block; width: 100%; height: auto; margin-top: 16px; border: 1px solid var(--line); }
.sidebar { display: grid; gap: 22px; min-width: 0; }
.side-section { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--blue); }
.side-section h2 { margin-bottom: 14px; font-size: 1rem; }
.side-section p { font-size: .85rem; color: var(--muted); }
.side-section .text-link { font-size: .85rem; font-weight: 700; }
.side-section .button-link { width: 100%; }
.mascot { display: block; flex-shrink: 0; object-fit: contain; }
.mascot-brand { width: 48px; height: 54px; }
.mascot-side { width: 76px; height: 92px; }
.mascot-footer { width: 46px; height: 50px; }
.mascot-welcome { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.mascot-welcome h2 { margin: 0; line-height: 1.7; }
.archive-index { padding: 0 4px; }
.archive-index h2 { margin-bottom: 8px; font-size: .9rem; }
.archive-index ol { list-style: none; margin: 0; padding: 0; }
.archive-index li { border-bottom: 1px solid var(--line); }
.archive-index a { display: block; padding: 12px 0; font-size: .85rem; }
.archive-index time { display: block; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.breadcrumb { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; color: var(--muted); font-size: .8rem; }
.intro-article .section-heading { padding: 26px; }
.article-body { padding: 26px 26px 8px; font-size: 1rem; line-height: 1.95; }
.article-body p { margin-bottom: 24px; }
.article-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding: 20px 26px; border-top: 1px solid var(--line); font-size: .85rem; }
.site-footer { display: flex; align-items: center; gap: 18px; margin-top: 48px; padding-top: 24px; padding-bottom: 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.footer-note { margin: 0; max-width: 640px; }
.site-footer > a { margin-left: auto; white-space: nowrap; }
@media (max-width: 880px) {
  .site-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; }
  .primary-nav { gap: 20px; }
  .news-row { padding: 22px; }
}
@media (max-width: 700px) {
  .shell { padding-inline: 16px; }
  .top { align-items: flex-start; flex-wrap: wrap; gap: 16px; padding: 18px 0 12px; }
  .wordmark { font-size: 1.8rem; }
  .language { margin-left: auto; }
  .primary-nav { gap: 18px; flex-wrap: wrap; }
  .primary-nav > a:not(.button-link) { font-size: .85rem; min-height: 48px; }
  .primary-nav .button-link { padding: 8px 12px; font-size: .8rem; }
  .main-shell { padding-top: 20px; }
  .site-layout { grid-template-columns: minmax(0, 1fr); }
  .section-heading, .intro-article .section-heading { padding: 20px 18px; }
  .section-heading h1 { font-size: 1.3rem; }
  .section-heading h2 { font-size: .88rem; }
  .news-row { padding: 22px 18px; }
  .news-row h3 { font-size: 1.08rem; }
  .news-row p { font-size: .95rem; }
  .sidebar { margin-top: 4px; }
  .article-body { padding: 20px 18px 0; font-size: .95rem; }
  .article-end { padding: 18px; }
  .site-footer { flex-wrap: wrap; margin-top: 30px; padding-bottom: 28px; }
  .footer-note { flex: 1; min-width: 180px; }
  .site-footer > a { margin-left: 64px; }
}
@media (max-width: 400px) {
  .wordmark { font-size: 1.6rem; }
  .brand-note { font-size: .7rem; }
  .primary-nav { gap: 14px; }
  .primary-nav .button-link { flex-basis: 100%; margin: 0 0 12px; }
}
@media print {
  :root { background: #fff; color: #000; }
  .shell { max-width: none; padding: 0; }
  .masthead, .sidebar, .site-footer, .skip-link, .article-end, .breadcrumb { display: none; }
  .site-layout { display: block; }
  .reading-surface { border: 0; }
  .news-row { break-inside: avoid; }
  .main-shell { padding: 0; }
}
