/* QuantX Terminal Theme v2 - dark-tech cockpit (2026-08-04 redesign)
   Single accent: electric cyan. All numbers mono. Zero AI-purple. */
:root {
  color-scheme: dark;
  --bg: #060a13;
  --bg2: #0a101d;
  --surface: #0d1524;
  --surface2: #111b2e;
  --surface3: #16223a;
  --line: #1c2a44;
  --line2: #2a3d61;
  --text: #e8edf7;
  --muted: #7d8db0;
  --muted2: #55648a;
  --accent: #6FA8DE;          /* ice blue - single accent (visual spec) */
  --accent-dim: #0e7490;
  --green: #10b981;
  --red: #f43f5e;
  --amber: #f59e0b;
  --info: #38bdf8;
  --pos: var(--green);
  --neg: var(--red);
  --grad: linear-gradient(135deg, #3a5a7e, #6FA8DE);
  --shadow: 0 20px 60px rgba(2, 6, 18, .6);
  --radius: 10px;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scrollbar-color: var(--line2) transparent; scrollbar-width: thin; }
body.qx-admin-page,
body.qx-login-page,
body.qx-register-page,
body.qx-customer-page {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(34, 211, 238, .06), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(16, 185, 129, .04), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ===== App shell ===== */
.app { display: flex; min-height: 100dvh; }
.sidebar {
  width: 216px; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(13, 21, 36, .9), rgba(9, 14, 26, .95));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
  position: sticky; top: 0; height: 100dvh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--grad);
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  color: #04121a;
  box-shadow: 0 0 22px rgba(34, 211, 238, .35);
}
.brand strong { font-size: 15px; letter-spacing: .2px; display: block; }
.brand small { color: var(--muted); font-size: 10.5px; display: block; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.nav button {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font-size: 13px; font-family: var(--sans);
  padding: 9px 12px; border-radius: 8px; text-align: left;
  transition: background .15s, color .15s;
  position: relative;
}
.nav button::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--line2); transition: background .15s, box-shadow .15s;
  flex-shrink: 0;
}
.nav button:hover { background: rgba(34, 211, 238, .06); color: var(--text); }
.nav button.active { background: rgba(34, 211, 238, .1); color: var(--accent); }
.nav button.active::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.sidebar-foot {
  margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted2); display: flex; flex-direction: column; gap: 6px;
}
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); vertical-align: middle; margin-right: 6px; }
.status-dot.on { background: var(--green); box-shadow: 0 0 8px rgba(16, 185, 129, .7); }

/* ===== Topbar ===== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px; border-bottom: 1px solid var(--line);
  background: rgba(10, 16, 29, .72);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 40;
}
.page-title { font-size: 17px; font-weight: 650; letter-spacing: .3px; }
.page-subtitle { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.top-spacer { flex: 1; }

/* live status strip (clock / ws / freshness) */
.live-strip {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 6px 26px; border-bottom: 1px solid var(--line);
  background: rgba(9, 14, 26, .6);
}
.live-strip .live-item { display: flex; align-items: center; gap: 6px; }
.live-strip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line2); }
.live-strip .dot.ok { background: var(--green); box-shadow: 0 0 8px rgba(16, 185, 129, .6); }
.live-strip .dot.warn { background: var(--amber); box-shadow: 0 0 8px rgba(245, 158, 11, .6); }
.live-strip .dot.bad { background: var(--red); box-shadow: 0 0 8px rgba(244, 63, 94, .6); }

.auth { display: flex; align-items: center; gap: 10px; }
.auth .btn { min-width: 76px; justify-content: center; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--line2); border-radius: 8px;
  padding: 7px 15px; font-size: 12.5px; font-family: var(--sans);
  cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
  text-decoration: none; line-height: 1.4;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn.primary {
  background: var(--grad); border-color: transparent; color: #04121a;
  font-weight: 650;
}
.btn.primary:hover { color: #04121a; filter: brightness(1.12); box-shadow: 0 0 18px rgba(34, 211, 238, .3); }
.btn.danger { border-color: rgba(244, 63, 94, .5); color: var(--red); }
.btn.ghost { background: transparent; }

/* ===== Views ===== */
.view { display: none; }
.view.active { display: block; animation: viewIn .18s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== Content & panels ===== */
.content { padding: 22px 26px 40px; max-width: 1500px; width: 100%; margin: 0 auto; }
.section-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.section-head h2 { font-size: 19px; font-weight: 700; letter-spacing: .3px; margin: 0; }
.section-head p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.push { margin-left: auto; }
.toolbar { display: flex; align-items: center; gap: 8px; }

.panel {
  background: linear-gradient(180deg, rgba(17, 27, 46, .72), rgba(13, 21, 36, .85));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}
.panel:hover { border-color: var(--line2); }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 13px; font-weight: 650; margin: 0; letter-spacing: .4px; }
.panel-head h3::before {
  content: ""; display: inline-block; width: 3px; height: 12px;
  background: var(--grad); border-radius: 2px; margin-right: 9px; vertical-align: -1px;
}
.panel-head .meta { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.panel-body { padding: 14px 18px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-equal { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }

/* ===== Metric cards ===== */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric {
  background: linear-gradient(180deg, rgba(17, 27, 46, .7), rgba(13, 21, 36, .88));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; position: relative; overflow: hidden;
}
.metric::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .5), transparent);
  opacity: 0; transition: opacity .2s;
}
.metric:hover::after { opacity: 1; }
.metric-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .9px; }
.metric-value {
  font-family: var(--mono); font-size: 21px; font-weight: 650;
  margin-top: 5px; letter-spacing: -.3px; font-variant-numeric: tabular-nums;
}
.metric-value.positive { color: var(--green); }
.metric-value.negative { color: var(--red); }
.metric-value.warning { color: var(--amber); }
.metric-note { font-size: 11px; color: var(--muted2); margin-top: 3px; font-family: var(--mono); }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12.5px; }
th {
  font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px;
  background: rgba(13, 21, 36, .65); position: sticky; top: 0;
  font-family: var(--mono);
}
td:last-child, th:last-child { text-align: right; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(34, 211, 238, .04); }
td .mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.warning { color: var(--amber) !important; }
.up { color: var(--green) !important; }
.down { color: var(--red) !important; }
.row-up td { background: rgba(16, 185, 129, .055); }
.row-down td { background: rgba(244, 63, 94, .055); }
.empty { text-align: center; color: var(--muted2); padding: 26px 14px !important; font-size: 12px; }

/* ===== Tags & chips ===== */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px; border-radius: 999px;
  font-size: 10.5px; font-family: var(--mono);
  border: 1px solid var(--line2); color: var(--muted);
  background: rgba(22, 34, 58, .5); white-space: nowrap;
}
.tag.green { border-color: rgba(16, 185, 129, .45); color: var(--green); background: rgba(16, 185, 129, .08); }
.tag.red { border-color: rgba(244, 63, 94, .45); color: var(--red); background: rgba(244, 63, 94, .08); }
.tag.amber { border-color: rgba(245, 158, 11, .45); color: var(--amber); background: rgba(245, 158, 11, .08); }
.tag.blue { border-color: rgba(56, 189, 248, .45); color: var(--info); background: rgba(56, 189, 248, .08); }

/* ===== Runtime / evidence lines ===== */
.runtime-line { display: flex; justify-content: space-between; gap: 14px; padding: 6.5px 0; font-size: 12.5px; border-bottom: 1px dashed rgba(42, 61, 97, .4); }
.runtime-line:last-child { border-bottom: 0; }
.runtime-line span { color: var(--muted); }
.runtime-line b { font-family: var(--mono); font-weight: 550; font-variant-numeric: tabular-nums; }

.evidence-summary { display: flex; align-items: center; gap: 10px; }
.evidence-summary strong { font-family: var(--mono); font-size: 16px; }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed rgba(42, 61, 97, .4); font-size: 12px; }
.check-row > div { display: flex; flex-direction: column; gap: 2px; }
.check-row span { color: var(--muted2); font-size: 11px; font-family: var(--mono); }
.progress { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--grad); border-radius: 2px; }

.form-note { font-size: 11px; color: var(--muted2); padding: 10px 18px; border-top: 1px solid var(--line); }

.muted { color: var(--muted); }
.mode { font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line2); border-radius: 999px; }
.mode.running { color: var(--green); border-color: rgba(16, 185, 129, .45); background: rgba(16, 185, 129, .07); }

/* ===== Forms & dialogs ===== */
input, select, textarea {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line2); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; font-family: var(--sans);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, .12); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-body { padding: 18px; }

/* ===== Alerts ===== */
.alert-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed rgba(42, 61, 97, .4); }
.alert-item b { font-size: 12.5px; }
.alert-item p { color: var(--muted); font-size: 11.5px; margin: 2px 0 0; }
.alert-item.critical b { color: var(--red); }

/* ===== Reduced motion & a11y ===== */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .view.active { animation: none; }
}

/* ===== Responsive ===== */
@media(max-width:620px) { .form-grid { grid-template-columns: 1fr; } }
@media(max-width:1180px) { .strategy-list { grid-template-columns: 1fr; } }
@media(max-width:900px) {
  .app { display: block; }
  .sidebar { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .brand { padding-bottom: 8px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav button { white-space: nowrap; padding: 7px 10px; }
  .sidebar-foot { display: none; }
  .content { padding: 14px; }
  .grid-2, .grid-equal { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 12px; }
  .brand span { display: none; }
}
@media(max-width:560px) {
  .metrics { grid-template-columns: 1fr; }
  .topbar { gap: 8px; }
  .live-strip { flex-wrap: wrap; padding: 6px 12px; }
  .identity { display: none; }
  .auth { width: 100%; order: 3; flex-wrap: wrap; }
  .auth input { flex: 1; min-width: 110px; }
  .auth .btn { width: 100%; }
}

/* ===== 2026-08-06 交互迭代层（3-Agent 规范落地）===== */
.panel{border-radius:var(--radius);transition:border-color .2s cubic-bezier(.22,.61,.36,1)}
.panel:hover{border-color:rgba(111,168,222,.45)}
.panel-head h3{font-variant-numeric:tabular-nums}
.metric-value,.metric .value,td{font-variant-numeric:tabular-nums}
.dot{border-radius:50%;transition:background .2s}
.dot.ok{animation:qx-breath 2.6s ease-in-out infinite}
@keyframes qx-breath{0%,100%{opacity:1}50%{opacity:.45}}
.live-item .dot{width:6px;height:6px}
.btn,button.btn{transition:transform .15s cubic-bezier(.22,.61,.36,1),border-color .15s,color .15s}
.btn:hover,button.btn:hover{transform:translateY(-1px)}
.btn:active,button.btn:active{transform:scale(.97)}
.table-wrap table tr{transition:background .15s}
.table-wrap table tbody tr:hover{background:rgba(111,168,222,.05)}
.tag{border-radius:4px}
@media (prefers-reduced-motion:reduce){.dot.ok{animation:none}.panel,.btn,.table-wrap table tr{transition:none}}
