:root {
  --color-canvas: #FFFFFF;
  --color-panel: #F7F8F8;
  --color-panel-strong: #EFF2F0;
  --color-line: #E4E8E6;
  --color-accent: #0CA958;
  --color-accent-dark: #067A42;
  --color-text: #141A17;
  --color-text-muted: #5B6661;
  --color-success: #12A15B;
  --color-warning: #E8A13A;
  --color-error: #F0564F;
  --color-hero-a: #34C98B;
  --color-hero-b: #FFB3AD;
  --color-white: #FFFFFF;
  --color-code-bg: #141A17;
  --color-code-text: #F7F8F8;
  --color-selection: #C8F2DF;
  --color-focus: #0CA958;
  --color-overlay: rgba(20, 26, 23, 0.42);
  --color-accent-wash: rgba(12, 169, 88, 0.14);
  --color-accent-glow: rgba(52, 201, 139, 0.18);
  --color-error-wash: rgba(240, 86, 79, 0.14);
  --color-white-soft: rgba(255, 255, 255, 0.64);
  --color-white-faint: rgba(255, 255, 255, 0.24);
  --color-dark-faint: rgba(20, 26, 23, 0.10);
  --color-shadow: rgba(20, 26, 23, 0.16);
  --color-shadow-strong: rgba(20, 26, 23, 0.30);
  --color-accent-shadow: rgba(6, 122, 66, 0.45);
  --color-hero-green-shadow: rgba(52, 201, 139, 0.44);
  --color-hero-pink-shadow: rgba(255, 179, 173, 0.50);

  --font-display: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-card: 40px;
  --radius-pill: 999px;

  --shadow-soft: 0 18px 42px -22px var(--color-shadow);
  --shadow-lift: 0 12px 28px -12px var(--color-accent-shadow);
  --shadow-card: 0 28px 60px -34px var(--color-shadow-strong);
  --shadow-chip: 0 16px 34px -16px var(--color-shadow-strong), 0 6px 14px -8px var(--color-shadow);
  --shadow-banner: 0 70px 130px -52px var(--color-hero-green-shadow), 0 52px 100px -44px var(--color-hero-pink-shadow), 0 30px 64px -30px var(--color-shadow-strong);
  --glow-dot: 0 0 0 5px var(--color-accent-wash);

  --content-max: 1200px;
  --reading-max: 820px;
  --header-max: 1280px;
  --gutter: clamp(16px, 3vw, 24px);
  --header-height: 70px;
  --section-space: clamp(72px, 10vw, 132px);
  --transition-fast: 180ms ease;
}

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

html {
  background: var(--color-canvas);
  color: var(--color-text);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
}

html.nav-open {
  overflow: hidden;
}

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

::selection {
  background: var(--color-selection);
  color: var(--color-text);
}

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

svg[aria-hidden="true"] {
  flex-shrink: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: var(--color-accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--color-error);
}

p,
h1,
h2,
h3,
h4,
ul,
ol,
dl,
dd,
figure,
blockquote,
pre {
  margin-top: 0;
}

p,
ul,
ol {
  margin-bottom: 1.15em;
}

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

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

h1 {
  margin-bottom: 0.45em;
  font-size: clamp(34px, 3.6vw, 48px);
  font-weight: 900;
  letter-spacing: 0.004em;
  line-height: 1.16;
}

h2 {
  margin-bottom: 0.55em;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 850;
  line-height: 1.22;
}

h3 {
  margin-bottom: 0.5em;
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 800;
  line-height: 1.3;
}

h4 {
  margin-bottom: 0.45em;
  font-size: 18px;
  font-weight: 800;
}

.title-keep {
  white-space: nowrap;
}

.text-accent {
  color: var(--color-accent-dark);
}

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

.kicker {
  margin-bottom: 10px;
  color: var(--color-accent-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

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

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

.section-head {
  max-width: 760px;
  margin-bottom: clamp(28px, 5vw, 52px);
}

.section-head > :last-child {
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid > * {
  min-width: 0;
}

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

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

.stack {
  display: grid;
  gap: 20px;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.cluster > svg,
.cluster > img,
.cluster > i {
  flex-shrink: 0;
}

.surface,
.card {
  overflow-wrap: anywhere;
  background: var(--color-panel);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.surface {
  padding: clamp(24px, 4vw, 44px);
}

.card {
  padding: clamp(22px, 3vw, 34px);
}

.panel-strong {
  background: var(--color-panel-strong);
  color: var(--color-text);
}

.tilt,
.tilt-left,
.tilt-right {
  transform: rotate(-0.6deg);
}

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

.badge,
.tag {
  display: inline-flex;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--color-panel-strong);
  color: var(--color-accent-dark);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-overflow: clip;
  white-space: nowrap;
}

.badge-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  box-shadow: var(--glow-dot);
}

.badge-error {
  background: var(--color-error-wash);
  color: var(--color-text);
}

.button,
.btn {
  display: inline-flex;
  min-height: 50px;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 28px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-lift);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  transition: transform var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.button:hover,
.btn:hover {
  transform: translateY(-2px);
  background: var(--color-accent-dark);
  color: var(--color-white);
}

.button-secondary,
.btn-ghost {
  background: var(--color-canvas);
  color: var(--color-text);
  box-shadow: var(--shadow-soft);
}

.button-secondary:hover,
.btn-ghost:hover {
  background: var(--color-canvas);
  color: var(--color-error);
}

.button-danger {
  background: var(--color-error);
  color: var(--color-white);
  box-shadow: var(--shadow-card);
}

.button-danger:hover {
  background: var(--color-text);
  color: var(--color-white);
}

.button-small {
  min-height: 42px;
  padding: 10px 20px;
  font-size: 14px;
}

.button[aria-disabled="true"],
.button:disabled {
  cursor: not-allowed;
  transform: none;
  background: var(--color-line);
  color: var(--color-text-muted);
  box-shadow: none;
}

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

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

:not(pre) > code {
  overflow-wrap: anywhere;
  padding: 0.12em 0.38em;
  border-radius: var(--radius-xs);
  background: var(--color-panel-strong);
  color: var(--color-text);
  font-size: 0.9em;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--color-code-bg);
  color: var(--color-code-text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}

pre code {
  color: inherit;
  white-space: pre;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: var(--color-canvas);
  color: var(--color-text);
}

.data-table th,
.data-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--color-panel-strong);
  color: var(--color-text);
  font-weight: 800;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.prose {
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.prose h2,
.prose h3,
.prose h4,
.prose strong {
  color: var(--color-text);
}

.prose > * {
  max-width: 100%;
}

.prose > .data-table {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms ease, transform 620ms ease;
}

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

.site-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-canvas);
  color: var(--color-text);
}

.site-topbar-inner {
  display: flex;
  width: 100%;
  max-width: min(100%, calc(var(--header-max) + var(--gutter) * 2));
  height: var(--header-height);
  margin-inline: auto;
  padding-inline: var(--gutter);
  align-items: center;
  gap: 26px;
}

.site-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 850;
  text-decoration: none;
}

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

.site-brand img {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.desktop-nav {
  margin-left: auto;
}

.desktop-nav-list {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: center;
  list-style: none;
}

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

.desktop-nav-list li + li::before {
  margin-inline: 17px;
  color: var(--color-line);
  content: "·";
  font-weight: 800;
}

.desktop-nav-list a {
  display: flex;
  min-height: 44px;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.desktop-nav-list a:hover {
  color: var(--color-error);
}

.desktop-nav-list a[aria-current="page"] {
  color: var(--color-accent-dark);
}

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

.language-control {
  position: relative;
}

.language-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.language-button:hover {
  color: var(--color-error);
}

.language-short {
  display: none;
}

.language-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 176px;
  margin: 0;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--color-canvas);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
  list-style: none;
}

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

.language-menu a {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

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

.nav-toggle {
  display: none;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 10px;
  border-radius: var(--radius-pill);
  background: var(--color-panel);
  color: var(--color-text);
}

.nav-toggle-lines,
.nav-toggle-lines::before,
.nav-toggle-lines::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: currentColor;
  content: "";
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.nav-toggle-lines {
  position: relative;
  margin-inline: auto;
}

.nav-toggle-lines::before {
  position: absolute;
  top: -6px;
}

.nav-toggle-lines::after {
  position: absolute;
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-lines::after {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-nav {
  display: none;
}

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

.site-footer {
  margin-top: var(--section-space);
  padding-top: clamp(56px, 8vw, 92px);
  padding-bottom: 28px;
  overflow-x: clip;
  background: var(--color-panel);
  color: var(--color-text);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr 1.2fr 0.8fr;
  gap: clamp(28px, 5vw, 68px);
}

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

.footer-title {
  margin-bottom: 16px;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 850;
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li + li {
  margin-top: 9px;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: 14px;
  text-decoration: none;
}

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

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

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

.footer-legal a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

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

  .nav-toggle {
    display: block;
  }

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

  .mobile-nav-veil[hidden] {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    top: var(--header-height);
    right: 0;
    left: 0;
    z-index: 101;
    display: block;
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    padding: 10px var(--gutter) 24px;
    overscroll-behavior: contain;
    background: var(--color-canvas);
    color: var(--color-text);
    box-shadow: var(--shadow-card);
  }

  .mobile-nav[hidden] {
    display: none;
  }

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

  .mobile-nav a {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    color: var(--color-text-muted);
    font-weight: 750;
    text-decoration: none;
  }

  .mobile-nav a:hover,
  .mobile-nav a[aria-current="page"],
  .mobile-nav a[aria-current="true"] {
    background: var(--color-panel);
    color: var(--color-accent-dark);
  }

  .mobile-language-title {
    margin: 18px 12px 5px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.12em;
  }

  .mobile-language-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 768px) {
  h1 {
    font-size: clamp(24px, 7vw, 30px);
    line-height: 1.18;
  }

  h2 {
    font-size: clamp(25px, 7vw, 32px);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .tilt,
  .tilt-left,
  .tilt-right {
    transform: none;
  }

  .site-brand-name {
    font-size: 16px;
  }

  .language-full {
    display: none;
  }

  .language-short {
    display: inline;
  }

  .language-button {
    min-width: 44px;
    justify-content: center;
    padding-inline: 10px;
  }

  .language-menu {
    display: none;
  }

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

  .button,
  .btn {
    padding-inline: 22px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 14px;
  }

  pre {
    padding: 17px;
    font-size: 12px;
  }
}

@media (max-width: 390px) {
  .site-topbar-inner {
    gap: 10px;
  }

  .site-brand-name {
    max-width: 116px;
    font-size: 15px;
    line-height: 1.2;
  }

  .header-tools {
    gap: 4px;
  }

  .mobile-language-list {
    grid-template-columns: 1fr;
  }
}

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

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

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