/* ============================================================
   ChatKit 官网 — 视觉规范：warm parchment / 衬线标题气质
   所有灰都带黄褐底色，不用冷灰；强调色只用 terracotta。
   ============================================================ */

:root {
  --paper: #f5f4ed;
  --ivory: #faf9f5;
  --white: #ffffff;
  --sand: #e8e6dc;

  --ink: #141413;
  --ink-2: #4d4c48;
  --muted: #5e5d59;
  --faint: #87867f;
  --on-dark: #b0aea5;

  --terracotta: #c96442;
  --coral: #d97757;
  --moss: #6b7c5f;

  --line: #f0eee6;
  --line-2: #e8e6dc;
  --ring: #d1cfc5;
  --dark: #141413;
  --dark-2: #30302e;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;

  --serif: "Newsreader", "Source Serif 4", ui-serif, Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --sans: "Inter", ui-sans-serif, -apple-system, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow-ring: 0 0 0 1px var(--line-2);
  --shadow-soft: 0 1px 2px rgba(20,20,19,.05), 0 10px 30px -14px rgba(20,20,19,.20);
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* 极轻的暖色纸纹，避免大色块过于“平” */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(rgba(20,20,19,.03) 1px, transparent 1px);
  background-size: 3px 3px;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; color: var(--ink); margin: 0; letter-spacing: -.012em; }
h1 { font-size: clamp(36px, 5.2vw, 62px); line-height: 1.08; }
h2 { font-size: clamp(27px, 3.3vw, 39px); line-height: 1.18; }
h3 { font-size: 20px; line-height: 1.32; }
p { margin: 0; }

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--terracotta); }
.lede { font-size: 18.5px; line-height: 1.62; color: var(--muted); }
.small { font-size: 13.5px; color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ------------------------------------------------ 按钮（三级别） */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  border-radius: var(--r-pill);
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background-color .16s ease, border-color .16s ease, transform .1s ease, color .16s ease;
}

.btn-primary { min-height: 52px; padding: 0 30px; font-size: 16.5px; font-weight: 600; background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: #bd5a3a; }
.btn-primary:active { background: #ad5235; transform: scale(.985); }

.btn-secondary { background: var(--ivory); color: var(--ink); box-shadow: var(--shadow-ring); }
.btn-secondary:hover { background: #fff; box-shadow: 0 0 0 1px var(--ring); }
.btn-secondary:active { transform: scale(.985); background: var(--sand); }

.btn[aria-disabled="true"] { opacity: .38; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { background: var(--terracotta); }

.link { color: var(--terracotta); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

a:focus-visible, .btn:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }

/* ------------------------------------------------ 顶部 */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 28px; min-height: 68px; }

.wordmark { display: flex; align-items: baseline; gap: 9px; text-decoration: none; color: var(--ink); }
.wordmark .glyph { font-family: var(--serif); font-size: 23px; letter-spacing: -.02em; }
.wordmark .tag { font-size: 11.5px; color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; padding: 6px 2px; }
.nav a:hover { color: var(--ink); }
.nav a.is-current { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--terracotta); }

/* ------------------------------------------------ 首屏 */

.hero { padding: 84px 0 76px; }
.hero .wrap { display: grid; grid-template-columns: 1.06fr .94fr; gap: 64px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; }
.hero h1 em { font-style: normal; color: var(--terracotta); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 6px; }

.build-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-top: 6px; }
.build-meta span { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.build-meta b { font-weight: 500; color: var(--ink-2); }

/* ------------------------------------------------ 手机示意（纯 CSS） */

.phone-stage { display: flex; justify-content: center; align-items: center; gap: 22px; }
.phone {
  width: 264px; aspect-ratio: 264 / 545;
  background: var(--dark);
  border-radius: 36px; padding: 8px;
  box-shadow: var(--shadow-soft), 0 0 0 1px #2a2a28;
  flex: none;
}
.phone.small { width: 214px; opacity: .96; }
.phone-screen {
  height: 100%; border-radius: 29px; overflow: hidden;
  background: var(--paper); display: flex; flex-direction: column;
  padding: 14px 12px;
}
.phone-bar { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.phone-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); }
.phone-title { font-family: var(--serif); font-size: 13px; color: var(--ink); }
.phone-row { display: flex; gap: 7px; margin-bottom: 8px; }
.bubble-user {
  margin-left: auto; max-width: 82%;
  background: var(--terracotta); color: #fff;
  border-radius: 14px 5px 14px 14px; padding: 8px 11px;
  font-size: 10.5px; line-height: 1.5;
}
.bubble-ai {
  max-width: 88%;
  background: var(--white); color: var(--ink-2);
  border-radius: 5px 14px 14px 14px; padding: 9px 11px;
  font-size: 10.5px; line-height: 1.55;
  box-shadow: 0 0 0 1px var(--line-2);
}
.bubble-code {
  background: var(--ivory); color: var(--ink-2);
  border-radius: 10px; padding: 8px 10px; font-family: var(--mono);
  font-size: 9px; line-height: 1.6; box-shadow: 0 0 0 1px var(--line-2);
}
.phone-input {
  margin-top: auto; display: flex; align-items: center; gap: 6px;
  background: var(--white); border-radius: var(--r-pill);
  padding: 7px 9px; box-shadow: 0 0 0 1px var(--line-2);
}
.phone-input span { font-size: 10px; color: var(--faint); flex: 1; }
.phone-send { width: 20px; height: 20px; border-radius: 50%; background: var(--terracotta); flex: none; }

/* ------------------------------------------------ 通用区块 */

section { padding: 76px 0; }
.section-head { display: flex; flex-direction: column; gap: 12px; max-width: 720px; padding-bottom: 40px; }
.hairline { height: 1px; background: var(--line-2); border: 0; margin: 0; }

/* 三张说明卡：环状描边而不是投影 */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--ivory); border-radius: var(--r-lg);
  padding: 26px 24px 28px; box-shadow: var(--shadow-ring);
  display: flex; flex-direction: column; gap: 10px;
}
.card h3 { font-size: 19px; }
.card p { color: var(--muted); font-size: 14.5px; }
.card .num { font-family: var(--serif); font-size: 13px; color: var(--terracotta); letter-spacing: .08em; }

/* ------------------------------------------------ 服务表 */

.table-shell { background: var(--ivory); border-radius: var(--r-lg); box-shadow: var(--shadow-ring); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
thead th {
  text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 15px 22px; background: #f7f6f0;
  border-bottom: 1px solid var(--line-2);
}
tbody td { padding: 13px 22px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfaf5; }
td .prov-name { color: var(--ink); font-weight: 500; }
td .prov-url { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.tag {
  display: inline-block; padding: 2px 9px; border-radius: var(--r-pill);
  font-size: 11px; letter-spacing: .02em; white-space: nowrap;
}
.tag-cn { background: #f4e3dc; color: #8f4630; }
.tag-global { background: #e6e9e1; color: #4e5f45; }
.tag-local { background: #f0eee6; color: #6d6b63; }
.tag-key { background: #f7f1e2; color: #7a6330; }

/* ------------------------------------------------ 功能清单 */

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 44px 56px; }
.feature-block { display: flex; flex-direction: column; gap: 12px; }
.feature-block h3 { font-size: 20px; }
.feature-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.feature-list li { position: relative; padding-left: 20px; color: var(--muted); font-size: 14.5px; }
.feature-list li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 6px; height: 6px; border-radius: 2px; background: var(--coral);
}

/* ------------------------------------------------ 安装步骤 */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.step { background: var(--white); border-radius: var(--r-md); padding: 24px; box-shadow: var(--shadow-ring); }
.step::before {
  counter-increment: step; content: counter(step);
  font-family: var(--serif); font-size: 30px; line-height: 1;
  color: var(--terracotta); display: block; margin-bottom: 12px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------ FAQ（纯文本） */

.faq { display: grid; grid-template-columns: 300px 1fr; gap: 56px; }
.faq-list { display: flex; flex-direction: column; gap: 26px; }
.faq-item h3 { font-size: 16.5px; margin-bottom: 4px; }
.faq-item p { color: var(--muted); font-size: 14.5px; }

/* ------------------------------------------------ 页脚 */

.site-footer { background: var(--dark); color: var(--on-dark); padding: 64px 0 44px; }
.site-footer a { color: #e6e4dc; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; margin-bottom: 12px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-note { font-size: 13px; line-height: 1.7; color: #8d8b83; max-width: 380px; }
.footer-bottom {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid #2b2b29;
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
  font-size: 12.5px; color: #8d8b83;
}

/* ------------------------------------------------ 深色模式（纯 CSS） */

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141413; --ivory: #1d1d1b; --white: #232321; --sand: #30302e;
    --ink: #f0eee6; --ink-2: #d3d1c7; --muted: #b0aea5; --faint: #87867f;
    --line: #262624; --line-2: #30302e; --ring: #3d3d3a;
  }
  body::before { opacity: .5; }
  thead th { background: #1a1a19; }
  tbody tr:hover td { background: #1a1a19; }
  .bubble-ai { background: #232321; }
  .phone-screen { background: var(--paper); }
  .tag-cn { background: #3a2721; color: #e0a48b; }
  .tag-global { background: #2a2f26; color: #a9bd9c; }
  .tag-local { background: #2a2a28; color: #b0aea5; }
  .tag-key { background: #332c1d; color: #d8c48c; }
  .site-header { background: color-mix(in srgb, #141413 86%, transparent); }
}

/* ------------------------------------------------ 响应式 */

@media (max-width: 940px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 56px 0; }
  .phone-stage { order: -1; }
  .cards, .steps { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; gap: 32px; }
  .faq { grid-template-columns: 1fr; gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  section { padding: 56px 0; }
  .nav { display: none; }
  table { font-size: 13.5px; }
  thead th, tbody td { padding: 11px 14px; }
}

@media (max-width: 520px) {
  .phone.small { display: none; }
  .btn-primary, .btn-secondary { width: 100%; }
  /* 手机上隐藏「API Key」「官网」两列，避免横向滚动 */
  thead th:nth-child(3), tbody td:nth-child(3),
  thead th:nth-child(5), tbody td:nth-child(5) { display: none; }
}

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

/* ------------------------------------------------ 内页（更新日志 / 许可证） */

.prose-page { padding: 64px 0 88px; }
.prose-page .wrap { max-width: 780px; }
.prose-page h1 { margin: 10px 0 12px; }
.prose-page h2 { font-size: 24px; }
.prose-page .lede { margin-bottom: 8px; }
.release { padding-top: 34px; margin-top: 34px; border-top: 1px solid var(--line-2); }
.release:first-of-type { border-top: 0; }
.release-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.release-head h2 { font-size: 26px; }
