:root {
  --color-canvas: #FCFCFC;
  --color-panel: #FFFFFF;
  --color-panel-soft: #F4F5F5;
  --color-border: #E2E4E3;
  --color-flow: #C7CCCA;
  --color-accent: #0EA588;
  --color-accent-strong: #0A7D67;
  --color-text: #16181A;
  --color-text-muted: #5D6362;
  --color-success: #1E9E5A;
  --color-warning: #C07A1E;
  --color-error: #C24439;
  --color-flag-red: #CE3B3B;
  --color-flag-blue: #2B4C8C;
  --color-flag-gold: #E0B93B;
  --color-flag-black: #1F2224;
  --color-flag-white: #FFFFFF;
  --color-accent-wash: rgba(14, 165, 136, 0.12);
  --color-overlay: rgba(22, 24, 26, 0.34);
  --font-display: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', 'Menlo', 'Consolas', 'Liberation Mono', monospace;
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --content-max: 1240px;
  --reading-max: 760px;
  --gutter: 40px;
  --section-space: 104px;
  --header-height: 64px;
  --toc-offset: 82px;
  --line-body: 1.72;
  --transition-fast: 150ms ease;
  --transition-reveal: 520ms cubic-bezier(.22, .61, .36, 1);
}

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

html {
  min-width: 0;
  scroll-behavior: smooth;
  background: var(--color-canvas);
}

html.nav-open {
  overflow: hidden;
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: clip;
  background: var(--color-canvas);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: var(--line-body);
  text-rendering: optimizeLegibility;
}

main,
section,
article,
aside,
header,
footer,
nav,
div {
  min-width: 0;
}

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

img {
  height: auto;
}

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

button,
summary,
select {
  cursor: pointer;
}

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

a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

li {
  min-width: 0;
}

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

p {
  margin-bottom: 1em;
}

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

h1 {
  margin-bottom: 24px;
  font-size: clamp(52px, 5.2vw, 72px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.12;
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.16;
}

h3 {
  margin-bottom: 14px;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  line-height: 1.28;
}

h4 {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 600;
}

strong {
  font-weight: 600;
}

code,
kbd,
samp {
  font-family: var(--font-mono);
}

:not(pre) > code {
  overflow-wrap: anywhere;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-panel-soft);
  padding: 0.12em 0.36em;
  font-size: 0.9em;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-panel-soft);
  padding: 18px;
  -webkit-overflow-scrolling: touch;
}

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

table {
  border-collapse: collapse;
}

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

.reading {
  width: 100%;
  max-width: var(--reading-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

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

.section-head {
  max-width: 790px;
  margin-bottom: 42px;
}

.section-head.centered {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-accent);
  content: "";
}

.mono-label {
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.accent {
  color: var(--color-accent-strong);
}

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

.panel,
.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel);
}

.panel {
  padding: 30px;
}

.card {
  padding: 24px;
}

.soft-panel {
  border-radius: var(--radius-md);
  background: var(--color-panel-soft);
  padding: 30px;
}

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

.button,
.btn-main,
.btn-sub,
.btn-login {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 13px 28px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.button-primary,
.btn-main,
.btn-login {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-panel);
}

.button-primary:hover,
.btn-main:hover,
.btn-login:hover {
  border-color: var(--color-accent-strong);
  background: var(--color-accent-strong);
}

.button-secondary,
.btn-sub {
  border-color: var(--color-border);
  background: var(--color-panel);
  color: var(--color-text);
}

.button-secondary:hover,
.btn-sub:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--color-accent-strong);
}

.button[aria-disabled="true"],
.button:disabled {
  cursor: not-allowed;
  border-color: var(--color-border);
  background: var(--color-panel-soft);
  color: var(--color-text-muted);
}

.badge-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.badge-accent {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}

.badge-success {
  color: var(--color-success);
}

.badge-warning {
  color: var(--color-warning);
}

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

.site-head {
  position: relative;
  z-index: 50;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-canvas);
}

.head-row {
  display: flex;
  height: var(--header-height);
  align-items: center;
  gap: 24px;
  /* 2026-08-19 用户打回「导航栏宽度不够」:1240 容器塞 logo+8 项菜单+工具区
     只剩 48px 余量,视觉拥挤。导航条单独放宽,正文阅读列不动 */
  max-width: 1360px;
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-local {
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 400;
}

.head-nav {
  min-width: 0;
  flex: 1;
}

.head-nav ul {
  display: flex;
  align-items: center;
  justify-content: center;   /* 菜单在 logo 与工具区之间的中段均匀居中,不再挤成一坨 */
  list-style: none;
  white-space: nowrap;
}

.head-nav li {
  display: flex;
  align-items: center;
}

.head-nav li + li::before {
  padding-inline: clamp(10px, 1.2vw, 17px);   /* 宽屏下分隔间距随之拉开 */
  color: var(--color-flow);
  content: "·";
  font-weight: 600;
}

.head-nav a {
  font-size: 13px;
  transition: color var(--transition-fast);
}

.head-nav a:hover,
.head-nav a.is-active,
.head-nav a[aria-current="page"] {
  color: var(--color-accent-strong);
}

.head-tools {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.lang-menu {
  position: relative;
}

.lang-trigger,
.menu-toggle {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
}

.lang-trigger {
  padding-inline: 8px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.lang-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 164px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-panel);
}

.lang-popover[hidden] {
  display: none;
}

.lang-popover a {
  display: block;
  min-height: 42px;
  padding: 9px 14px;
  font-size: 13px;
}

.lang-popover a:hover,
.lang-popover a[aria-current="true"] {
  background: var(--color-panel-soft);
  color: var(--color-accent-strong);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}

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

.mobile-nav {
  display: none;
}

.nav-veil {
  display: none;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-panel);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 54px;
  padding-top: 58px;
  padding-bottom: 42px;
}

.footer-brand p {
  max-width: 390px;
  margin-top: 18px;
  color: var(--color-text-muted);
  font-size: 14px;
}

.footer-title {
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  list-style: none;
}

.footer-links a,
.footer-hot a,
.footer-languages a {
  color: var(--color-text-muted);
  font-size: 14px;
}

.footer-links a:hover,
.footer-hot a:hover,
.footer-languages a:hover {
  color: var(--color-accent-strong);
}

.footer-hot,
.footer-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
  padding-bottom: 26px;
  color: var(--color-text-muted);
  font-size: 13px;
}

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

.reveal {
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

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

.reveal.shown {
  opacity: 1;
  transform: translateY(0);
}

.tilt,
.tilt-card {
  transform: rotate(-0.35deg);
}

.prose {
  max-width: var(--reading-max);
  color: var(--color-text);
}

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

.prose ul,
.prose ol {
  margin: 0 0 22px 1.25em;
}

.prose li + li {
  margin-top: 8px;
}

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

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

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

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

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

  .mobile-nav {
    position: absolute;
    z-index: 60;
    top: var(--header-height);
    right: 0;
    left: 0;
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-panel);
    padding: 10px var(--gutter) 18px;
    -webkit-overflow-scrolling: touch;
  }

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

  .mobile-nav ul {
    list-style: none;
  }

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

  .mobile-nav a.is-active {
    color: var(--color-accent-strong);
  }

  .mobile-language-list {
    margin-top: 12px;
  }

  .mobile-language-list a {
    color: var(--color-text-muted);
  }

  .nav-veil {
    position: fixed;
    z-index: 40;
    inset: var(--header-height) 0 0;
    background: var(--color-overlay);
  }

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

@media (max-width: 768px) {
  :root {
    --gutter: 20px;
    --section-space: 76px;
  }

  h1 {
    font-size: clamp(32px, 9.6vw, 40px);
    line-height: 1.14;
  }

  h2 {
    font-size: clamp(29px, 8vw, 38px);
  }

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

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

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

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

  body {
    font-size: 15px;
  }

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

  .head-row {
    gap: 10px;
  }

  .head-tools {
    margin-left: auto;
    gap: 4px;
  }

  .btn-login {
    min-height: 40px;
    padding-inline: 15px;
    font-size: 13px;
  }

  .panel,
  .card,
  .soft-panel {
    padding: 20px;
  }

  .button-row {
    width: 100%;
  }

  .button-row .button,
  .button-row .btn-main,
  .button-row .btn-sub {
    flex: 1 1 140px;
  }

  .footer-links {
    grid-template-columns: 1fr 1fr;
  }

  .tilt,
  .tilt-card {
    transform: none;
  }
}

@media (max-width: 380px) {
  .brand-name {
    font-size: 17px;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .btn-login {
    padding-inline: 12px;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }

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