/* TokenBook product page.
   深色为主：产品截图本身是浅色的，深色外壳能让截图跳出来；配色沿用应用里各 Agent
   的标识色（橙 / 紫 / 青），和产品内部保持一致。 */

:root {
  --a1: #c2603f; /* Claude Code */
  --a2: #7c6bd6; /* OpenCode */
  --a3: #1f9c8b; /* iFlow */
  --brand: #e0703f;

  --bg: #0b0c0f;
  --panel: #121419;
  --panel-2: #171a20;
  --border: #23262e;
  --border-strong: #31353f;
  --fg: #e9ebf0;
  --muted: #9aa1ad;
  --dim: #6b7280;

  --radius: 14px;
  --wrap: 1120px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html[data-theme="light"] {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --panel-2: #fbfbfc;
  --border: #e4e5ea;
  --border-strong: #d3d5dc;
  --fg: #16181d;
  --muted: #5c6169;
  --dim: #83888f;
  --brand: #b8512c;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap.narrow {
  max-width: 780px;
}
.center {
  text-align: center;
}
.mono,
kbd,
code {
  font-family: var(--mono);
}
.skip {
  position: absolute;
  left: -9999px;
}

/* ── 导航 ─────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.nav.stuck {
  border-bottom-color: var(--border);
}
.nav-in {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}
.nav-links a {
  padding: 7px 11px;
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover {
  color: var(--fg);
  background: var(--panel-2);
}
.nav-links .gh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  color: var(--fg);
}
.nav-links .gh:hover {
  border-color: var(--border-strong);
}
.icon-btn,
.lang-btn {
  height: 32px;
  min-width: 34px;
  padding: 0 9px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover,
.lang-btn:hover {
  color: var(--fg);
  border-color: var(--border-strong);
}
.icon-btn svg {
  width: 15px;
  height: 15px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 88px 0 0;
  overflow: hidden;
}
.glow {
  position: absolute;
  inset: -320px 0 auto 50%;
  width: 1100px;
  height: 780px;
  transform: translateX(-50%);
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--a1) 26%, transparent),
    transparent 70%
  );
  filter: blur(30px);
  pointer-events: none;
}
html[data-theme="light"] .glow {
  /* 浅色底上同样的橙色会糊成一大片粉，收敛成顶部一小圈暖光 */
  inset: -260px 0 auto 50%;
  width: 760px;
  height: 520px;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--a1) 16%, transparent),
    transparent 68%
  );
}
html[data-theme="light"] .grid-mask {
  opacity: 0.35;
}
.grid-mask {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
  opacity: 0.5;
  pointer-events: none;
}
.hero .wrap {
  position: relative;
}
.eyebrow {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
h1 {
  margin: 0;
  font-size: clamp(38px, 5.6vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 680;
  max-width: 26ch; /* 宽到让 <br> 决定断行，而不是让它自己挤 */
}
h1 em {
  font-style: normal;
  background: linear-gradient(96deg, var(--a1), var(--a2) 52%, var(--a3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  margin: 24px 0 0;
  max-width: 62ch;
  font-size: clamp(16px, 1.6vw, 18.5px);
  color: var(--muted);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.cta-row.center {
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 20px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 560;
  border: 1px solid transparent;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:active {
  transform: translateY(1px);
}
.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 26px -12px color-mix(in srgb, var(--brand) 75%, transparent);
}
.btn.primary:hover {
  opacity: 0.92;
}
.btn.ghost {
  border-color: var(--border);
  color: var(--fg);
}
.btn.ghost:hover {
  border-color: var(--border-strong);
  background: var(--panel-2);
}
.install {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 720px;
  padding: 11px 12px 11px 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
}
.install code {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.copy {
  flex-shrink: 0;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
}
.copy:hover {
  color: var(--fg);
}
.hero-note {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--dim);
}

/* ── 截图框 ───────────────────────────────────────────────── */
.shot-wrap {
  margin-top: 56px;
}
.shot {
  margin: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}
html[data-theme="light"] .shot {
  box-shadow: 0 30px 70px -40px rgba(20, 22, 30, 0.35);
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
}
.shot figcaption {
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.shot-cap {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
}
.hero-shot {
  border-radius: var(--radius);
}

/* ── 定位一句话 ───────────────────────────────────────────── */
.reframe {
  padding: 120px 0 96px;
  text-align: center;
}
.reframe p {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.25;
  letter-spacing: -0.028em;
  font-weight: 620;
}
.reframe span {
  display: block;
  color: var(--dim);
}

/* ── 通用小节 ─────────────────────────────────────────────── */
section {
  padding: 84px 0;
}
h2 {
  margin: 0 0 14px;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.18;
  letter-spacing: -0.028em;
  font-weight: 650;
  max-width: 22ch;
}
h2.center {
  margin-left: auto;
  margin-right: auto;
}
h3 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.014em;
  font-weight: 600;
}
p {
  margin: 0 0 14px;
}
.sub {
  color: var(--muted);
  max-width: 56ch;
}
.sub.center {
  margin-left: auto;
  margin-right: auto;
}
.tag {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brand);
}
.ticks {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.ticks li {
  position: relative;
  padding-left: 26px;
  color: var(--muted);
  font-size: 15px;
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--brand);
}

/* ── 三张卡片 ─────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 34px;
}
.card {
  padding: 26px 24px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color 0.18s, transform 0.18s;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14.7px;
}
.dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c);
  margin-bottom: 16px;
}
kbd {
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--panel-2);
  font-size: 12px;
  color: var(--fg);
}

/* ── 左右分栏 ─────────────────────────────────────────────── */
.split-in {
  display: grid;
  grid-template-columns: 1fr 1.28fr;
  gap: 60px;
  align-items: center;
}
.split.flip .split-in {
  grid-template-columns: 1.28fr 1fr;
}
.split.flip .split-in > figure {
  order: -1;
}
.split-copy h2 {
  max-width: 18ch;
}

/* ── 整宽小节：面板类截图细节多，放半栏会看不清，索性占满一行 ── */
.wide-copy {
  max-width: 72ch;
}
.wide .shot {
  margin-top: 36px;
}
.wide .ticks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 30px;
  margin-top: 26px;
}
.wide-2col {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 26px;
  align-items: start;
  margin-top: 36px;
}
.wide-2col .code-card {
  margin-top: 0;
}

/* ── 导出示例 ─────────────────────────────────────────────── */
.code-card {
  margin-top: 26px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 13px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.code-head .mono {
  color: var(--dim);
  font-size: 11.5px;
}
.code-card pre {
  margin: 0;
  padding: 14px 15px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.2px;
  line-height: 1.62;
  color: var(--muted);
}
.code-card code {
  white-space: pre;
}
.tick-inline {
  font-family: var(--mono);
}

/* ── Agent 网格 ───────────────────────────────────────────── */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 34px;
}
.agent {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--c);
  border-radius: 11px;
  background: var(--panel);
}
.agent b {
  font-size: 15px;
  font-weight: 600;
}
.agent .mono {
  font-size: 11.5px;
  color: var(--dim);
  overflow-wrap: anywhere;
}
.agent-note {
  margin: 24px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--dim);
}

/* ── 步骤 ─────────────────────────────────────────────────── */
.steps {
  list-style: none;
  margin: 38px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: s;
}
.steps li {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.steps .n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
}
.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}
.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}
.agent .mono,
.install code {
  font-size: 0.86em;
}

/* ── 实现细节 ─────────────────────────────────────────────── */
.detail-in {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
}

/* ── FAQ ──────────────────────────────────────────────────── */
.faq details {
  border-bottom: 1px solid var(--border);
}
.faq summary {
  padding: 20px 34px 20px 0;
  position: relative;
  cursor: pointer;
  font-size: 16.5px;
  font-weight: 550;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 26px;
  width: 9px;
  height: 9px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s;
}
.faq details[open] summary::after {
  transform: rotate(-135deg);
  top: 30px;
}
.faq details p {
  margin: 0 0 22px;
  padding-right: 30px;
  color: var(--muted);
  font-size: 15px;
}

/* ── 收尾 ─────────────────────────────────────────────────── */
.end {
  padding: 110px 0 96px;
  border-top: 1px solid var(--border);
}
.end h2 {
  max-width: 26ch;
  margin: 0 auto 34px;
}

/* ── 页脚 ─────────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--border);
  padding: 34px 0 46px;
}
.foot-in {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.foot .brand {
  font-size: 15px;
}
.foot p {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--dim);
}
.foot-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--muted);
}
.foot-links a:hover {
  color: var(--fg);
}

/* ── 滚动入场 ─────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ── 响应式 ───────────────────────────────────────────────── */
@media (max-width: 980px) {
  .cards,
  .steps,
  .agent-grid {
    grid-template-columns: 1fr 1fr;
  }
  .wide .ticks,
  .wide-2col {
    grid-template-columns: 1fr;
  }
  .split-in,
  .split.flip .split-in,
  .detail-in {
    grid-template-columns: 1fr;
    gap: 34px;
  }
  .split.flip .split-in > figure {
    order: 0;
  }
}
@media (max-width: 720px) {
  .nav-links a:not(.gh) {
    display: none;
  }
  .hero {
    padding-top: 56px;
  }
  section {
    padding: 60px 0;
  }
  .reframe {
    padding: 72px 0 56px;
  }
  .cards,
  .steps,
  .agent-grid {
    grid-template-columns: 1fr;
  }
  h1 {
    max-width: none;
  }
}
