:root {
  color-scheme: dark;
  --bg: #07111f;
  --surface: #0d1a2b;
  --surface-2: #122237;
  --line: rgba(153, 186, 213, .18);
  --text: #edf5fb;
  --muted: #91a8ba;
  --cyan: #40d9c2;
  --gold: #e3b75f;
  --red: #ff6f74;
  --orange: #ffad5c;
  --yellow: #e7d466;
  --ready: #40d9c2;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(circle at 85% 5%, rgba(31, 113, 127, .18), transparent 28%), var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
.topbar { min-height: 76px; padding: 14px clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(7, 17, 31, .92); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--gold); color: var(--gold); font-size: 24px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); margin-top: 4px; font-size: 11px; letter-spacing: .08em; }
.topnav { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 14px; }
.topnav a:hover { color: var(--cyan); }
main { width: min(1480px, calc(100% - 40px)); margin: 0 auto; }
.hero { min-height: 420px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 50px; align-items: center; padding: 64px 0 46px; }
.eyebrow { color: var(--cyan); font-size: 11px; font-weight: 700; letter-spacing: .16em; margin: 0 0 12px; }
h1 { font-size: clamp(34px, 4.5vw, 66px); line-height: 1.14; margin: 0; letter-spacing: -.04em; }
h1 span { color: var(--gold); }
h2 { margin: 0; font-size: clamp(23px, 2vw, 32px); }
h3 { margin: 0; }
.hero-copy { max-width: 760px; color: var(--muted); font-size: 17px; line-height: 1.9; }
.hero-panel { padding: 30px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(64, 217, 194, .08), rgba(13, 26, 43, .9)); box-shadow: 0 24px 80px rgba(0, 0, 0, .22); }
.hero-panel p { color: var(--muted); line-height: 1.8; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 18px var(--cyan); margin-right: 10px; }
.hero-metrics { display: grid; gap: 10px; margin-top: 24px; color: var(--gold); font-size: 13px; }
.connection { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; border: 1px solid var(--line); background: var(--surface); }
.connection-copy { display: grid; gap: 5px; }
.connection-copy span { color: var(--muted); font-size: 12px; }
.connection-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.connection input { width: min(360px, 40vw); background: #081421; color: var(--text); border: 1px solid var(--line); padding: 10px 12px; outline: none; }
.connection input:focus { border-color: var(--cyan); }
.button { border: 1px solid transparent; padding: 10px 16px; color: var(--text); background: none; transition: .2s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { background: var(--cyan); color: #04211f; font-weight: 800; }
.button.secondary { border-color: rgba(64, 217, 194, .5); color: var(--cyan); }
.button.ghost { border-color: var(--line); background: rgba(255, 255, 255, .025); }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.section { padding: 54px 0 12px; scroll-margin-top: 80px; }
.section-heading, .panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.section-heading .muted { max-width: 800px; }
.muted { color: var(--muted); line-height: 1.7; font-size: 13px; }
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.kpi { min-height: 130px; padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi strong { display: block; margin: 14px 0 8px; font-size: 31px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--cyan); }
.pipeline { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin: 24px 0; }
.stage { position: relative; padding: 18px 12px; min-height: 132px; background: var(--surface); border-top: 3px solid var(--line); }
.stage.ready { border-color: var(--ready); }
.stage.warning { border-color: var(--orange); }
.stage.critical { border-color: var(--red); }
.stage-index { color: var(--muted); font-size: 11px; }
.stage strong { display: block; margin: 12px 0 8px; }
.stage small { color: var(--muted); line-height: 1.6; }
.brief { padding: 22px; border-left: 3px solid var(--gold); background: rgba(227, 183, 95, .07); line-height: 1.8; }
.brief p { margin: 6px 0; }
.split-section { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.panel { min-width: 0; padding: 24px; border: 1px solid var(--line); background: var(--surface); }
.panel.wide { width: 100%; }
.count-badge { min-width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--gold); }
.record-list { display: grid; gap: 10px; max-height: 660px; overflow: auto; }
.record { padding: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.record-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.record p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 8px 0; }
.record code { color: var(--gold); font-size: 11px; word-break: break-all; }
.risk { flex: 0 0 auto; padding: 3px 8px; font-size: 11px; border: 1px solid currentColor; }
.risk.red { color: var(--red); }
.risk.orange { color: var(--orange); }
.risk.yellow { color: var(--yellow); }
.risk.none { color: var(--cyan); }
.action-text { color: var(--text) !important; border-left: 2px solid var(--cyan); padding-left: 10px; }
.empty-state:empty::before, .empty-state { color: var(--muted); font-size: 13px; }
.twin-grid { display: grid; gap: 12px; }
.twin-card { padding: 18px; border: 1px solid var(--line); background: linear-gradient(140deg, rgba(64, 217, 194, .05), transparent); }
.twin-card strong { font-size: 17px; }
.twin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.twin-stats span { padding: 10px; background: rgba(0, 0, 0, .16); color: var(--muted); font-size: 12px; }
.twin-stats b { display: block; color: var(--text); font-size: 20px; margin-bottom: 4px; }
.timeline { position: relative; display: grid; gap: 14px; max-height: 600px; overflow: auto; }
.timeline-item { padding-left: 18px; border-left: 1px solid var(--cyan); }
.timeline-item time { display: block; color: var(--cyan); font-size: 11px; margin-bottom: 5px; }
.timeline-item p { margin: 0; font-size: 13px; line-height: 1.6; }
.agent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.agent-steps { display: grid; gap: 8px; }
.agent-step { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.step-number { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--cyan); }
.agent-step small { display: block; color: var(--muted); margin-top: 5px; }
.status-pill { padding: 5px 10px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.status-pill.completed { color: var(--cyan); border-color: var(--cyan); }
.status-pill.failed { color: var(--red); border-color: var(--red); }
.status-pill.awaiting_approval { color: var(--orange); border-color: var(--orange); }
.approval-card { margin-top: 16px; padding: 16px; border: 1px solid var(--orange); background: rgba(255, 173, 92, .06); }
.approval-card p { color: var(--muted); line-height: 1.6; }
#dataInput { width: 100%; min-height: 420px; resize: vertical; padding: 20px; border: 1px solid var(--line); background: #050d16; color: #c7e7dd; outline: none; font: 13px/1.7 Consolas, monospace; tab-size: 2; }
#dataInput:focus { border-color: var(--cyan); }
.data-actions { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 0; }
.checkbox { color: var(--muted); font-size: 13px; }
.checkbox input { accent-color: var(--cyan); }
.message { min-height: 26px; color: var(--cyan); }
.message.error { color: var(--red); }
.raw-output { margin-top: 16px; border: 1px solid var(--line); padding: 14px; }
.raw-output summary { cursor: pointer; color: var(--muted); }
.raw-output pre { max-height: 500px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: #c7e7dd; font-size: 12px; }
footer { margin-top: 70px; padding: 28px clamp(20px, 4vw, 64px); display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .pipeline { grid-template-columns: repeat(4, 1fr); }
  .hero, .split-section { grid-template-columns: 1fr; }
  .hero { gap: 24px; }
}
@media (max-width: 760px) {
  .topbar { position: static; align-items: flex-start; }
  .topnav a { display: none; }
  .topnav { gap: 8px; }
  main { width: min(100% - 24px, 1480px); }
  .hero { padding-top: 38px; min-height: auto; }
  .connection, .data-actions, .section-heading { align-items: stretch; flex-direction: column; }
  .connection input { width: 100%; }
  .connection-actions { display: grid; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .agent-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  footer { flex-direction: column; }
}
