:root {
  --bg: #0a1224;
  --bg2: #111d36;
  --panel: rgba(18, 32, 58, 0.92);
  --line: rgba(0, 212, 255, 0.14);
  --text: #e8eef8;
  --muted: #8fa3c4;
  --cyan: #00d4ff;
  --orange: #ff6b35;
  --green: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --navy: #1a2a5e;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: Consolas, "Cascadia Mono", monospace;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
button, input, select { font: inherit; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #0d1830, #0a1224);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; padding: 8px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(145deg, #1a2a5e, #243670);
  display: grid; place-items: center; font-weight: 800; color: #fff;
}
.brand-title { font-weight: 800; font-size: 14px; line-height: 1.3; }
.brand-sub { color: var(--muted); font-size: 11px; }
.nav a {
  display: block; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 4px;
}
.nav a.active, .nav a:hover { background: rgba(0,212,255,.1); color: var(--text); text-decoration: none; }
.sidebar-foot { margin-top: 24px; padding: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.6; }

.main { min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 24px; border-bottom: 1px solid var(--line);
  background: rgba(10,18,36,.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { margin: 0; font-size: 20px; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.status-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(34,197,94,.12); color: #86efac; border: 1px solid rgba(34,197,94,.25);
}
.pill.warn { background: rgba(245,158,11,.12); color: #fcd34d; border-color: rgba(245,158,11,.25); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.view { padding: 20px 24px 40px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1100px) { .grid-4, .grid-3 { grid-template-columns: repeat(2,1fr); } .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } }
@media (max-width: 700px) { .grid-2, .grid-4, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.card h3 { margin: 0 0 12px; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }

.kpi { font-size: 32px; font-weight: 800; line-height: 1.1; color: var(--cyan); }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.up { color: #86efac; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.mono { font-family: var(--mono); }
.tag-ok { color: #86efac; }
.tag-ai { color: var(--cyan); font-weight: 700; }
.tag-warn { color: #fcd34d; }

.btn {
  border: none; border-radius: 10px; padding: 10px 16px; font-weight: 700; cursor: pointer;
  background: var(--orange); color: #fff;
}
.btn.secondary { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--cyan); border: 1px solid rgba(0,212,255,.35); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.flow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 14px; border-radius: 10px; background: rgba(0,0,0,.2); font-size: 13px;
}
.flow span { padding: 6px 10px; border-radius: 8px; background: rgba(0,212,255,.08); border: 1px solid var(--line); }
.flow .arrow { background: none; border: none; color: var(--muted); padding: 0; }

.suggest {
  border-left: 4px solid var(--cyan); padding-left: 14px; margin: 12px 0;
}
.suggest strong { color: var(--cyan); font-size: 18px; }
.change { display: inline-block; padding: 2px 8px; border-radius: 6px; background: rgba(0,212,255,.12); font-family: var(--mono); }

.bar-wrap { margin-top: 10px; }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.bar { height: 8px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), #38bdf8); border-radius: 999px; transition: width .8s ease; }

.chart { height: 180px; display: flex; align-items: flex-end; gap: 6px; margin-top: 12px; }
.chart .col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart .bar-v { width: 100%; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--cyan), rgba(0,212,255,.2)); transition: height .8s ease; }
.chart .lbl { font-size: 10px; color: var(--muted); }

.modal-back {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-back.show { display: flex; }
.modal {
  width: min(560px, 100%); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px;
}
.modal h3 { margin-top: 0; }
.exec-step { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.exec-step.done { color: #86efac; }
.exec-step.active { color: var(--cyan); font-weight: 700; }

.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.compare .vs { color: var(--muted); font-weight: 800; }

.timeline { display: grid; gap: 8px; }
.tl-item { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); }

.highlight { animation: pulse 1.2s ease 2; }
@keyframes pulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(0,212,255,.4);} 50%{ box-shadow: 0 0 0 8px rgba(0,212,255,0);} }
