:root {
  --color-bg: #D8E0F2;
  --color-panel: #F6F8FD;
  --color-panel-recessed: #CBD6EC;
  --color-border: #BFCBE4;
  --color-accent: #DA3A2F;
  --color-accent-dark: #AE2A21;
  --color-accent-highlight: #F0654A;
  --color-text: #182035;
  --color-text-muted: #56617C;
  --color-success: #1E8E5A;
  --color-warning: #D98A12;
  --color-error: #B4231A;
  --color-white: #FFFFFF;
  --color-sky: #CDD8F0;
  --color-road: #B9C7E4;
  --color-road-mid: #C6D1EA;
  --color-sign: #1C2B52;
  --color-sign-end: #2A3F78;
  --color-shadow: rgba(24, 32, 53, .12);
  --color-shadow-soft: rgba(24, 32, 53, .08);
  --color-shadow-strong: rgba(24, 32, 53, .18);
  --color-grid: rgba(24, 32, 53, .10);
  --color-horizon: rgba(24, 32, 53, .16);
  --color-horizon-glow: rgba(255, 255, 255, .55);
  --color-clear: rgba(255, 255, 255, 0);
  --color-sign-soft: rgba(255, 255, 255, .82);
  --color-sign-dim: rgba(255, 255, 255, .58);
  --color-sign-line: rgba(255, 255, 255, .14);
  --color-sign-glass: rgba(255, 255, 255, .12);
  --color-sign-glass-border: rgba(255, 255, 255, .22);
  --color-sign-highlight: rgba(255, 255, 255, .18);
  --color-sign-sheen: rgba(255, 255, 255, .07);
  --color-cta-highlight: rgba(255, 255, 255, .28);
  --color-accent-shadow: rgba(218, 58, 47, .24);
  --color-accent-shadow-soft: rgba(218, 58, 47, .22);
  --color-black-shadow: rgba(0, 0, 0, .28);
  --color-flag-red: #D62D20;
  --color-flag-blue: #2E4A9E;
  --color-flag-japan: #C8102E;
  --color-maple: #C62828;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --radius-small: 6px;
  --radius-medium: 10px;
  --radius-large: 18px;
  --radius-pill: 999px;
  --header-height: 68px;
  --content-width: 1200px;
  --wide-width: 1360px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-space: clamp(64px, 9vw, 112px);
  --focus-width: 2px;
  --toc-offset: 132px;
  --hero-height: max(780px, calc(100svh - var(--header-height)));
  --sign-height: 192px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

html.nav-open {
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main,
section,
article,
aside,
header,
footer,
nav {
  max-width: 100%;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

p,
li,
dd {
  overflow-wrap: break-word;
}

code {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background: var(--color-sign);
  color: var(--color-white);
  font-family: var(--font-mono);
  -webkit-overflow-scrolling: touch;
}

pre code {
  overflow-wrap: normal;
  white-space: pre;
}

table {
  border-collapse: collapse;
}

ul,
ol {
  padding-left: 1.25em;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--color-text);
  text-wrap: balance;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(52px, 6vw, 72px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -.02em;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.015em;
}

h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.3;
}

p {
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1.8;
}

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

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

.wrap {
  width: 100%;
  max-width: calc(var(--content-width) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap-wide {
  width: 100%;
  max-width: calc(var(--wide-width) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}

.section-tight {
  padding-top: 56px;
  padding-bottom: 56px;
}

.no-break {
  white-space: nowrap;
}

.muted {
  color: var(--color-text-muted);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.panel,
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background: var(--color-panel);
  box-shadow: inset 0 1px 0 var(--color-white), 0 18px 44px var(--color-shadow-soft);
}

.panel {
  padding: clamp(22px, 4vw, 36px);
}

.badge,
.fact-pill,
.status-label {
  display: inline-flex;
  min-height: 28px;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.35;
}

.badge-dot,
.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-accent);
}

.status-dot.is-good {
  background: var(--color-success);
}

.btn {
  display: inline-flex;
  min-width: 148px;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-small);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, color .18s ease, background-color .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: var(--color-white);
  background: linear-gradient(180deg, var(--color-accent-highlight), var(--color-accent) 48%, var(--color-accent));
  box-shadow: inset 0 1px 0 var(--color-cta-highlight), 0 10px 22px var(--color-accent-shadow);
}

.btn-primary:hover {
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-dark));
  box-shadow: inset 0 1px 0 var(--color-cta-highlight), 0 7px 16px var(--color-accent-shadow-soft);
}

.btn-secondary,
.btn-ghost {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-white);
}

.btn-secondary:hover,
.btn-ghost:hover {
  border-color: var(--color-accent-dark);
  color: var(--color-accent-dark);
  background: var(--color-panel);
}

.btn-neutral {
  border-color: var(--color-border);
  color: var(--color-text);
  background: var(--color-panel);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.reveal {
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.pending {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.shown {
  opacity: 1;
  transform: none;
}

.site-header {
  position: relative;
  z-index: 80;
  height: var(--header-height);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
}

.header-inner {
  width: 100%;
  max-width: var(--wide-width);
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.site-brand img {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: .02em;
}

.brand-local {
  padding-left: 10px;
  border-left: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 13px;
}

.desktop-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 4px;
}

.desktop-nav > a,
.more-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-small);
  font-size: 15px;
}

.desktop-nav > a:hover,
.more-toggle:hover,
.language-toggle:hover {
  background: var(--color-bg);
}

.desktop-nav > a[aria-current="page"] {
  border-radius: 0;
  box-shadow: inset 0 -2px 0 var(--color-text);
}

.nav-more {
  position: relative;
}

.chevron {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.more-menu,
.language-menu {
  position: absolute;
  top: calc(100% + 7px);
  z-index: 92;
  display: none;
  min-width: 188px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background: var(--color-white);
  box-shadow: 0 18px 40px var(--color-shadow);
}

.more-menu {
  left: 0;
}

.language-menu {
  right: 0;
}

.nav-more:hover .more-menu,
.nav-more:focus-within .more-menu,
.nav-more.is-open .more-menu,
.language-control.is-open .language-menu {
  display: block;
}

.more-menu a,
.language-menu a {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius-small);
  font-size: 14px;
}

.more-menu a:hover,
.language-menu a:hover,
.language-menu a[aria-current="true"] {
  background: var(--color-bg);
}

.header-tools {
  margin-left: auto;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.language-control {
  position: relative;
}

.language-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-small);
  color: var(--color-text-muted);
  font-size: 14px;
}

.login-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-small);
  color: var(--color-accent);
  background: var(--color-white);
  font-size: 14px;
  font-weight: 650;
}

.login-link:hover {
  color: var(--color-white);
  background: var(--color-accent);
}

.menu-toggle {
  display: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-small);
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

.mobile-nav {
  position: fixed;
  top: var(--header-height);
  right: 0;
  left: 0;
  z-index: 88;
  display: none;
  max-height: calc(100dvh - var(--header-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px var(--gutter) 24px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
  box-shadow: 0 22px 42px var(--color-shadow);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav a {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
}

.mobile-language-title {
  margin: 20px 12px 6px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
}

.nav-veil {
  position: fixed;
  inset: var(--header-height) 0 0;
  z-index: 70;
  display: none;
  background: var(--color-shadow-strong);
}

.nav-veil.is-open {
  display: block;
}

.site-footer {
  overflow-x: clip;
  color: var(--color-sign-soft);
  background: linear-gradient(135deg, var(--color-sign), var(--color-sign-end));
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 1fr));
  gap: 44px;
  padding-top: 64px;
  padding-bottom: 48px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: 23px;
}

.footer-brand img {
  width: 36px;
  height: 36px;
}

.footer-intro {
  max-width: 360px;
  margin-top: 18px;
  color: var(--color-sign-soft);
  font-size: 14px;
  line-height: 1.8;
}

.footer-heading {
  margin: 4px 0 16px;
  color: var(--color-white);
  font-size: 14px;
  font-weight: 700;
}

.footer-links {
  display: grid;
  gap: 6px;
}

.footer-links a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  color: var(--color-sign-soft);
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--color-white);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 28px;
  border-top: 1px solid var(--color-sign-line);
  color: var(--color-sign-dim);
  font-size: 13px;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.prose {
  max-width: 820px;
}

.prose h2,
.prose h3 {
  scroll-margin-top: var(--toc-offset);
}

.prose p,
.prose li {
  font-size: 17px;
  line-height: 1.9;
}

.prose a {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose blockquote {
  margin-inline: 0;
}

#server-status {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  margin-bottom: 40px;
}

#server-status + * {
  margin-top: 0;
}

.decor-zone {
  position: relative;
  max-width: 100%;
  overflow-x: clip;
}

.decor-zone > [aria-hidden="true"] {
  max-width: 100%;
}

.tilt {
  transform: rotate(-.45deg);
}

body:has(.toc-tabs) section[id] {
  scroll-margin-top: var(--toc-offset);
}

@media (max-width: 1040px) {
  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .header-tools {
    margin-left: auto;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: clamp(34px, 9vw, 40px);
  }

  h2 {
    font-size: clamp(30px, 7vw, 38px);
  }

  .brand-local,
  .language-control {
    display: none;
  }

  .header-inner {
    gap: 10px;
  }

  .login-link {
    padding-inline: 13px;
  }

  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
    --hero-height: auto;
    --sign-height: auto;
  }

  .no-break {
    white-space: normal;
  }

  .wrap,
  .wrap-wide {
    padding-inline: var(--gutter);
  }

  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row .btn {
    width: 100%;
  }

  .tilt,
  [class*="tilt"] {
    transform: none;
  }

  .decor-zone > [aria-hidden="true"] {
    max-width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 390px) {
  .brand-word {
    font-size: 18px;
  }

  .site-brand img {
    width: 29px;
    height: 29px;
  }

  .login-link {
    min-height: 38px;
    padding-inline: 11px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .reveal,
  .reveal.pending {
    opacity: 1;
    transform: none;
  }
}