:root {
  --color-bg: #FBF6EC;
  --color-panel: #FFFDF7;
  --color-panel-muted: #F4EDDD;
  --color-border: #E5DBC6;
  --color-accent: #5B2FD6;
  --color-accent-dark: #4322A8;
  --color-text: #2C2418;
  --color-text-muted: #6F6450;
  --color-success: #2E7D4F;
  --color-warning: #B07C1E;
  --color-error: #BC3A2B;
  --color-on-accent: #FFFDF7;
  --color-overlay: rgba(44, 36, 24, 0.42);
  --color-accent-soft: rgba(91, 47, 214, 0.1);
  --color-accent-line: rgba(91, 47, 214, 0.07);
  --color-success-soft: rgba(46, 125, 79, 0.1);
  --color-muted-soft: rgba(111, 100, 80, 0.09);
  --color-paper-noise: rgba(44, 36, 24, 0.055);
  --color-shadow-soft: rgba(44, 36, 24, 0.07);
  --color-shadow-faint: rgba(44, 36, 24, 0.05);
  --color-shadow-accent: rgba(67, 34, 168, 0.17);
  --color-shadow-button: rgba(91, 47, 214, 0.24);
  --color-shadow-button-dark: rgba(67, 34, 168, 0.22);
  --color-flag-red: #D52B3F;
  --color-flag-red-dark: #AA151B;
  --color-flag-blue: #21468B;
  --color-flag-blue-dark: #3C3B6E;
  --color-flag-white: #FFFDF7;
  --font-display: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 3px var(--color-shadow-faint), 0 10px 26px var(--color-shadow-soft);
  --shadow-core: 0 2px 5px var(--color-shadow-soft), 0 26px 56px var(--color-shadow-accent);
  --shadow-button: 0 2px 6px var(--color-shadow-button-dark), 0 10px 24px var(--color-shadow-button);
  --header-height: 72px;
  --content-width: 1264px;
  --text-width: 760px;
  --gutter: 44px;
  --section-space: 104px;
  --focus-size: 2px;
  --transition-fast: 150ms ease;
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  background: var(--color-bg);
}

html.nav-open {
  overflow: hidden;
}

body {
  position: relative;
  min-height: 100svh;
  margin: 0;
  overflow-x: clip;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body::after {
  position: fixed;
  z-index: 60;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.055;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

img {
  height: auto;
}

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

button,
summary {
  cursor: pointer;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-dark);
}

a,
button,
summary,
[role="tab"],
select,
input,
textarea {
  -webkit-tap-highlight-color: var(--color-accent-soft);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[role="tab"]:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  border-radius: var(--radius-sm);
  outline: var(--focus-size) solid var(--color-accent);
  outline-offset: 3px;
}

p,
ul,
ol,
blockquote,
pre,
table {
  margin-top: 0;
  margin-bottom: 1.25em;
}

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

h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  line-height: 1.16;
  text-wrap: balance;
}

h1 {
  font-size: clamp(52px, 5.4vw, 68px);
  font-weight: 900;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 850;
  letter-spacing: -0.018em;
}

h3 {
  font-size: clamp(22px, 2.3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.012em;
}

h4 {
  font-size: 18px;
  font-weight: 750;
}

strong {
  color: var(--color-text);
  font-weight: 750;
}

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

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

code {
  overflow-wrap: anywhere;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel-muted);
  color: var(--color-text);
  -webkit-overflow-scrolling: touch;
}

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

hr {
  height: 1px;
  margin: 48px 0;
  border: 0;
  background: var(--color-border);
}

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

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

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

.section-muted {
  border-block: 1px solid var(--color-border);
  background: var(--color-panel);
}

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

.eyebrow,
.mono-label {
  color: var(--color-accent-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.gradient-text {
  color: transparent;
  background: linear-gradient(108deg, var(--color-accent), var(--color-accent-dark));
  background-clip: text;
  -webkit-background-clip: text;
}

.panel,
.card {
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
}

.card {
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.badge,
.tag,
.fact-pill {
  display: inline-flex;
  min-height: 28px;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-accent {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
}

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

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

.button,
.btn-primary,
.btn-secondary,
.btn-login {
  display: inline-flex;
  min-width: 24px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}

.btn-primary {
  padding: 15px 38px;
  border: 1px solid var(--color-accent-dark);
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  box-shadow: var(--shadow-button);
  color: var(--color-on-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-core);
}

.btn-secondary {
  padding: 14px 32px;
  border: 1px solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-text);
}

.btn-secondary:hover,
.btn-login:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
  box-shadow: var(--shadow-card);
}

.btn-login {
  min-height: 38px;
  padding: 8px 20px;
  border: 1px solid var(--color-border);
  background: var(--color-panel);
  color: var(--color-accent-dark);
  font-size: 14px;
}

.button[aria-disabled="true"],
.button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
  box-shadow: none;
}

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

.header-inner {
  display: flex;
  height: var(--header-height);
  align-items: center;
  gap: 30px;
}

.brand {
  display: inline-flex;
  min-width: max-content;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
}

.brand:hover {
  color: var(--color-text);
}

.brand-logo {
  display: block;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.brand-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

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

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

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.main-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 550;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--color-text);
}

.main-nav a.is-active {
  font-weight: 750;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-menu {
  position: relative;
}

.language-button {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 13px;
}

.language-list {
  position: absolute;
  z-index: 65;
  top: calc(100% + 8px);
  right: 0;
  width: 168px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-panel);
  box-shadow: var(--shadow-card);
}

.language-list[hidden] {
  display: none;
}

.language-list a {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}

.language-list a:hover,
.language-list a[aria-current="true"] {
  background: var(--color-panel-muted);
  color: var(--color-text);
}

.menu-toggle {
  display: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-panel);
}

.menu-toggle-lines,
.menu-toggle-lines::before,
.menu-toggle-lines::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-text);
}

.menu-toggle-lines {
  position: relative;
}

.menu-toggle-lines::before,
.menu-toggle-lines::after {
  position: absolute;
  left: 0;
  content: "";
}

.menu-toggle-lines::before {
  top: -6px;
}

.menu-toggle-lines::after {
  top: 6px;
}

.mobile-nav {
  display: none;
}

.mobile-nav-veil {
  display: none;
}

.site-footer {
  position: relative;
  z-index: 2;
  padding-top: 72px;
  padding-bottom: 28px;
  border-top: 1px solid var(--color-border);
  background: var(--color-panel);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) minmax(180px, 0.8fr) minmax(260px, 1fr) minmax(170px, 0.7fr);
  gap: 44px;
}

.footer-brand p {
  max-width: 30em;
  color: var(--color-text-muted);
}

.footer-title {
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 800;
}

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

.footer-links a {
  min-height: 30px;
  color: var(--color-text-muted);
  font-size: 14px;
}

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

.footer-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-language {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.footer-language a {
  min-height: 28px;
  color: var(--color-text-muted);
  font-size: 13px;
}

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

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

.footer-legal a {
  min-height: 28px;
  color: var(--color-text-muted);
}

.reveal {
  transition: opacity 600ms ease, transform 600ms ease;
}

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

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

.prose {
  min-width: 0;
  color: var(--color-text-muted);
}

.prose h2,
.prose h3,
.prose h4 {
  margin-top: 1.7em;
  margin-bottom: 0.65em;
}

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

.prose img,
.prose iframe {
  max-width: 100%;
}

.prose table {
  border-collapse: collapse;
}

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

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

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

  .mobile-nav-veil.is-open {
    position: fixed;
    z-index: 48;
    inset: var(--header-height) 0 0;
    display: block;
    border: 0;
    background: var(--color-overlay);
  }

  .mobile-nav.is-open {
    position: absolute;
    z-index: 55;
    top: var(--header-height);
    right: 0;
    left: 0;
    display: block;
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    padding: 12px var(--gutter) 22px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-panel);
    box-shadow: var(--shadow-card);
    overscroll-behavior: contain;
  }

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

  .mobile-nav a.is-active {
    color: var(--color-accent-dark);
    font-weight: 800;
  }

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

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

  h1 {
    font-size: clamp(34px, 10vw, 40px);
    line-height: 1.12;
  }

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

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

  .header-inner {
    gap: 10px;
  }

  .header-tools {
    gap: 8px;
    margin-left: auto;
  }

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

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

  .footer-brand {
    grid-column: 1 / -1;
  }

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

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

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

  .card {
    padding: 22px;
  }

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

  .badge,
  .tag,
  .fact-pill {
    height: auto;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

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

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

  .footer-brand {
    grid-column: auto;
  }

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

  .footer-keywords a {
    white-space: normal;
  }
}

@media (max-width: 390px) {
  .brand-local {
    display: none;
  }

  .brand-copy {
    gap: 0;
  }

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

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

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