:root {
  color-scheme: light dark;

  --ink: #1a2332;
  --ink-secondary: #4a5568;
  --ink-muted: #718096;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-raised: #ffffff;
  --bg: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;

  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-subtle: rgba(13, 148, 136, 0.08);
  --accent-glow: rgba(13, 148, 136, 0.15);

  --hero-bg: #10212b;
  --hero-text: #f1f5f9;
  --hero-muted: rgba(241, 245, 249, 0.7);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", Consolas, monospace;

  --container: 1080px;
  --content: 760px;
}

[data-theme="dark"] {
  --ink: #e2e8f0;
  --ink-secondary: #a0aec0;
  --ink-muted: #718096;
  --surface: #1e293b;
  --surface-alt: #0f172a;
  --surface-raised: #334155;
  --bg: #0f172a;
  --border: #334155;
  --border-subtle: #1e293b;

  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-subtle: rgba(45, 212, 191, 0.1);
  --accent-glow: rgba(45, 212, 191, 0.2);

  --hero-bg: #071217;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, p, dd {
  overflow-wrap: anywhere;
}

code {
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  font-family: var(--font-mono);
  font-size: 0.875em;
}

pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

pre code {
  padding: 0;
  background: transparent;
}

table {
  border-collapse: collapse;
}

figure {
  margin: 0;
}

.loading-screen,
.error-state {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 30px;
  text-align: center;
}

.loading-mark {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeIn 0.5s ease both;
}

.animate-in-delayed {
  animation: fadeIn 0.5s 0.15s ease both;
}
