:root {
  --bg: #0b0f17;
  --surface: #131924;
  --surface-2: #1b2332;
  --border: #263144;
  --text: #e6edf3;
  --muted: #93a1b5;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(148, 163, 184, 0.14);
  padding: 1px 6px;
  border-radius: 4px;
  color: #bfdbfe;
}
pre {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: #080c12;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
}
pre code { background: none; padding: 0; color: #93c5fd; font-size: 12px; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.muted-sm { color: var(--muted); font-size: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: #243045; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-lg { padding: 10px 18px; font-size: 14px; font-weight: 600; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { border-color: var(--border); background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-github { background: #24292f; border-color: #424a53; color: #fff; }
.btn-github:hover { background: #32383f; }
.btn-github-lg { padding: 10px 14px; font-size: 14px; font-weight: 600; margin-top: 14px; }
.btn-danger-sm { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); padding: 5px 10px; font-size: 12px; }
.btn-danger-sm:hover { background: rgba(239, 68, 68, 0.3); }
.full-width { width: 100%; }

/* Landing Page */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 15, 23, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand-link { display: inline-flex; align-items: center; gap: 10px; }
.landing-links { display: flex; gap: 22px; color: var(--muted); font-size: 14px; }
.landing-links a:hover { color: var(--text); }
.landing-actions { display: flex; align-items: center; gap: 10px; }

.hero {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(59, 130, 246, 0.18), transparent 70%);
  padding: 76px 24px 64px;
  border-bottom: 1px solid var(--border);
}
.hero-inner { max-width: 920px; margin: 0 auto; text-align: center; }
.hero-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.32);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.22;
  letter-spacing: -0.02em;
}
.hero-sub {
  max-width: 720px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 16px;
}
.hero-cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.agent-pills { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.agent-pills span {
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
}

.section { padding: 64px 24px; }
.section-alt { background: rgba(19, 25, 36, 0.55); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-inner { max-width: 1180px; margin: 0 auto; }
.section-inner h2 { margin: 0 0 8px; font-size: 26px; letter-spacing: -0.01em; }
.section-desc { margin: 0 0 30px; color: var(--muted); font-size: 15px; max-width: 760px; }

.card-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }

.info-card, .step-card, .sec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card-kicker, .step-num {
  font-size: 11px;
  font-weight: 700;
  color: #60a5fa;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.info-card h3, .step-card h3, .sec-card h3 { margin: 0 0 10px; font-size: 16px; }
.info-card p, .step-card p, .sec-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.mini-list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.mini-list li { margin-bottom: 6px; }

.landing-footer { border-top: 1px solid var(--border); padding: 24px; color: var(--muted); font-size: 13px; }
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-inner a { color: #93c5fd; }

/* Login Modal */
.login-card {
  width: 100%;
  max-width: 410px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px;
}
.login-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.icon-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}
.icon-close:hover { color: var(--text); }
.brand-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 2px 10px;
  border-radius: 999px;
}
.login-card h2 { margin: 4px 0 6px; font-size: 20px; }
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
.error-msg {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
}

/* Topbar & Console */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(19, 25, 36, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.pill-domain {
  font-size: 11px;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  padding: 2px 8px;
  border-radius: 999px;
}
.nav-tabs { display: flex; gap: 4px; margin-left: 8px; }
.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.tab-btn.active { background: var(--surface-2); color: var(--text); }
.user-badge { font-size: 12px; color: var(--muted); padding: 0 6px; }

.main-content { max-width: 1380px; margin: 0 auto; padding: 20px 24px; }
.stats-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-chip strong { font-size: 15px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar input[type="search"] { flex: 1; min-width: 240px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 17px; }
.probe-callout {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th { font-size: 12px; font-weight: 600; color: var(--muted); background: rgba(255, 255, 255, 0.02); white-space: nowrap; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.col-action { text-align: right; white-space: nowrap; }

.proj-name { font-weight: 600; color: var(--text); }
.proj-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.mono-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #a5b4fc; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge-active { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.badge-idle { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
.badge-unknown { background: rgba(107, 114, 128, 0.2); color: #cbd5e1; }
.badge-cli { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }
.badge-web { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }
.badge-err { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.empty-state { padding: 36px; text-align: center; color: var(--muted); }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.74);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.dialog-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
}
.dialog-card h3 { margin: 0 0 14px; font-size: 16px; }
.dialog-card form { display: flex; flex-direction: column; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Terminal */
.terminal-window {
  width: 96vw;
  height: 90vh;
  background: #0a0d12;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.terminal-title-group { display: flex; align-items: center; gap: 10px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-connecting { background: var(--amber); }
.dot-open { background: var(--green); }
.dot-closed { background: var(--red); }
.notice-banner {
  background: rgba(245, 158, 11, 0.14);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  padding: 7px 14px;
  font-size: 12px;
}
.terminal-body { flex: 1; padding: 8px; overflow: hidden; }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  font-size: 13px;
}
