:root {
  /* 与首页 app.css 同一套深色：底 #070904、卡片 #11140d、正文 #f4f6ee、主色荧光黄 */
  --paper: #070904;
  --surface: #11140d;
  --surface-2: #181c13;
  --ink: #f4f6ee;
  --muted: #b3baa9;
  --line: rgba(255, 255, 255, 0.13);
  --accent: #d2f84b;
  --accent-ink: #090c03;
  --tint: rgba(210, 248, 75, 0.08);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Hiragino Sans", "Noto Sans JP", "PingFang SC", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="hard"] { --link: #8ccaff; }
:root[data-theme="clay"] { --link: #ffab84; }
:root[data-theme="grass"] { --link: #94ec97; }
:root[data-theme="night"] { --link: #aab4ff; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, textarea { font: inherit; }
a { color: var(--link, var(--accent)); }
a, button, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.legal-top {
  position: sticky; top: 0; z-index: 2; background: rgba(7, 9, 4, 0.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line); padding: env(safe-area-inset-top) 5% 0;
}
.page-bar { max-width: 1300px; margin: auto; min-height: 76px; display: flex; align-items: center; justify-content: space-between; }
.home-bar { display: inline-flex; gap: 9px; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.home-bar img { width: 36px; height: 36px; border-radius: 9px; }
.home-bar b { font: italic 800 35px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; letter-spacing: -.075em; }
.langs { display: inline-flex; gap: 2px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.langs a { min-height: 38px; min-width: 44px; padding: 0 11px; display: grid; place-items: center; font-weight: 600; font-size: .84rem; text-decoration: none; color: var(--muted); border-radius: 999px; }
.langs a:hover { color: var(--ink); }
.langs a[aria-current] { color: var(--accent-ink); background: var(--accent); }
main.reading { width: min(790px, 90%); margin: auto; padding: clamp(34px, 5.5vw, 82px) 0 calc(68px + env(safe-area-inset-bottom, 0px) + max(0px,100lvh - 100svh)); font-size: 1rem; line-height: 1.8; overflow-wrap: anywhere; }
.reading h1, .reading h2 { text-wrap: pretty; }
.reading h1 { font-size: clamp(2.1rem, 4.4vw, 3.65rem); letter-spacing: -.045em; line-height: 1.18; margin: 0; }
.reading h2 { margin: 2.2em 0 .35em; font-size: clamp(1.22rem, 2vw, 1.52rem); line-height: 1.4; letter-spacing: -.025em; scroll-margin-top: calc(94px + env(safe-area-inset-top,0px)); }
.reading p, .reading ul { margin: .55em 0 1em; }
.reading li { margin: .4em 0; }
.reading ul { padding-inline-start: 1.35em; }
.reading .date { margin: 16px 0 25px; color: var(--muted); font-size: .875rem; }
.reading .note { color: var(--muted); }
.reading .toc { border-block: 1px solid var(--line); margin: 32px 0; padding: 18px 0; }
.toc b { display: block; color: var(--accent); margin-bottom: 7px; }
.toc ol { padding-inline-start: 1.6rem; margin: 0; columns: 2; column-gap: 38px; }
.toc li { break-inside: avoid; margin: 0; }
.toc a { display: inline-block; padding-block: 5px; line-height: 1.5; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.reading table { border-collapse: collapse; width: 100%; }
.reading th, .reading td { padding: 15px 12px; border-block-start: 1px solid var(--line); text-align: start; vertical-align: top; }
.reading th { width: 28%; color: var(--accent); background: var(--tint); font-weight: 650; }
.reading table { background: var(--surface); border-radius: 12px; overflow: hidden; }
.reading a:hover, .top:hover { text-decoration-thickness: 2px; }
.links { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 22px; border-top: 1px solid var(--line); margin-top: 44px; padding-top: 18px; font-size: .9rem; }
.links a, .top { min-height: 44px; display: inline-flex; align-items: center; }
.links [aria-current] { color: var(--muted); text-decoration: none; }
.links span { flex-basis: 100%; color: var(--muted); margin-top: 10px; }
.top { cursor: pointer; background: none; color: var(--link, var(--accent)); text-decoration: underline; border: 0; padding: 0; }
.cta { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-ink); min-height: 46px; margin-top: 14px; padding: 0 24px; border-radius: 100px; font-weight: 650; text-decoration: none; }
.error-code { font: 700 1.05rem/1.2 ui-monospace, monospace; letter-spacing: .07em; color: var(--accent); }
@media (max-width: 620px) {
  .page-bar { min-height: 61px; }
  .home-bar { gap: 6px; }
  .home-bar img { width: 29px; height: 29px; border-radius: 8px; }
  .home-bar b { font-size: 29px; }
  .reading h2 { scroll-margin-top: calc(79px + env(safe-area-inset-top,0px)); }
  .toc ol { columns: 1; }
  .reading th, .reading td { padding: 11px 8px; }
  .reading th { width: 31%; }
  .langs a { padding: 0 8px; min-width: 40px; font-size: .8rem; }
}
