:root {
  --bg: #fbfaf7;
  --fg: #1d1c1a;
  --muted: #6b6860;
  --line: #e6e2d9;
  --card: #ffffff;
  --accent: #2f6fde;
  --accent-fg: #ffffff;
  --bubble-bot: #ffffff;
  --bubble-me: #dcebff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151514;
    --fg: #ecebe7;
    --muted: #a3a097;
    --line: #2d2c29;
    --card: #1e1e1c;
    --accent: #5b8ff0;
    --bubble-bot: #242422;
    --bubble-me: #1f3557;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: 1.6rem; margin-top: 3.5rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95em; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 680px; padding-top: 2rem; padding-bottom: 3rem; }
.muted { color: var(--muted); font-size: .92rem; }

.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav nav { display: flex; gap: 20px; align-items: center; }

/* 语言菜单：纯 HTML 的 details，不需要 JS */
.lang-menu { position: relative; }
.lang-menu summary { cursor: pointer; list-style: none; color: var(--accent); white-space: nowrap; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 10;
  display: grid; grid-template-columns: repeat(2, max-content); gap: 2px 8px;
  padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.lang-list a { padding: 6px 10px; border-radius: 6px; color: var(--fg); white-space: nowrap; }
.lang-list a:hover { background: var(--bg); text-decoration: none; }
.lang-list a[aria-current] { color: var(--accent); font-weight: 600; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); }

.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; padding-top: 3rem; padding-bottom: 1rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.02em; }
/* 标题按语义分段，段内不折行，避免中文标题最后一行只剩一个字 */
.nowrap { display: inline-block; white-space: nowrap; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.5rem; }

.btn {
  display: inline-block; padding: 10px 20px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg); font-weight: 600;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

.chat { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.bubble { max-width: 85%; padding: 9px 13px; border-radius: 14px; background: var(--bubble-bot); border: 1px solid var(--line); }
.bubble.me { align-self: flex-end; background: var(--bubble-me); border-color: transparent; }
.bubble.small { font-size: .9rem; color: var(--muted); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.steps li { counter-increment: s; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-weight: 700; margin-bottom: 10px; }
.steps p, .card p { margin: 0; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.sample h4 { margin: 1em 0 .2em; }
.sample h4:first-child { margin-top: 0; }

.commands { border-collapse: collapse; width: 100%; }
.commands td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.commands td:first-child { white-space: nowrap; width: 1%; }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: .6em 0 0; color: var(--muted); }

.cta-end { text-align: center; padding: 4rem 16px; }
.login { text-align: center; }
.notice { padding: 12px 16px; border-radius: 8px; background: var(--bubble-me); }

.foot { display: flex; justify-content: space-between; gap: 16px; padding-top: 2rem; padding-bottom: 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 1.5rem; }
  .steps, .grid { grid-template-columns: 1fr; }
}
