/* Newsreader、Source Sans 3，SIL OFL。许可证见 assets/fonts/ 下的 OFL 文本。 */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/sourcesans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/sourcesans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/sourcesans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f3efe7;
  --bg-elev: #faf7f2;
  --ink: #1d1915;
  --muted: #6d665e;
  --faint: #8a8177;
  --rule: #ddd4c7;
  --rule-strong: #cfc4b6;
  --accent: #7c3c32;
  --accent-soft: #f3e4de;
  --chip: #ebe4da;
  --serif: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "Source Sans 3", "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "WenQuanYi Micro Hei", "Microsoft YaHei", sans-serif;
  --wide: 44rem;
  --pad: 1.35rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141210;
    --bg-elev: #1d1a17;
    --ink: #f3ece4;
    --muted: #b3a89e;
    --faint: #8e857c;
    --rule: #322c27;
    --rule-strong: #4a423b;
    --accent: #e4aa9a;
    --accent-soft: #2c221e;
    --chip: #241f1c;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141210;
  --bg-elev: #1d1a17;
  --ink: #f3ece4;
  --muted: #b3a89e;
  --faint: #8e857c;
  --rule: #322c27;
  --rule-strong: #4a423b;
  --accent: #e4aa9a;
  --accent-soft: #2c221e;
  --chip: #241f1c;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe7;
  --bg-elev: #faf7f2;
  --ink: #1d1915;
  --muted: #6d665e;
  --faint: #8a8177;
  --rule: #ddd4c7;
  --rule-strong: #cfc4b6;
  --accent: #7c3c32;
  --accent-soft: #f3e4de;
  --chip: #ebe4da;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(980px 420px at 50% -12%, rgba(124, 60, 50, 0.07), transparent 62%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  transition: background-color 180ms ease, color 180ms ease;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

a {
  color: inherit;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--bg-elev);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  z-index: 3;
}

.skip:focus {
  top: 0.7rem;
}

.site-header,
.site-footer {
  border-color: var(--rule);
}

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header-inner,
.site-footer-inner,
main {
  width: min(100% - var(--pad) * 2, var(--wide));
  margin-inline: auto;
}

.site-header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0 0.85rem;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
  line-height: 1;
}

.wordmark span {
  margin-left: 0.55rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.92rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.theme-toggle {
  font: inherit;
  font-size: 0.86rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.when-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .when-light {
    display: none;
  }

  :root:not([data-theme="light"]) .when-dark {
    display: inline;
  }
}

:root[data-theme="dark"] .when-light {
  display: none;
}

:root[data-theme="dark"] .when-dark {
  display: inline;
}

:root[data-theme="light"] .when-light {
  display: inline;
}

:root[data-theme="light"] .when-dark {
  display: none;
}

main {
  flex: 1;
  padding: 2.4rem 0 3.2rem;
}

.kicker {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-title,
.issue-date {
  margin: 0.35rem 0 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.page-title {
  font-size: clamp(2.5rem, 6vw, 3.6rem);
}

.issue-date {
  font-size: clamp(2.7rem, 7vw, 4.4rem);
}

.lede,
.section-note,
.empty {
  color: var(--muted);
}

.lede {
  max-width: 36rem;
  margin: 0.85rem 0 0;
  font-size: 1.08rem;
}

.accent-rule {
  width: 2.25rem;
  height: 2px;
  margin: 1.15rem 0 0;
  border: 0;
  background: var(--accent);
}

.sample-flag {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  margin: 1.35rem 0 0;
  padding: 0.7rem 0.85rem;
  background: var(--accent-soft);
  border-radius: 2px;
  font-size: 0.95rem;
}

.sample-flag strong {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.archive {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.archive a {
  display: grid;
  grid-template-columns: minmax(8.5rem, 12rem) 1fr auto;
  column-gap: 1.2rem;
  align-items: baseline;
  padding: 1rem 0.15rem;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
}

.archive li:last-child a {
  border-bottom: 1px solid var(--rule);
}

.archive li:first-child a {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.archive time {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.archive li:first-child time {
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  letter-spacing: -0.03em;
}

.issue-name {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.issue-count {
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.archive a:hover time,
.archive a:hover .issue-name {
  color: var(--accent);
}

.badge {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.05rem 0.42rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  vertical-align: 0.18em;
}

.segment {
  position: relative;
  display: inline-flex;
  gap: 0.1rem;
  margin: 1.5rem 0 0;
  padding: 0.2rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--chip);
}

.segment input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segment label {
  border-radius: 999px;
  padding: 0.32rem 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.issue:has(#view-all:checked) label[for="view-all"],
.issue:has(#view-a:checked) label[for="view-a"],
.issue:has(#view-b:checked) label[for="view-b"] {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}

.issue:has(#view-a:checked) .section-b,
.issue:has(#view-b:checked) .section-a {
  display: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin: 2.1rem 0 0.35rem;
}

.section-mark {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}

.section-head h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-note {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.story,
.remark {
  padding: 1.15rem 0 0.35rem;
  border-top: 1px solid var(--rule);
}

.story {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  column-gap: 0.75rem;
}

.rank {
  padding-top: 0.28rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.story h3,
.remark h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.42rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.story h3 a {
  text-decoration: none;
}

.story h3 a:hover,
.remark h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.dek {
  margin: 0.45rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
}

.thread {
  margin-top: 0.75rem;
}

.thread summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.thread summary::-webkit-details-marker {
  display: none;
}

.thread summary::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.thread[open] summary {
  color: var(--ink);
}

.thread[open] summary::before {
  transform: rotate(45deg) translate(-0.05rem, -0.05rem);
}

.thread-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 200ms ease;
}

.thread[open] .thread-body {
  grid-template-rows: 1fr;
}

.thread-body > div {
  overflow: hidden;
}

.comment {
  padding: 0.15rem 0 0.85rem;
}

.comment + .comment {
  border-top: 1px solid var(--rule);
  margin-top: 0.15rem;
  padding-top: 0.75rem;
}

.comment header,
.remark .meta {
  font-size: 0.86rem;
}

.comment header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.who {
  color: var(--ink);
  font-weight: 600;
}

blockquote {
  margin: 0.35rem 0 0;
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.55;
}

blockquote p {
  margin: 0.35rem 0 0;
}

.comment-link {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
}

.comment-link a,
.site-footer a,
.lede a {
  color: var(--muted);
  text-underline-offset: 0.18em;
}

.comment-link a:hover,
.site-footer a:hover,
.lede a:hover {
  color: var(--accent);
}

.empty {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
}

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer-inner {
  padding: 1.15rem 0 2.2rem;
}

.site-footer p {
  margin: 0.3rem 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .archive a {
    grid-template-columns: 1fr auto;
    row-gap: 0.2rem;
  }

  .issue-name {
    grid-column: 1 / -1;
  }

  .story h3,
  .remark h3 {
    font-size: 1.28rem;
  }

  .site-header-inner {
    align-items: center;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media print {
  .theme-toggle,
  .segment,
  .skip {
    display: none !important;
  }

  .section-a,
  .section-b {
    display: block !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .thread-body,
  .thread[open] .thread-body {
    display: block;
  }

  .thread-body > div {
    overflow: visible;
  }
}
