/* ===== Reset & tokens ===== */
:root {
  --bg-0: #07090f;
  --bg-1: #0d1220;
  --bg-2: #131a2e;
  --line: #1f2940;
  --text: #e9edf7;
  --muted: #8a93a6;
  --brand: #ff060a;        /* Tron red */
  --brand-2: #ff5760;
  --accent: #5af2ff;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;
  --radius: 14px;
  --shadow: 0 18px 48px -16px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-0);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600; font-size: 14px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #b3050b);
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(255,6,10,.55);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px -6px rgba(255,6,10,.7); }
.btn-ghost {
  background: rgba(255,255,255,.04);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

header.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,9,15,.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: .5px;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff8a8e, var(--brand));
  box-shadow: 0 0 18px var(--brand);
}
.brand b { color: #fff; }
.brand b span { color: var(--brand); }

.nav-links { display: flex; gap: 22px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; gap: 10px; align-items: center; }

footer.foot {
  border-top: 1px solid var(--line);
  padding: 36px 0; color: var(--muted); font-size: 13px;
}
.foot-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -20% -10% auto -10%; height: 600px;
  background:
    radial-gradient(600px 380px at 20% 30%, rgba(255,6,10,.18), transparent 60%),
    radial-gradient(500px 300px at 80% 10%, rgba(90,242,255,.12), transparent 60%);
  filter: blur(8px);
  z-index: -1;
}
.hero h1 {
  font-size: 56px; line-height: 1.05; letter-spacing: -1px;
  margin: 0 0 18px;
  background: linear-gradient(180deg, #ffffff, #c5cee0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { color: var(--muted); font-size: 18px; max-width: 660px; margin: 0 0 28px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,6,10,.1); color: var(--brand-2);
  font-size: 12px; font-weight: 600; letter-spacing: .5px;
  border: 1px solid rgba(255,6,10,.25);
  margin-bottom: 20px;
}

/* ===== Features ===== */
.features {
  padding: 56px 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.feature {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  transition: transform .2s, border-color .2s;
}
.feature:hover { transform: translateY(-3px); border-color: rgba(255,6,10,.4); }
.feature .ico {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,6,10,.12); color: var(--brand-2);
  display: grid; place-items: center; margin-bottom: 14px;
  font-size: 18px;
}
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

/* ===== Steps ===== */
.steps {
  padding: 24px 0 80px;
}
.steps h2 { font-size: 28px; margin: 0 0 24px; }
.steps ol {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.steps li {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.steps .num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; margin-bottom: 10px;
}
.steps h4 { margin: 0 0 6px; font-size: 14px; }
.steps p { margin: 0; color: var(--muted); font-size: 13px; }

/* ===== Chat App ===== */
.app-shell {
  display: grid; grid-template-columns: 320px 1fr;
  gap: 18px; padding: 24px 0; min-height: calc(100vh - 64px);
}
.panel {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.panel h3 {
  margin: 0 0 12px;
  font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv:last-of-type { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; max-width: 60%; text-align: right; }

.field { margin-bottom: 10px; }
.field label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%;
  background: #0a1020; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(255,6,10,.15);
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--muted);
}
.badge.ok { background: rgba(34,197,94,.14); color: var(--ok); }
.badge.warn { background: rgba(245,158,11,.14); color: var(--warn); }
.badge.err { background: rgba(239,68,68,.14); color: var(--err); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chat { display: flex; flex-direction: column; height: calc(100vh - 100px); padding: 14px; }
.messages { flex: 1; overflow-y: auto; padding: 4px; }
.empty {
  display: grid; place-content: center; gap: 12px; height: 100%; color: var(--muted); text-align: center;
}
.empty .big { font-size: 22px; color: var(--text); }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip {
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; color: var(--text);
}
.chip:hover { border-color: var(--brand-2); }

.msg {
  padding: 12px 16px; margin: 8px 0;
  border-radius: 12px; max-width: 86%;
  white-space: pre-wrap; line-height: 1.6; font-size: 14px;
}
.msg.user { background: linear-gradient(135deg, #1d2747, #1a2746); margin-left: auto; }
.msg.assistant { background: var(--bg-2); border: 1px solid var(--line); }
.msg.system {
  background: #2c220e; border: 1px solid #6b4914; color: #f3c879; font-size: 13px;
}
.meta { font-size: 11px; color: var(--muted); margin-top: 6px; }

.composer { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.composer textarea {
  flex: 1;
  background: #0a1020; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; resize: vertical; min-height: 64px; font: inherit;
}

/* ===== Modals ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; place-items: center; z-index: 100;
}
.modal-mask.show { display: grid; }
.modal {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  width: min(92vw, 460px);
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 8px; }
.modal p { color: var(--muted); margin: 0 0 16px; }

/* ===== Responsive ===== */
@media (max-width: 920px) {
  .features { grid-template-columns: 1fr 1fr; }
  .steps ol { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 38px; }
  .app-shell { grid-template-columns: 1fr; }
  .chat { height: auto; min-height: 60vh; }
  .nav-links { display: none; }
}
@media (max-width: 540px) {
  .features { grid-template-columns: 1fr; }
  .steps ol { grid-template-columns: 1fr; }
}
