/* OneBiz 擎营 · 演示站点样式 */
:root {
  --navy: #0e1a30;
  --navy-2: #16233d;
  --ink: #1f2a37;
  --muted: #64748b;
  --line: #e4eaf3;
  --bg: #f5f7fb;
  --card: #ffffff;
  --blue: #2563eb;
  --blue-soft: #e8f0fe;
  --teal: #0d9488;
  --teal-soft: #e6f4f1;
  --amber: #c2410c;
  --amber-soft: #fff4e5;
  --violet: #6d28d9;
  --violet-soft: #f3e8fd;
  --green: #2e7d32;
  --green-soft: #e6f4ea;
  --slate: #455a64;
  --slate-soft: #eceff1;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 51, .04), 0 8px 24px rgba(15, 27, 51, .06);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px;
  flex: 0 0 252px;
  background: linear-gradient(180deg, #0e1a30 0%, #132342 100%);
  color: #cbd5e1;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #0d9488);
  display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: 16px; letter-spacing: .5px;
}
.brand-name { color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-sub { color: #7f8ea6; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.nav-group { margin-top: 6px; }
.nav-label { font-size: 11px; color: #64748b; letter-spacing: .12em; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin: 2px 0;
  border-radius: 9px; color: #cbd5e1; font-size: 14px;
}
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(59,130,246,.28), rgba(13,148,136,.18)); color: #fff; box-shadow: inset 0 0 0 1px rgba(96,165,250,.35); }
.nav .dot { width: 6px; height: 6px; border-radius: 50%; background: #60a5fa; opacity: .8; }

.side-foot { margin-top: auto; font-size: 12px; color: #64748b; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; min-width: 0; padding: 26px 34px 64px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.crumb { color: var(--muted); font-size: 13px; }
.crumb b { color: var(--ink); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.env-pill {
  font-size: 12px; color: #0d9488; background: var(--teal-soft);
  border: 1px solid #b7e3da; padding: 4px 10px; border-radius: 999px;
}

/* ---------- typography ---------- */
h1, h2, h3, h4 { margin: 0; line-height: 1.35; }
h1 { font-size: 30px; letter-spacing: -.4px; }
h2 { font-size: 20px; margin: 34px 0 14px; display: flex; align-items: center; gap: 10px; }
h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, #2563eb, #0d9488); }
h3 { font-size: 16px; margin-bottom: 8px; }
p { margin: 8px 0; }
.lead { color: #475569; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.center { text-align: center; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 400px at 8% -20%, rgba(37,99,235,.20), transparent 60%),
              radial-gradient(900px 380px at 92% 0%, rgba(13,148,136,.18), transparent 60%),
              #0e1a30;
  color: #fff; border-radius: 20px;
  padding: 46px 44px 40px;
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 38px; letter-spacing: -.6px; }
.hero .kicker { display: inline-block; font-size: 12px; letter-spacing: .18em; color: #93c5fd; margin-bottom: 14px; }
.hero p.lead { color: #c7d2e2; max-width: 780px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 26px; }
.hero-stat b { display: block; font-size: 26px; color: #fff; }
.hero-stat span { font-size: 12px; color: #8fa3bf; }
.hero-actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: .15s ease;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-ghost { background: rgba(255,255,255,.08); color: #e2e8f0; border-color: rgba(255,255,255,.22); }
.btn-ghost:hover { background: rgba(255,255,255,.16); text-decoration: none; }
.btn-line { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-line:hover { border-color: #c7d2e2; text-decoration: none; }

/* ---------- cards / grids ---------- */
.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)); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.card h3 { display: flex; align-items: center; gap: 8px; }
.card p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.card-soft { background: #fbfcfe; }

.num-badge {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px;
  background: var(--blue-soft); color: #1d4ed8;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.tag {
  display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px;
  background: #eef2f8; color: #475569; border: 1px solid #e2e8f0;
}
.tag-blue { background: var(--blue-soft); color: #1d4ed8; border-color: #c7dbff; }
.tag-green { background: var(--green-soft); color: var(--green); border-color: #bfe3c8; }
.tag-amber { background: var(--amber-soft); color: var(--amber); border-color: #fcd9b6; }
.tag-red { background: var(--red-soft); color: var(--red); border-color: #fecaca; }
.tag-teal { background: var(--teal-soft); color: var(--teal); border-color: #b7e3da; }

/* ---------- architecture bands ---------- */
.bands { display: flex; flex-direction: column; gap: 10px; }
.band {
  display: grid; grid-template-columns: 210px 1fr; gap: 12px; align-items: center;
  border-radius: 12px; padding: 12px 14px; border: 1px solid;
}
.band-label { font-weight: 700; font-size: 13px; line-height: 1.4; }
.band-label small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: .06em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #fff; border: 1px solid rgba(15,27,51,.10); border-radius: 8px;
  padding: 5px 11px; font-size: 13px; color: var(--ink); white-space: nowrap;
}
.band-l6 { background: #e8f0fe; border-color: #b9cffb; }
.band-l5 { background: #e6f4ea; border-color: #bfe3c8; }
.band-l4 { background: #fff4e5; border-color: #fcd9b6; }
.band-l3 { background: #f3e8fd; border-color: #ddd0f5; }
.band-l2 { background: #e3f2fd; border-color: #b9dcfb; }
.band-l1 { background: #eceff1; border-color: #cfd8dc; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef2f8; vertical-align: top; }
th { background: #f1f5fb; color: #334155; font-weight: 700; font-size: 12.5px; letter-spacing: .02em; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafcff; }
td .num { font-variant-numeric: tabular-nums; }
.up { color: #b91c1c; }
.down { color: #15803d; }

/* ---------- metrics ---------- */
.metric { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.metric b { display: block; font-size: 24px; letter-spacing: -.4px; }
.metric span { font-size: 12px; color: var(--muted); }
.metric .delta { font-size: 12px; font-weight: 600; margin-left: 6px; }

/* ---------- chat / workbench ---------- */
.workbench { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.panel-head { padding: 13px 16px; border-bottom: 1px solid #eef2f8; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.panel-body { padding: 14px 16px; }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  cursor: pointer; background: #fbfcfe; transition: .15s;
}
.task:hover { border-color: #c7dbff; background: #f6f9ff; }
.task.active { border-color: #93b8f9; background: #eef5ff; box-shadow: 0 0 0 1px #93b8f9 inset; }
.task b { font-size: 13.5px; display: block; }
.task span { font-size: 12px; color: var(--muted); }

.chat { display: flex; flex-direction: column; gap: 14px; min-height: 420px; }
.msg { display: flex; gap: 10px; }
.msg .avatar {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #2563eb, #0d9488);
}
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { background: #2563eb; color: #fff; border-color: transparent; }
.msg .bubble { background: #f7f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; max-width: 92%; }
.msg .bubble p:first-child { margin-top: 0; }
.msg .bubble p:last-child { margin-bottom: 0; }

.answer-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.answer-meta .tag { font-size: 11px; }

details.evidence {
  margin-top: 10px; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 8px 12px; background: #fff;
}
details.evidence summary { cursor: pointer; font-size: 12.5px; color: #475569; font-weight: 600; }
details.evidence ol { margin: 8px 0 0; padding-left: 20px; font-size: 12.5px; color: #475569; }
details.evidence li { margin: 4px 0; }

.quick-asks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick-asks button {
  border: 1px solid #c7dbff; background: #f2f7ff; color: #1d4ed8;
  padding: 7px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.quick-asks button:hover { background: #e4efff; }

.ctx-item { padding: 9px 0; border-bottom: 1px dashed #e6ecf5; font-size: 13px; }
.ctx-item:last-child { border-bottom: none; }
.ctx-item b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }

/* ---------- compliance pipeline ---------- */
.pipeline { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pstep {
  flex: 1; min-width: 130px; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; background: #fff; cursor: pointer; position: relative; transition: .15s;
}
.pstep:hover { border-color: #c7dbff; }
.pstep.active { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb inset; background: #f6faff; }
.pstep .idx { font-size: 11px; color: var(--blue); font-weight: 700; letter-spacing: .08em; }
.pstep b { display: block; font-size: 14px; margin-top: 2px; }
.pstep span { font-size: 12px; color: var(--muted); }
.pstep.done .idx { color: #15803d; }
.pstep.done::after { content: "✓"; position: absolute; top: 10px; right: 12px; color: #15803d; font-weight: 700; }

.flow-log { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: #0f172a; color: #cbd5e1; border-radius: 12px; padding: 14px 16px; min-height: 120px; }
.flow-log .ok { color: #4ade80; }
.flow-log .warn { color: #fbbf24; }
.flow-log .err { color: #f87171; }
.flow-log .dim { color: #64748b; }

/* ---------- charts ---------- */
.chart-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.chart-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.chart-sub { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
svg { display: block; width: 100%; height: auto; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- footer ---------- */
.footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- misc ---------- */
.divline { height: 1px; background: var(--line); margin: 24px 0; }
.notice {
  background: #fff8e6; border: 1px solid #fde8b8; color: #92400e;
  border-radius: 10px; padding: 10px 14px; font-size: 13px;
}
.docs-list { display: flex; flex-direction: column; gap: 12px; }
.doc-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.doc-row .doc-name { font-weight: 600; }
.doc-row .doc-meta { font-size: 12px; color: var(--muted); }
.doc-row .btn { white-space: nowrap; }
.doc-actions { flex: 0 0 auto; display: flex; gap: 8px; }

@media (max-width: 1180px) {
  .workbench { grid-template-columns: 220px minmax(0, 1fr); }
  .workbench .panel-ctx { display: none; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 18px 16px 48px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .hero { padding: 30px 22px; }
  .hero h1 { font-size: 26px; }
  .topbar { flex-wrap: wrap; }
  .topbar-right { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .doc-row { flex-direction: column; align-items: flex-start; }
  .doc-actions { width: 100%; }
  .workbench { grid-template-columns: 1fr; }
  .band { grid-template-columns: 1fr; }
  .doc-row .btn { flex: 1; justify-content: center; }
}
