
@font-face {
  font-family: "平台题宋";
  src: url("./assets/edition-serif.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --edition-serif: "平台题宋", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --edition-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --paper: #fff;
  --pine: #253e36;
  --cinnabar: #a24330;
  --bg: var(--paper);
  --ink: #263a32;
  --muted: #5c6661;
  --line: #e0e6e2;
  --green: #365e4f;
  --white: #fff;
  font-family: var(--edition-sans);
  background-color: var(--paper);
}

body { background: var(--paper); }
.container { max-width: 1456px; width: min(92%, calc(100% - 48px)); }
#portal:focus { outline: 0; }
#portal { min-width: 0; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
.skip-content {
  position: fixed; left: 12px; top: -90px; z-index: 50;
  background: var(--pine); color: #fff; padding: 10px 20px;
}
.skip-content:focus { top: 12px; }
.edition-head {
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding-top: env(safe-area-inset-top, 0px);
}
.edition-head-inner {
  min-height: 66px; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: clamp(16px, 3vw, 50px);
}
.edition-brand {
  display: inline-flex; justify-self: start; align-items: center; gap: 11px;
  color: #233d32; white-space: nowrap;
  font: 700 clamp(19px, 1.4vw, 24px)/1.2 var(--edition-serif); letter-spacing: .055em;
}
.edition-brand b {
  position: relative; isolation: isolate; display: grid; place-items: center;
  width: 32px; height: 34px; padding: 0 0 2px 1px; border-radius: 5px 2px 4px 2px;
  background: var(--cinnabar); color: #fff1d4; transform: rotate(-4deg);
  font: 700 25px/1 var(--edition-serif); letter-spacing: 0;
}
.edition-brand b::before {
  content: ""; position: absolute; inset: 2px; pointer-events: none;
  border: 1px solid #edd4af8c; border-radius: 3px 1px 2px 1px;
}
.edition-menu { height: 100%; display: flex; align-items: stretch; gap: clamp(18px, 2.5vw, 42px); }
.edition-menu a {
  position: relative; display: grid; align-content: center; padding: 0 3px;
  color: #5a6257; font-size: 14px; letter-spacing: .035em; white-space: nowrap;
}
.edition-menu a[aria-current] { color: var(--pine); font-weight: 700; }
.edition-menu a[aria-current]::after {
  content: ""; position: absolute; left: 50%; bottom: 9px;
  width: 17px; height: 2px; transform: translateX(-50%); background: var(--cinnabar);
}
.edition-utilities {
  display: flex; align-items: center; justify-self: end; gap: 18px;
  color: #535e52; font-size: 12px;
}
.edition-utilities a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.edition-utilities svg, .edition-dock svg {
  display: block; width: 18px; height: 18px; fill: none;
  stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
.edition-dock { display: none; }
#popup {
  border: 0; border-radius: 7px; background: #fff; color: var(--pine);
}
#popup h2 { font: 700 27px/1.35 var(--edition-serif); letter-spacing: .025em; }
#popup .popup-tag { color: var(--cinnabar); }
#popup :is(.primary,.x) { min-height: 42px; border-radius: 2px; }
#popup .primary { background: var(--pine); }
@media (hover:hover) {
  .edition-menu a:hover, .edition-utilities a:hover { color: var(--cinnabar); }
}
@media (min-width: 720px) and (max-width: 980px) {
  .edition-head-inner { gap: 15px; }
  .edition-menu { gap: 15px; }
  .edition-utilities { gap: 9px; }
  .edition-utilities a { width: 32px; justify-content: center; }
  .edition-utilities span { display: none; }
}
@media (max-width: 719px) {
  html { scroll-padding-bottom: calc(74px + env(safe-area-inset-bottom,0px)); }
  html body { padding-bottom: calc(62px + env(safe-area-inset-bottom,0px)); }
  .container { width: calc(100% - 30px); }
  .edition-head-inner { min-height: 48px; display: flex; justify-content: space-between; gap: 8px; }
  .edition-brand { gap: 8px; font-size: 17px; }
  .edition-brand b { width: 25px; height: 27px; font-size: 20px; }
  .edition-menu, .edition-utilities span { display: none; }
  .edition-utilities { gap: 0; margin-right: -7px; }
  .edition-utilities a { width: 40px; justify-content: center; }
  main.container { padding-top: 13px; padding-bottom: 14px; }
  .edition-dock {
    position: fixed; z-index: 12; left: 0; right: 0; bottom: 0;
    padding: 0 max(8px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(8px,env(safe-area-inset-left,0px));
    display: grid; grid-template-columns: repeat(4,minmax(0,1fr));
    border-top: 1px solid var(--line); background: #fff;
  }
  .edition-dock a {
    min-height: 59px; min-width: 0; position: relative; display: flex;
    justify-content: center; align-items: center; gap: 6px; color: #687065;
    font-size: 13px; font-weight: 500; touch-action: manipulation; user-select: none;
  }
  .edition-dock svg { width: 22px; height: 22px; }
  .edition-dock a[aria-current] { color: #973f2b; font-weight: 700; }
  .edition-dock a[aria-current]::before {
    content: ""; position: absolute; top: -1px; left: 50%; height: 3px; width: 27px;
    transform: translateX(-50%); background: var(--cinnabar); border-radius: 0 0 2px 2px;
  }
  .edition-dock a[aria-current] .nav-accent { stroke-width: 2; }
  .edition-dock a[data-pressing] { background: #eae5d9; }
  .edition-dock a:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: -4px; }
}

@media (forced-colors:active) {
  .edition-menu a[aria-current], .edition-dock a[aria-current] { text-decoration: underline; }
}
