:root {
  --bg: #ffffff;
  --bg-soft: #faf9f7;
  --ink: #1a1917;
  --ink-2: #4a473f;
  --muted: #8b877d;
  --line: #eceae4;
  --line-2: #ddd9cf;
  --font-sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-serif: 'Newsreader', 'Songti SC', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #1a1917; color: #fff; }
a { color: var(--ink); text-decoration: none; }
.muted { color: var(--muted); }
code, pre { font-family: var(--font-mono); }

/* ---- 顶栏 ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 40px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.8);
  backdrop-filter: blur(10px); z-index: 10;
}
.brand {
  font-family: var(--font-serif); font-weight: 500; font-size: 21px;
  letter-spacing: -.2px; color: var(--ink);
}
.nav { display: flex; gap: 6px; align-items: center; }
.nav .who { color: var(--muted); font-size: 13px; margin-right: 10px; }

/* ---- 主体 ---- */
#app { max-width: 860px; margin: 0 auto; padding: 90px 40px 120px; }
.view { animation: rise .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- 落地页 ---- */
.hero { max-width: 640px; }
.eyebrow {
  font-size: 11.5px; font-weight: 500; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--muted); margin: 0 0 26px; animation: rise .6s .05s both;
}
.hero h1 {
  font-weight: 500; font-size: clamp(34px, 5.2vw, 54px); line-height: 1.12;
  letter-spacing: -1.2px; margin: 0 0 26px; animation: rise .6s .12s both;
}
.lede {
  font-size: 17px; color: var(--ink-2); margin: 0 0 38px; max-width: 540px;
  line-height: 1.7; animation: rise .6s .2s both;
}
.lede code { font-size: 14px; color: var(--ink); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 56px; animation: rise .6s .28s both; }

.snippet {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 22px; overflow-x: auto; font-size: 13px; line-height: 1.8; color: var(--ink-2);
  animation: rise .6s .36s both;
}
.snippet code { color: inherit; white-space: pre; }

.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  margin-top: 96px; border-top: 1px solid var(--line);
}
.feat { padding: 32px 28px 32px 0; border-right: 1px solid var(--line); }
.feat:last-child { border-right: none; padding-right: 0; }
.feat h3 { font-weight: 600; margin: 0 0 8px; font-size: 15px; letter-spacing: -.2px; }
.feat p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ---- 卡片 / 表单 ---- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 34px; }
.auth-card { max-width: 396px; margin: 24px auto 0; }
.auth-card h2 { font-weight: 500; font-size: 28px; letter-spacing: -.6px; margin: 0 0 8px; }
.form { display: flex; flex-direction: column; gap: 18px; margin-top: 26px; }
.form label {
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12.5px; font-weight: 500; letter-spacing: .2px; color: var(--muted);
}
.form input {
  font: inherit; font-size: 15px; font-weight: 400; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--bg); transition: border-color .18s, box-shadow .18s;
}
.form input::placeholder { color: #b9b5ab; }
.form input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(26,25,23,.06); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; }
.switch { text-align: center; margin: 22px 0 0; font-size: 13.5px; color: var(--muted); }
.switch a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; border-radius: 9px; padding: 12px 20px;
  transition: all .18s ease; white-space: nowrap; letter-spacing: .1px;
}

/* ---- 图标 ---- */
.icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 13.5px; height: 13.5px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }
.feat-icon { width: 21px; height: 21px; stroke-width: 1.5; margin-bottom: 16px; display: block; color: var(--ink); }
.btn-sm { padding: 9px 15px; font-size: 13px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; transform: translateY(-1px); }
.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-link { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; padding: 4px; transition: color .15s; }
.btn-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---- 控制台 ---- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; gap: 16px; }
.dash-head h2 { font-weight: 500; font-size: 27px; letter-spacing: -.6px; margin: 0 0 5px; }
#dash-user { font-size: 13.5px; }
.keys-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.keys-table th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px; padding: 0 14px 12px; border-bottom: 1px solid var(--line);
}
.keys-table td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.keys-table tr:last-child td { border-bottom: none; }
.keys-table code { font-size: 13px; color: var(--ink-2); }
.pill { font-size: 11.5px; padding: 3px 10px; border-radius: 20px; font-weight: 500; letter-spacing: .3px; border: 1px solid var(--line-2); color: var(--ink-2); }
.pill.revoked { color: var(--muted); background: var(--bg-soft); }
.empty { text-align: center; padding: 18px 0; }
.usage { margin-top: 24px; }
.usage h3 { font-weight: 600; font-size: 14px; margin: 0 0 16px; }
.usage .muted a { text-decoration: underline; text-underline-offset: 3px; }

/* ---- 新 key banner ---- */
.banner { background: var(--bg-soft); border: 1px solid var(--line-2); border-radius: 12px; padding: 20px 22px; margin-bottom: 26px; animation: rise .35s both; }
.banner p { margin: 0 0 12px; font-size: 13.5px; }
.key-reveal { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.key-reveal code { background: var(--ink); color: #f5f3ee; padding: 11px 15px; border-radius: 8px; font-size: 13px; word-break: break-all; flex: 1; min-width: 240px; }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 10px;
  font-size: 13.5px; letter-spacing: .2px; z-index: 100; animation: rise .25s;
}
.toast.err { background: #5b1f1f; }

@media (max-width: 640px) {
  .topbar { padding: 18px 22px; }
  #app { padding: 56px 22px 80px; }
  .features { grid-template-columns: 1fr; }
  .feat { border-right: none; border-bottom: 1px solid var(--line); padding: 26px 0; }
  .feat:last-child { border-bottom: none; }
  .keys-table th:nth-child(3), .keys-table td:nth-child(3),
  .keys-table th:nth-child(4), .keys-table td:nth-child(4) { display: none; }
}
