/* ============================================================
   XiaoHanRobot · design system
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --bg-soft: #eef1f8;
  --panel: #ffffff;
  --panel-2: #fafbfe;
  --ink: #0e1729;
  --ink-2: #45536b;
  --muted: #8a95a8;
  --line: #e5e9f2;
  --line-2: #eef1f7;

  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --brand-2: #0ea5e9;
  --brand-soft: rgba(79, 70, 229, .09);
  --grad: linear-gradient(135deg, #5b52ea 0%, #4f46e5 45%, #0ea5e9 100%);

  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;
  --ok-soft: rgba(16, 185, 129, .1);
  --warn-soft: rgba(245, 158, 11, .12);
  --err-soft: rgba(239, 68, 68, .1);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 12px 28px -18px rgba(16, 24, 40, .22);
  --shadow-lg: 0 24px 60px -28px rgba(16, 24, 40, .4);

  --side-w: 246px;
  --font: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #0a0e15;
  --bg-soft: #0d131c;
  --panel: #111823;
  --panel-2: #0e141d;
  --ink: #e9eff8;
  --ink-2: #a7b4c7;
  --muted: #6c7c92;
  --line: #1d2734;
  --line-2: #18212c;

  --brand: #7c7bf7;
  --brand-2: #38bdf8;
  --brand-soft: rgba(124, 123, 247, .14);
  --grad: linear-gradient(135deg, #6d68f2 0%, #6f6bf7 45%, #23a6e8 100%);

  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --ok-soft: rgba(52, 211, 153, .12);
  --warn-soft: rgba(251, 191, 36, .13);
  --err-soft: rgba(248, 113, 113, .12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 18px 40px -24px rgba(0, 0, 0, .85);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .9);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0a0e15;
    --bg-soft: #0d131c;
    --panel: #111823;
    --panel-2: #0e141d;
    --ink: #e9eff8;
    --ink-2: #a7b4c7;
    --muted: #6c7c92;
    --line: #1d2734;
    --line-2: #18212c;
    --brand: #7c7bf7;
    --brand-2: #38bdf8;
    --brand-soft: rgba(124, 123, 247, .14);
    --grad: linear-gradient(135deg, #6d68f2 0%, #6f6bf7 45%, #23a6e8 100%);
    --ok: #34d399;
    --warn: #fbbf24;
    --err: #f87171;
    --ok-soft: rgba(52, 211, 153, .12);
    --warn-soft: rgba(251, 191, 36, .13);
    --err-soft: rgba(248, 113, 113, .12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 18px 40px -24px rgba(0, 0, 0, .85);
    --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .9);
  }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
img { max-width: 100%; display: block; }
::selection { background: var(--brand-soft); }

.ic { flex: none; vertical-align: -3px; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 35%, transparent); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   品牌
   ============================================================ */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--grad);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .55);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.brand-text em { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: .2px; }

/* ============================================================
   应用布局
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--side-w); flex: none;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 40;
}
.side-brand { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 14px; }
.side-close { display: none !important; }

.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-group { margin-bottom: 14px; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  padding: 6px 10px; opacity: .85;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; margin-bottom: 2px;
  border-radius: 10px; color: var(--ink-2); font-size: 13.5px;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover { background: var(--bg-soft); color: var(--ink); }
.nav-item.is-active {
  background: var(--brand-soft); color: var(--brand); font-weight: 650;
}
.nav-item.is-active .ic { color: var(--brand); }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--err); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
}

.side-foot { border-top: 1px solid var(--line-2); padding: 12px 14px 14px; }
.side-bots { margin-bottom: 10px; }
.side-bot {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 6px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2);
}
.side-bot:hover { background: var(--bg-soft); }
.side-bot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 6px; border-radius: 8px; }
.side-link:hover { color: var(--ink); background: var(--bg-soft); }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.tb-title h1 { font-size: 18px; font-weight: 750; letter-spacing: -.3px; }
.tb-title p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.content { padding: 24px 26px 56px; max-width: 1400px; width: 100%; margin: 0 auto; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 10px; cursor: pointer; color: var(--ink-2);
  transition: .16s;
}
.icon-btn:hover { color: var(--ink); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
}
.user-name { font-size: 13px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 168px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60;
}
.menu-pop.is-open { display: block; animation: pop .16s ease; }
.menu-pop a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.menu-pop a:hover { background: var(--bg-soft); color: var(--ink); }
.menu-pop a b { color: var(--err); }

@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.sidebar-mask { display: none; }

/* ============================================================
   通用组件
   ============================================================ */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 14.5px; font-weight: 700; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-body { padding: 18px 20px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: .16s; white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--grad); color: #fff; border: none;
  box-shadow: 0 8px 20px -12px rgba(79, 70, 229, .9);
}
.btn-primary:hover { filter: brightness(1.06); background: var(--grad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, var(--line)); background: transparent; }
.btn-danger:hover { background: var(--err-soft); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }

.input, .select, .textarea {
  width: 100%; padding: 9px 12px; min-height: 38px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
  font-size: 13.5px;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: color-mix(in srgb, var(--brand) 60%, var(--line));
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: var(--panel);
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.7; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input-sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--line);
  position: relative; transition: .2s; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: .2s;
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 7px;
  background: var(--bg-soft); color: var(--ink-2);
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.err { background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.dot.warn { background: var(--warn); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.chip:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.chip.is-on { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-weight: 650; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted);
  letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--panel-2); }

.stat { padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.6px; margin-top: 4px; line-height: 1.15; }
.stat .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat.brand { background: var(--grad); border: none; color: #fff; }
.stat.brand .k, .stat.brand .d { color: rgba(255, 255, 255, .8); }

.empty { text-align: center; padding: 54px 24px; color: var(--muted); }
.empty-ic {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 18px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
}
.empty h3 { font-size: 14.5px; color: var(--ink); margin-bottom: 4px; }
.empty p { font-size: 13px; max-width: 380px; margin: 0 auto 14px; }

.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 200px; max-width: 360px; padding: 11px 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px;
  animation: toastIn .2s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.modal-mask {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(8, 12, 20, .5); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  width: min(560px, 100%); max-height: 86vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: pop .18s ease;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 15px; font-weight: 750; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: 11px; width: fit-content; }
.tab { padding: 6px 14px; border-radius: 8px; font-size: 13px; color: var(--ink-2); border: none; background: transparent; cursor: pointer; font-weight: 600; }
.tab.is-on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

.code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--bg-soft); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 2px 6px; color: var(--ink-2);
}
pre.code { padding: 12px 14px; overflow: auto; line-height: 1.6; }

/* ============================================================
   认证页
   ============================================================ */
.auth-body {
  min-height: 100vh; display: grid; place-items: center;
  padding: 40px 20px; position: relative; overflow: hidden;
  background: var(--bg);
}
.auth-glow { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .5; pointer-events: none; }
.auth-glow.a1 { width: 420px; height: 420px; background: rgba(99, 102, 241, .35); top: -140px; left: -100px; }
.auth-glow.a2 { width: 480px; height: 480px; background: rgba(14, 165, 233, .28); bottom: -200px; right: -140px; }
.auth-shell { width: min(430px, 100%); position: relative; z-index: 1; }
.auth-brand { margin-bottom: 22px; justify-content: center; }
.auth-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 24px; padding: 28px 28px 26px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 21px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 4px; }
.auth-card .lead { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }
.auth-foot a { color: var(--ink-2); }
.auth-alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.auth-alt a { color: var(--brand); font-weight: 650; }
.form-err { background: var(--err-soft); color: var(--err); font-size: 12.5px; padding: 9px 12px; border-radius: 9px; margin-bottom: 14px; }

/* ============================================================
   落地页
   ============================================================ */
.landing { background: var(--bg); }
.lp-nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line-2); }
.lp-nav-in { max-width: 1180px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 26px; }
.lp-links { display: flex; gap: 22px; margin-left: 16px; }
.lp-links a { font-size: 13.5px; color: var(--ink-2); font-weight: 550; }
.lp-links a:hover { color: var(--ink); }
.lp-nav .row { margin-left: auto; }

.lp-hero { max-width: 1180px; margin: 0 auto; padding: 76px 24px 40px; text-align: center; position: relative; }
.lp-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12.5px; font-weight: 650; margin-bottom: 22px;
}
.lp-hero h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1.15; font-weight: 850; letter-spacing: -1.4px; }
.lp-hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero p { max-width: 640px; margin: 18px auto 0; font-size: 15px; color: var(--ink-2); line-height: 1.75; }
.lp-cta { display: flex; gap: 12px; justify-content: center; margin-top: 28px; }
.lp-meta { display: flex; gap: 22px; justify-content: center; margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.lp-meta span { display: inline-flex; align-items: center; gap: 5px; }

.lp-stats { max-width: 900px; margin: 44px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lp-stat { padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.lp-stat b { display: block; font-size: 28px; font-weight: 850; letter-spacing: -1px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-stat span { font-size: 12.5px; color: var(--muted); }

.lp-section { max-width: 1180px; margin: 0 auto; padding: 64px 24px; }
.lp-sec-head { text-align: center; margin-bottom: 34px; }
.lp-sec-head .kicker { font-size: 11.5px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); }
.lp-sec-head h2 { font-size: 27px; font-weight: 800; letter-spacing: -.6px; margin-top: 8px; }
.lp-sec-head p { color: var(--muted); margin-top: 8px; font-size: 14px; }

.feat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feat {
  padding: 22px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--line); transition: .2s;
}
.feat:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 22%, var(--line)); }
.feat-ic { width: 36px; height: 36px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.feat h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 5px; }
.feat p { font-size: 12.8px; color: var(--muted); line-height: 1.7; }

.step-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { padding: 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); position: relative; }
.step b { display: block; font-size: 12px; color: var(--brand); font-weight: 800; letter-spacing: .08em; margin-bottom: 8px; }
.step h3 { font-size: 14px; margin-bottom: 4px; }
.step p { font-size: 12.5px; color: var(--muted); line-height: 1.65; }

.bot-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 10px; }
.bot-card {
  flex: none; width: 200px; padding: 14px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.bot-card .av { width: 34px; height: 34px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; }
.bot-card b { font-size: 13px; display: block; }
.bot-card span { font-size: 11px; color: var(--ok); }

.lp-cta-box {
  max-width: 1180px; margin: 0 auto 70px; padding: 48px 32px;
  border-radius: 26px; text-align: center; color: #fff;
  background: var(--grad); box-shadow: 0 30px 70px -40px rgba(79, 70, 229, .9);
  position: relative; overflow: hidden;
}
.lp-cta-box h2 { font-size: 27px; font-weight: 800; letter-spacing: -.6px; }
.lp-cta-box p { opacity: .88; margin: 8px 0 20px; font-size: 14px; }
.lp-cta-box .btn { background: #fff; color: #3730a3; border: none; }

.lp-foot { border-top: 1px solid var(--line); padding: 26px 24px; text-align: center; font-size: 12.5px; color: var(--muted); }
.lp-foot a { color: var(--ink-2); }

/* ============================================================
   列表 / 卡片式条目
   ============================================================ */
.list-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--panel-2); }
.li-av {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.li-main { min-width: 0; flex: 1; }
.li-main b { font-size: 13.5px; display: block; }
.li-main span { font-size: 12px; color: var(--muted); }

.plugin-card { padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 10px; transition: .18s; }
.plugin-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.plugin-card h3 { font-size: 14px; font-weight: 700; }
.plugin-card p { font-size: 12.5px; color: var(--muted); line-height: 1.65; flex: 1; }
.plugin-cat { font-size: 11px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 6px; }

/* ============================================================
   聊天
   ============================================================ */
.chat-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 0; height: calc(100vh - 148px); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.chat-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-side-head { padding: 12px; border-bottom: 1px solid var(--line-2); }
.chat-list { flex: 1; overflow-y: auto; }
.chat-item { display: flex; gap: 10px; padding: 11px 12px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.chat-item:hover { background: var(--panel-2); }
.chat-item.is-on { background: var(--brand-soft); }
.chat-item .av { width: 36px; height: 36px; border-radius: 11px; background: var(--bg-soft); color: var(--ink-2); display: grid; place-items: center; font-weight: 700; flex: none; }
.chat-item .tx { min-width: 0; flex: 1; }
.chat-item .tx b { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .tx span { font-size: 11.5px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item .meta { text-align: right; font-size: 10.5px; color: var(--muted); flex: none; }
.chat-item .unread { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; background: var(--err); color: #fff; font-size: 10px; padding: 0 4px; margin-top: 4px; }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { padding: 12px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: var(--bg-soft); }
.msg { display: flex; gap: 9px; max-width: 74%; }
.msg.out { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble {
  padding: 9px 13px; border-radius: 13px; font-size: 13.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
  background: var(--panel); border: 1px solid var(--line);
}
.msg.out .bubble { background: var(--grad); color: #fff; border: none; }
.msg .who { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.msg-time { text-align: center; font-size: 11px; color: var(--muted); margin: 4px 0; }
.chat-input { border-top: 1px solid var(--line-2); padding: 12px; display: flex; gap: 10px; align-items: flex-end; background: var(--panel); }
.chat-input textarea { flex: 1; min-height: 42px; max-height: 130px; resize: none; }
.typing { font-size: 12px; color: var(--muted); padding: 0 18px 8px; }

/* ============================================================
   工作流画布
   ============================================================ */
.wf-layout { display: grid; grid-template-columns: 1fr 306px; gap: 16px; align-items: start; }
.wf-canvas-wrap { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: auto; height: calc(100vh - 210px); }
.wf-canvas {
  position: relative; min-width: 100%; min-height: 100%;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--muted) 30%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
}
.wf-node {
  position: absolute; width: 176px; padding: 11px 13px;
  background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-sm); cursor: grab;
  transition: border-color .15s, box-shadow .15s;
}
.wf-node:active { cursor: grabbing; }
.wf-node.is-sel { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.wf-node .nt { font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wf-node .nn { font-size: 12.8px; font-weight: 650; margin-top: 2px; line-height: 1.4; word-break: break-word; }
.wf-node.trigger { border-left: 3px solid var(--brand); }
.wf-node.condition { border-left: 3px solid var(--warn); }
.wf-node.reply { border-left: 3px solid var(--ok); }
.wf-node.http { border-left: 3px solid var(--brand-2); }
.wf-node.ai { border-left: 3px solid #a855f7; }
.wf-edges { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.wf-palette { display: flex; flex-direction: column; gap: 8px; }
.wf-pal-btn {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  border: 1px dashed var(--line); border-radius: 10px; cursor: pointer;
  background: var(--panel-2); font-size: 12.5px; text-align: left;
}
.wf-pal-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ============================================================
   响应式
   ============================================================ */
.only-mobile { display: none !important; }

@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-grid { grid-template-columns: repeat(2, 1fr); }
  .wf-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .only-mobile { display: grid !important; }
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh;
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .side-close { display: grid !important; }
  .sidebar-mask { display: block; position: fixed; inset: 0; background: rgba(8, 12, 20, .45); z-index: 39; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-mask.is-open { opacity: 1; pointer-events: auto; }
  .content { padding: 18px 14px 48px; }
  .topbar { padding: 12px 14px; }
  .user-name { display: none; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .feat-grid, .step-grid, .lp-stats { grid-template-columns: 1fr; }
  .chat-shell { grid-template-columns: 1fr; height: calc(100vh - 130px); }
  .chat-side { display: none; }
  .chat-side.is-on { display: flex; position: absolute; inset: 0; z-index: 5; background: var(--panel); }
  .lp-hero { padding-top: 48px; }
  .lp-links { display: none; }
  .modal { border-radius: 18px; }
  .wf-canvas-wrap { height: 60vh; }
}
