/* ============================================================
   一稿 · Design System
   单一强调色 #12B886 · 双主题 · 零外部字体依赖
   ============================================================ */

:root {
  /* Brand */
  --acc: #12b886;
  --acc-deep: #0ea271;
  --acc-soft: rgba(18, 184, 134, 0.1);
  --acc-line: rgba(18, 184, 134, 0.28);
  --ink-on-acc: #ffffff;

  /* Light surface */
  --bg: #f6f7f5;
  --bg-alt: #eef1ee;
  --surface: #ffffff;
  --surface-2: #fbfbfa;
  --ink: #14171a;
  --ink-2: #3d444c;
  --muted: #6d7480;
  --faint: #9aa1ab;
  --line: #e3e6e2;
  --line-strong: #d2d7d2;

  /* Semantic */
  --warn: #d97706;
  --danger: #d64545;
  --shadow-sm: 0 1px 2px rgba(20, 23, 26, 0.05);
  --shadow-md: 0 4px 16px -4px rgba(20, 23, 26, 0.09), 0 1px 2px rgba(20, 23, 26, 0.04);
  --shadow-lg: 0 24px 60px -24px rgba(20, 23, 26, 0.3), 0 2px 8px rgba(20, 23, 26, 0.05);

  /* Geometry */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI",
    "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --nav-h: 64px;
  --maxw: 1200px;
}

[data-theme="dark"] {
  --acc: #23d39b;
  --acc-deep: #17b788;
  --acc-soft: rgba(35, 211, 155, 0.12);
  --acc-line: rgba(35, 211, 155, 0.32);

  --bg: #0c0f11;
  --bg-alt: #111517;
  --surface: #15191c;
  --surface-2: #1a1f23;
  --ink: #eef2f0;
  --ink-2: #c3cbc8;
  --muted: #8d9794;
  --faint: #66706d;
  --line: #24292d;
  --line-strong: #313a3f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 18px -4px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.8);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 1;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-wrap: balance;
}

p { margin: 0; }

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

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

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

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

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

::selection { background: var(--acc-line); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--acc-deep);
}

.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 99px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
  border: 1px solid transparent;
  user-select: none;
}

.btn:active { transform: scale(0.975); }

.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary {
  background: var(--acc);
  color: var(--ink-on-acc);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 18px -8px var(--acc);
}
.btn-primary:hover { background: var(--acc-deep); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 10px 24px -10px var(--acc); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--faint); }

.btn-soft {
  background: var(--acc-soft);
  color: var(--acc-deep);
  border-color: var(--acc-line);
}
.btn-soft:hover { background: var(--acc-line); }

.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 15.5px; }

.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ---------- Theme toggle ---------- */
.theme-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s;
}
.theme-btn:hover { background: var(--surface-2); color: var(--ink); }
.theme-btn svg { width: 18px; height: 18px; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Utility ---------- */
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
