/* EA 授权云 · shadcn 风格设计系统
   方向：中性锌灰 + 克制靛蓝强调 + 扁平化 + 轻边框轻阴影
   参考气质：shadcn/ui / Linear / Vercel
   变量名保持兼容，landing/apply 等页面共享同一套令牌
*/
:root {
  /* 中性（zinc 系） */
  --ink: #09090b;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --muted-2: #a1a1aa;
  --page: #fafafa;
  --page-2: #f4f4f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  /* 强调：克制靛蓝（CTA / 链接 / 焦点 / 激活态） */
  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-soft: #eef2ff;
  --brand-ink: #3730a3;
  --brand-glow: rgba(79, 70, 229, 0.16);

  /* 语义色 */
  --ok: #16a34a;
  --ok-hover: #15803d;
  --ok-soft: #f0fdf4;
  --ok-ink: #166534;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  /* 深色区块（代码预览 / 终稿） */
  --dark: #18181b;
  --dark-2: #27272a;
  --dark-3: #3f3f46;
  --dark-muted: #a1a1aa;
  --dark-card: #27272a;
  --dark-border: #3f3f46;

  /* landing 兼容别名 */
  --console-bg: #18181b;
  --console-side: #18181b;
  --console-top-a: #4f46e5;
  --console-top-b: #818cf8;
  --console-card: #27272a;

  --black: #09090b;
  --white: #ffffff;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --shadow-soft: 0 1px 2px rgba(9, 9, 11, 0.04), 0 8px 24px rgba(9, 9, 11, 0.05);
  --shadow-card: 0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-brand: 0 1px 3px rgba(79, 70, 229, 0.25);
  --max: 1280px;
  --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92em;
  background: var(--page-2);
  color: var(--ink);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
pre code { background: transparent; color: inherit; padding: 0; border: 0; }

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 250, 250, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.header-main {
  max-width: var(--max);
  min-height: 64px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  color: #fff;
  background: var(--ink);
  font-size: 12px; font-weight: 800;
}
.site-nav { display: flex; align-items: center; justify-content: center; gap: 2px; flex-wrap: wrap; }
.site-nav a, .site-nav button {
  padding: 8px 13px; border: 0; border-radius: 8px;
  color: var(--ink-2); background: transparent;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.site-nav a:hover, .site-nav button:hover,
.site-nav a.active, .site-nav button.active {
  background: var(--page-2);
  color: var(--ink);
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-toggle {
  display: none; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); cursor: pointer;
}
.nav-toggle span {
  width: 16px; height: 2px; margin: 3px auto; display: block;
  background: var(--ink); border-radius: 2px;
}
.ghost-link {
  border: 0; background: transparent; color: var(--ink-2);
  font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.ghost-link:hover { color: var(--ink); }

/* ── Buttons（shadcn 风格：36px 默认 / 32px sm / 44px xl） ── */
.btn {
  min-height: 36px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; font-size: 13.5px; font-weight: 600;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-brand { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-brand:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-dark { color: #fff; background: var(--ink); border-color: var(--ink); }
.btn-dark:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-soft { color: var(--ink); background: var(--surface); border-color: var(--border-strong); }
.btn-soft:hover { background: var(--page-2); border-color: var(--muted-2); }
.btn-ghost { color: var(--ink); background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--page-2); }
.btn-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-light { color: var(--ink); background: #fff; }
.btn-outline-light { color: #fff; background: transparent; border-color: rgba(255, 255, 255, 0.4); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 7px; }
.btn-xl { min-height: 44px; padding: 0 24px; font-size: 15px; }

/* ── Auth page ── */
.auth-page {
  min-height: calc(100vh - 64px);
  display: grid; place-items: center; padding: 40px 20px;
  background: var(--page);
}
.auth-card {
  width: min(440px, 100%); padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.auth-intro span { color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.auth-intro h2 { margin: 8px 0 8px; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
.auth-intro p { margin: 0 0 22px; color: var(--muted); font-weight: 400; font-size: 14px; line-height: 1.6; }
.auth-tabs {
  margin-bottom: 16px; padding: 4px; border-radius: 10px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--page-2); border: 1px solid var(--border);
}
.auth-tabs button {
  min-height: 38px; border: 0; border-radius: 7px; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: all 140ms ease;
}
.auth-tabs button.active {
  color: var(--ink); background: var(--surface);
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.08);
}
.auth-form { display: grid; gap: 14px; }
.auth-form.hidden { display: none; }
.auth-form label { display: grid; gap: 7px; color: var(--ink); font-weight: 600; font-size: 13px; }
.form-input, .form-select, .form-textarea, .auth-form input {
  width: 100%; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-weight: 400; font-size: 13.5px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus, .auth-form input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-textarea { min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.auth-form .btn { width: 100%; margin-top: 4px; }
.hint { margin-top: 16px; color: var(--muted-2); font-size: 12px; font-weight: 400; text-align: center; line-height: 1.5; }
.alert {
  margin-bottom: 14px; padding: 10px 12px; border-radius: 8px;
  font-weight: 500; font-size: 13px; border: 1px solid transparent;
}
.alert-error { color: #991b1b; background: var(--danger-soft); border-color: rgba(220, 38, 38, 0.2); }
.alert-ok { color: var(--ok-ink); background: var(--ok-soft); border-color: rgba(22, 163, 74, 0.25); }
.hidden { display: none !important; }

/* ── 共享原语（徽章 / 弹窗 / 提示） ── */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.badge-ok { color: var(--ok-ink); background: var(--ok-soft); border-color: rgba(22, 163, 74, 0.22); }
.badge-warn { color: #92400e; background: var(--warn-soft); border-color: rgba(217, 119, 6, 0.25); }
.badge-off { color: var(--muted); background: var(--page-2); border-color: var(--border); }
.badge-err { color: #991b1b; background: var(--danger-soft); border-color: rgba(220, 38, 38, 0.2); }
.badge-brand { color: var(--brand-ink); background: var(--brand-soft); border-color: rgba(79, 70, 229, 0.2); }

.modal {
  position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 24px;
}
.modal.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 9, 11, 0.5); backdrop-filter: blur(4px); }
.modal-card {
  position: relative; z-index: 1; width: min(680px, 100%); max-height: calc(100vh - 48px);
  overflow: auto; padding: 24px; border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(9, 9, 11, 0.2);
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border: 0; border-radius: 8px; background: var(--page-2); color: var(--ink);
  font-size: 18px; cursor: pointer; border: 1px solid var(--border);
}
.modal-close:hover { background: var(--border); }
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  padding: 11px 16px; border-radius: 9px; color: #fff;
  background: var(--ink); font-weight: 600; font-size: 13px;
  box-shadow: 0 8px 24px rgba(9, 9, 11, 0.22);
  opacity: 0; transform: translateY(8px); transition: all 180ms ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: var(--ok-hover); }
.toast.err { background: var(--danger); }

/* ── Docs ── */
.docs-wrap { max-width: 820px; margin: 0 auto; padding: 40px 32px 80px; }
.docs-wrap pre {
  overflow: auto; padding: 14px 16px; border-radius: 10px;
  background: var(--dark); color: #e4e4e7;
  border: 1px solid var(--dark-border);
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.55;
}
.docs-wrap h1 { font-size: 32px; margin: 0 0 14px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.docs-wrap h2 { font-size: 22px; margin-top: 34px; padding-top: 10px; border-top: 1px solid var(--border); font-weight: 700; }
.docs-wrap h3 { font-size: 16px; margin-top: 22px; font-weight: 650; }
.docs-wrap p, .docs-wrap li { color: var(--ink-2); line-height: 1.75; font-weight: 400; font-size: 14.5px; }
.docs-wrap table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 14px; }
.docs-wrap th, .docs-wrap td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; font-weight: 400; }
.docs-wrap th { background: var(--page-2); color: var(--ink-2); font-weight: 600; }
.docs-wrap a { color: var(--brand); font-weight: 500; }
.docs-wrap a:hover { text-decoration: underline; }

/* ── Reveal ── */
.reveal-on-scroll { opacity: 0; transform: translateY(16px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal-on-scroll.is-visible { opacity: 1; transform: translateY(0); }

/* ── 脱敏字段（点击显示/隐藏） ── */
.masked { cursor: pointer; border-bottom: 1px dashed var(--border-strong); }
.masked:hover { color: var(--brand); }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .header-main { grid-template-columns: auto auto; justify-content: space-between; }
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .site-header.open .site-nav {
    display: flex; grid-column: 1 / -1; justify-content: flex-start;
    flex-wrap: wrap; padding-bottom: 12px;
  }
  .header-main, .docs-wrap { padding-left: 20px; padding-right: 20px; }
  .header-actions .ghost-link { display: none; }
}

@media (max-width: 560px) {
  .btn, .btn-xl { width: 100%; }
  .header-actions .btn { width: auto; }
  .docs-wrap { padding: 24px 16px 48px; }
}
