/* ==========================================================================
   Apollo 青年论坛 — design system.

   The tokens, type treatment, spacing and component patterns below are taken
   from design/home-reference.html, which is the approved design. Anything
   added here (forms, status chips, prose, admin rows, pagination, poster
   placeholders) extends that same system rather than introducing a second
   visual language.

   One hard rule carried over from the reference: --gold means exactly one
   thing, "current / live / active". It is never decoration.
   ========================================================================== */

:root {
  --paper: #faf8f2;
  --surface: #ffffff;
  --ink: #16192c;
  --muted: #5d6275;
  --rule: #e4dfd2;
  --rule-strong: #cfc8b6;
  --navy: #2c316b;
  --navy-ink: #22264f;
  --gold: #eeb530;
  --gold-soft: #f6cb58;
  --danger: #a3341f;
  --grid: rgba(44, 49, 107, .055);
  --lat: "Archivo", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --sc: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 1px 2px rgba(22, 25, 44, .04), 0 12px 34px rgba(22, 25, 44, .07);
  color-scheme: light dark;
}

/* Dark theme is authored, not inverted: the paper goes to a deep indigo that
   keeps the navy/gold relationship legible, and navy lifts to a light tint so
   it can still carry the eyebrow labels against a dark ground. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101223;
    --surface: #171a2e;
    --ink: #eceaf2;
    --muted: #9a9fb5;
    --rule: #282c44;
    --rule-strong: #3a3f5c;
    --navy: #8f97d8;
    --navy-ink: #c3c8ef;
    --gold: #f2c552;
    --gold-soft: #f8d87c;
    --danger: #f08d77;
    --grid: rgba(143, 151, 216, .07);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 34px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --paper: #101223;
  --surface: #171a2e;
  --ink: #eceaf2;
  --muted: #9a9fb5;
  --rule: #282c44;
  --rule-strong: #3a3f5c;
  --navy: #8f97d8;
  --navy-ink: #c3c8ef;
  --gold: #f2c552;
  --gold-soft: #f8d87c;
  --danger: #f08d77;
  --grid: rgba(143, 151, 216, .07);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 34px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sc);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* The grid overlay in the hero is the only element that may exceed the
     viewport; clipping here guarantees no page-level horizontal scrollbar. */
  overflow-x: hidden;
}

/* Long Chinese titles have no spaces to break on. Every text container in the
   site inherits this so a 40-character title wraps instead of forcing scroll. */
h1, h2, h3, h4, h5, h6, p, li, td, th, dd, dt, span, a, div {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.w { max-width: 1160px; margin: 0 auto; padding-inline: 20px; }
.w.narrow { max-width: 820px; }
/* Account forms set their display type and their fields in the same narrow
   column, so the page reads as one focused block instead of a small form
   stranded beside several hundred pixels of nothing. */
.w.auth { max-width: 560px; }

[hidden] { display: none !important; }

/* --------------------------------------------------------------------------
   nav
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.navin { display: flex; align-items: center; gap: 14px; min-height: 60px; }

.mark {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.mark img { width: 30px; height: 30px; border-radius: 50%; display: block; }
.mark .wm { font-family: var(--lat); font-weight: 800; font-size: 17px; letter-spacing: -.035em; }

.nlinks {
  display: flex;
  gap: 2px;
  margin-left: 12px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nlinks::-webkit-scrollbar { display: none; }
.nlinks a {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 7px;
  white-space: nowrap;
}
.nlinks a:hover, .nlinks a:focus-visible { color: var(--ink); background: color-mix(in srgb, var(--navy) 8%, transparent); }
.nlinks a.on { color: var(--ink); background: color-mix(in srgb, var(--navy) 11%, transparent); font-weight: 500; }
/* The one account link that is not a public page gets a hairline before it so
   the two groups read apart without a second colour. */
.nlinks a.sep { margin-left: 8px; box-shadow: -9px 0 0 -8px var(--rule-strong); }

.nright { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   buttons
   -------------------------------------------------------------------------- */
.btn {
  font-family: var(--sc);
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  text-decoration: none;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
}
.btn.solid { background: var(--navy-ink); border-color: var(--navy-ink); color: #fff; }
.btn:hover, .btn:focus-visible { border-color: var(--navy); }
.btn.solid:hover, .btn.solid:focus-visible { background: var(--navy); border-color: var(--navy); }
.btn.lg { min-height: 48px; padding: 0 24px; font-size: 15px; border-radius: 11px; }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--rule-strong)); }
.btn.danger:hover, .btn.danger:focus-visible { border-color: var(--danger); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
:root[data-theme="dark"] .btn.solid, :root:not([data-theme="light"]) .btn.solid { color: #101223; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .btn.solid { color: #fff; } }

/* A text-weight action for secondary operations inside dense rows. */
.tlink {
  font: inherit;
  font-size: 13px;
  color: var(--navy);
  background: none;
  border: 0;
  padding: 4px 2px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.tlink:hover, .tlink:focus-visible { text-decoration: underline; }
.tlink.danger { color: var(--danger); }
.tlink[disabled] { opacity: .3; cursor: not-allowed; text-decoration: none; }

/* --------------------------------------------------------------------------
   eyebrow + display type
   -------------------------------------------------------------------------- */
.eb {
  font-family: var(--sc);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--navy);
  margin: 0 0 18px;
  text-transform: uppercase;
}
.dsp {
  font-family: var(--lat);
  font-weight: 800;
  font-size: clamp(46px, 9.6vw, 112px);
  line-height: .92;
  letter-spacing: -.055em;
  margin: 0;
  color: var(--ink);
}
.h2cn {
  font-family: var(--sc);
  font-weight: 900;
  font-size: clamp(26px, 4.4vw, 46px);
  line-height: 1.22;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}
.h3cn {
  font-family: var(--sc);
  font-weight: 900;
  font-size: clamp(22px, 3.2vw, 32px);
  line-height: 1.26;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   hero
   -------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to right, var(--grid) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(to bottom, var(--grid) 0 1px, transparent 1px 64px);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}
.heroin {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 384px;
  gap: 56px;
  align-items: center;
  padding-block: 66px 74px;
}
.hsub {
  font-family: var(--sc);
  font-weight: 900;
  font-size: clamp(20px, 3.1vw, 31px);
  line-height: 1.36;
  letter-spacing: -.015em;
  margin: 24px 0 0;
  max-width: 15em;
  text-wrap: balance;
}
.hbody { margin: 20px 0 0; color: var(--muted); font-size: 15.5px; max-width: 31em; line-height: 1.85; }
.hacts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* The page head used by every non-home page: same eyebrow + display pairing,
   at a smaller step so it does not compete with the home hero. */
.phead { border-bottom: 1px solid var(--rule); padding-block: 44px 34px; }
.phead .dsp { font-size: clamp(38px, 6.4vw, 70px); }
.phead .lede { margin: 18px 0 0; color: var(--muted); max-width: 44em; line-height: 1.85; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 30px 26px 24px;
  text-align: center;
}
.card img { width: 100%; max-width: 238px; height: auto; margin: 0 auto; display: block; border-radius: 50%; }
.card .cl { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--navy); margin: 22px 0 8px; }
.card .cc { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0; }

/* --------------------------------------------------------------------------
   stat strip
   -------------------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
.st { padding: 26px 26px 28px; border-left: 1px solid var(--rule); min-width: 0; }
.st:first-child { border-left: 0; padding-left: 0; }
.st .sl { font-size: 10px; font-weight: 700; letter-spacing: .15em; color: var(--muted); margin: 0 0 10px; }
.st .sv { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.st .sn { font-family: var(--lat); font-weight: 800; font-size: clamp(34px, 5.4vw, 50px); line-height: 1; letter-spacing: -.045em; }
/* Chinese numerals such as 每周 need the SC face, not Archivo. */
.st .sn.cn { font-family: var(--sc); font-weight: 900; font-size: clamp(28px, 4.4vw, 42px); letter-spacing: -.03em; }
.st .su { font-size: 13.5px; color: var(--muted); min-width: 0; }

/* --------------------------------------------------------------------------
   sections
   -------------------------------------------------------------------------- */
section { padding-block: 64px; }
section + section { border-top: 1px solid var(--rule); }
.shead { margin-bottom: 34px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 48px; align-items: start; }
.lede { color: var(--muted); font-size: 15px; line-height: 1.9; margin: 0; }

.subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.subhead .eb { margin: 0; }

/* --------------------------------------------------------------------------
   question index
   -------------------------------------------------------------------------- */
.qs { border-top: 1px solid var(--rule); }
.qrow {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.qrow .qn { font-family: var(--lat); font-size: 12px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.qrow .qt {
  font-family: var(--sc);
  font-weight: 700;
  font-size: clamp(18px, 2.5vw, 25px);
  line-height: 1.4;
  margin: 0;
  letter-spacing: -.015em;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   generic rule-separated rows
   -------------------------------------------------------------------------- */
.rows { border-top: 1px solid var(--rule); }
.row {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.row .k { font-weight: 700; font-size: 16px; min-width: 0; }
.row .d { color: var(--muted); font-size: 14.5px; line-height: 1.8; min-width: 0; }
.row.num { grid-template-columns: 44px minmax(0, 1fr); }
.row .n { font-family: var(--lat); font-size: 12px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.row .t { font-weight: 700; font-size: 16px; margin: 0 0 5px; }

/* --------------------------------------------------------------------------
   events
   -------------------------------------------------------------------------- */
.ev {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 8px 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.ev .d { font-family: var(--lat); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev .t { font-weight: 500; font-size: 15.5px; margin: 0; min-width: 0; }
.tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--navy);
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  padding: 2px 8px;
  white-space: nowrap;
}
.ev.live .d { color: var(--gold); font-weight: 700; }
.ev.live .tag { color: var(--gold); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 13%, transparent); }

/* An event row that opens in place. <details> keeps it keyboard-reachable
   with no JS state to get out of sync. */
.evd { border-bottom: 1px solid var(--rule); }
.evd > summary { list-style: none; cursor: pointer; }
.evd > summary::-webkit-details-marker { display: none; }
.evd > summary .ev { border-bottom: 0; }
.evd > summary:hover .t { color: var(--navy); }
.evd[open] > summary .t { font-weight: 700; }
.evd .evbody { padding: 2px 0 26px; }
.evd .evbody .prose { max-width: 46em; }

/* Current event, given the full block treatment. Gold only here. */
.nowev {
  border: 1px solid var(--gold);
  border-radius: 16px;
  background: color-mix(in srgb, var(--gold) 7%, var(--surface));
  padding: 26px;
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.nowev .nowmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.nowev .nowdate { font-family: var(--lat); font-size: 13.5px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }

/* Poster placeholder. There are no poster images; this is a designed stand-in
   built from the event's own kind and date, never a link to a missing file. */
.poster {
  aspect-ratio: 3 / 4;
  border: 1px dashed var(--rule-strong);
  border-radius: 12px;
  background:
    repeating-linear-gradient(to bottom, var(--grid) 0 1px, transparent 1px 22px),
    var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 16px;
  min-width: 0;
}
.poster .pk { font-family: var(--sc); font-weight: 900; font-size: 22px; letter-spacing: -.02em; color: var(--ink); }
.poster .pd { font-family: var(--lat); font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.poster .pn { font-size: 10px; font-weight: 700; letter-spacing: .16em; color: var(--muted); }
.poster.gold { border-color: var(--gold); }
.poster.gold .pd { color: var(--gold); }

/* Archive poster strip. auto-fit spreads the tiles across the row so the strip
   does not end in a gap, and the max-width on the tile itself stops a single
   remaining event from being blown up to the full content width. */
.pstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; }
.ptile { min-width: 0; max-width: 240px; }
.ptile .poster { aspect-ratio: 3 / 4; }
.ptile .poster .pk { font-size: 18px; }
.ptile .pt { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 10px 0 0; }

/* --------------------------------------------------------------------------
   article index + list
   -------------------------------------------------------------------------- */
.idx { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.ic {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  font-size: 14px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}
.ic:nth-child(3n+1) { border-left: 0; }
.ic:hover, .ic:focus-visible { background: color-mix(in srgb, var(--navy) 6%, transparent); }
.ic.on { background: color-mix(in srgb, var(--gold) 14%, transparent); font-weight: 700; }
.ic .c { font-family: var(--lat); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.art {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.art .t { font-weight: 500; font-size: 15.5px; margin: 0; min-width: 0; }
.art a.t { color: var(--ink); text-decoration: none; display: block; }
.art a.t:hover, .art a.t:focus-visible { color: var(--navy); }
.art .s { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; color: var(--navy); margin-right: 10px; }
.art .m { font-family: var(--lat); font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.art .x { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; line-height: 1.75; margin: 2px 0 0; }

/* --------------------------------------------------------------------------
   prose — the only place body_html is injected
   -------------------------------------------------------------------------- */
.prose { font-size: 16px; line-height: 1.95; color: var(--ink); }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: clamp(20px, 2.6vw, 25px); font-weight: 900; letter-spacing: -.02em; line-height: 1.35; margin: 2em 0 .7em; }
.prose h3 { font-size: clamp(17px, 2.1vw, 20px); font-weight: 700; letter-spacing: -.015em; line-height: 1.4; margin: 1.9em 0 .6em; }
.prose h4, .prose h5, .prose h6 { font-size: 16px; font-weight: 700; margin: 1.7em 0 .5em; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--rule-strong);
  color: var(--muted);
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
}
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.prose :not(pre) > code { background: color-mix(in srgb, var(--navy) 8%, transparent); padding: 1px 5px; border-radius: 4px; }
.prose a { color: var(--navy); text-underline-offset: 3px; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; display: block; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.prose strong { font-weight: 700; }

/* Body text coming from a content block, rendered inline in a row. */
.blk { color: var(--muted); font-size: 14.5px; line-height: 1.8; }
.blk p { margin: 0 0 .7em; }
.blk p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   article detail head
   -------------------------------------------------------------------------- */
.ahead { border-bottom: 1px solid var(--rule); padding-block: 40px 30px; }
.ahead .atitle {
  font-family: var(--sc);
  font-weight: 900;
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.26;
  letter-spacing: -.025em;
  margin: 0;
  text-wrap: balance;
}
.ameta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 18px 0 0; font-size: 13px; color: var(--muted); }
.ameta .an { color: var(--ink); font-weight: 500; }
.ameta .ad { font-family: var(--lat); font-variant-numeric: tabular-nums; }
.asum { margin: 16px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.85; max-width: 42em; }

/* --------------------------------------------------------------------------
   status chips
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  padding: 2px 8px;
  color: var(--muted);
  white-space: nowrap;
}
/* published is the live/current state for an article — the one gold use here. */
.chip.published { color: var(--gold); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 13%, transparent); }
.chip.pending { color: var(--navy); border-color: color-mix(in srgb, var(--navy) 45%, var(--rule-strong)); }
.chip.rejected { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--rule-strong)); }
.chip.draft { color: var(--muted); }
.chip.role-admin { color: var(--navy); border-color: color-mix(in srgb, var(--navy) 45%, var(--rule-strong)); }
.chip.disabled { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--rule-strong)); }

/* --------------------------------------------------------------------------
   forms
   -------------------------------------------------------------------------- */
.form { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.field { display: grid; gap: 7px; padding: 16px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.field > label { font-size: 12px; font-weight: 700; letter-spacing: .09em; color: var(--navy); }
.field .hint { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.field .err { font-size: 13px; color: var(--danger); }

/* A field whose label sits on the same line as its value — used across the
   admin surface to keep rows one line tall. */
.field.inline { grid-template-columns: 124px minmax(0, 1fr); align-items: center; gap: 7px 18px; }
.field.inline > label { grid-column: 1; }
.field.inline > :not(label) { grid-column: 2; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="datetime-local"], input[type="url"], select, textarea {
  font-family: var(--sc);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 9px;
  padding: 9px 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
textarea { resize: vertical; min-height: 120px; }
textarea.tall { min-height: 340px; }
textarea.md { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.8; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-color: var(--navy); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy); margin: 0; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; }

.formacts { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 20px; }
.formacts .grow { margin-left: auto; }

/* code entry: the 6-digit verification code, and its resend control */
.codewrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
input.code { font-family: var(--lat); font-weight: 700; font-size: 20px; letter-spacing: .28em; text-align: center; }

/* --------------------------------------------------------------------------
   messages
   -------------------------------------------------------------------------- */
.msg {
  border: 1px solid var(--rule-strong);
  border-left-width: 3px;
  border-radius: 9px;
  padding: 12px 15px;
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 20px;
  background: var(--surface);
}
.msg.bad { border-left-color: var(--danger); color: var(--danger); }
.msg.good { border-left-color: var(--navy); }
.msg.warn { border-left-color: var(--gold); }
.msg:empty { display: none; }

.empty {
  border: 1px dashed var(--rule-strong);
  border-radius: 12px;
  padding: 30px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty .eh { display: block; color: var(--ink); font-weight: 700; font-size: 16px; margin-bottom: 6px; }

.loading { color: var(--muted); font-size: 13.5px; padding: 40px 0; text-align: center; letter-spacing: .1em; }

/* --------------------------------------------------------------------------
   pagination
   -------------------------------------------------------------------------- */
.pager { display: flex; align-items: center; gap: 12px; padding-top: 24px; flex-wrap: wrap; }
.pager .pi { font-family: var(--lat); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }

/* --------------------------------------------------------------------------
   filter chips (article sections, admin status)
   -------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters a, .filters button {
  font-family: var(--sc);
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 1px solid var(--rule);
  border-radius: 7px;
  padding: 5px 11px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.filters a:hover, .filters button:hover, .filters a:focus-visible, .filters button:focus-visible { color: var(--ink); border-color: var(--rule-strong); }
.filters .on { color: var(--ink); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); font-weight: 700; }
.filters .c { font-family: var(--lat); font-size: 11.5px; margin-left: 6px; font-variant-numeric: tabular-nums; opacity: .8; }

.searchbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; max-width: 460px; }

/* --------------------------------------------------------------------------
   join block
   -------------------------------------------------------------------------- */
.join { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 34px; align-items: center; }
.qr {
  aspect-ratio: 1;
  border: 1px dashed var(--rule-strong);
  border-radius: 14px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
  padding: 14px;
  gap: 4px;
}
.qr .qm { font-size: 10px; font-weight: 700; letter-spacing: .16em; }

/* --------------------------------------------------------------------------
   admin
   -------------------------------------------------------------------------- */
.adminnav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 26px;
}
.adminnav::-webkit-scrollbar { display: none; }
.adminnav a {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 13px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.adminnav a:hover, .adminnav a:focus-visible { color: var(--ink); }
.adminnav a.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--gold); }

/* Dense admin record rows. The grid tracks are all minmax(0,…) so a long
   Chinese title shrinks the flexible column instead of overflowing it. */
.arow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.arow .main { min-width: 0; }
.arow .ttl { font-weight: 500; font-size: 15.5px; margin: 0 0 4px; }
.arow .sub { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.arow .sub .num { font-family: var(--lat); font-variant-numeric: tabular-nums; }
.arow .acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.arow .full { grid-column: 1 / -1; min-width: 0; }

.reason {
  border-left: 2px solid var(--danger);
  padding: 4px 0 4px 14px;
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}
.reason b { color: var(--danger); font-weight: 700; display: block; font-size: 11px; letter-spacing: .12em; margin-bottom: 3px; }

/* An editor panel opened inside a row. */
.panel {
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: var(--surface);
  padding: 4px 18px 18px;
  margin: 12px 0 4px;
}
.panel .form { border-top: 0; }
.panel .field:last-of-type { border-bottom: 0; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; }

/* --------------------------------------------------------------------------
   footer
   -------------------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--rule);
  padding-block: 28px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-size: 12.5px;
  color: var(--muted);
  align-items: center;
}
footer .fm { font-family: var(--lat); font-weight: 800; letter-spacing: -.03em; color: var(--ink); font-size: 14px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover, footer a:focus-visible { color: var(--ink); }

/* --------------------------------------------------------------------------
   focus + motion
   -------------------------------------------------------------------------- */
a:focus-visible, .btn:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}
/* The route outlet is focused programmatically after every navigation so that
   keyboard and screen-reader users land at the top of the new view. It is not
   an interactive control, so it must not draw a focus ring around the whole
   page -- which would also be a second, meaningless use of gold. */
#view:focus, #view:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --------------------------------------------------------------------------
   responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .heroin { grid-template-columns: 1fr; gap: 38px; padding-block: 44px 52px; }
  .card { max-width: 360px; }
  .split { grid-template-columns: 1fr; gap: 26px; }
  .idx { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ic:nth-child(3n+1) { border-left: 1px solid var(--rule); }
  .ic:nth-child(2n+1) { border-left: 0; }
  .nowev { grid-template-columns: 152px minmax(0, 1fr); gap: 22px; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 760px) {
  /* The public links drop to their own full-width row so they are never
     squeezed into a 40px scrolling sliver next to the action buttons. They
     wrap rather than scroll: a signed-in admin has seven links, and a link
     parked off the right edge is a link nobody finds. */
  .navin { flex-wrap: wrap; padding-bottom: 6px; }
  .nlinks {
    order: 3;
    width: 100%;
    margin-left: -11px;
    margin-top: -2px;
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 0;
  }
  .nlinks a.sep { margin-left: 0; box-shadow: none; }
  .nright { order: 2; }
  .mark .wm { font-size: 15.5px; }
  section { padding-block: 48px; }
  .field.inline { grid-template-columns: 1fr; }
  .field.inline > label, .field.inline > :not(label) { grid-column: 1; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .st { border-left: 0; border-top: 1px solid var(--rule); padding-inline: 0; }
  .st:first-child { border-top: 0; }
  .row, .row.num { grid-template-columns: 1fr; gap: 6px; }
  .ev { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; }
  .ev .d { grid-column: 1 / -1; }
  .idx { grid-template-columns: 1fr; }
  .ic { border-left: 0 !important; }
  .join { grid-template-columns: 1fr; gap: 24px; }
  .qr { max-width: 168px; }
  .nowev { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
  .nowev .poster { max-width: 200px; }
  .arow { grid-template-columns: 1fr; }
  .arow .acts { justify-content: flex-start; }
  .codewrap { grid-template-columns: 1fr; }
  .searchbar { grid-template-columns: 1fr; }
  .prose { font-size: 15.5px; }
  /* Six admin tabs have to fit a 375px screen in one row; at the desktop
     padding the last one is pushed off the edge. */
  .adminnav a { padding: 10px 9px; font-size: 13px; }
}
