:root {
  --bg: #0b1020;
  --panel: #172033;
  --panel-2: #1f2a44;
  --line: rgba(148, 163, 184, .18);
  --text: #eef2ff;
  --muted: #94a3b8;
  --blue: #6d8dff;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 10%, rgba(109, 141, 255, .22), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(245, 158, 11, .12), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
a { color: inherit; }
.page-grid {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, .12) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 46px);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 32, .78);
  backdrop-filter: blur(18px);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6d8dff, #8b5cf6);
  font-weight: 800;
}
.topbar strong { display: block; font-size: 17px; }
.topbar span, .topbar-status { color: var(--muted); font-size: 13px; }
.topbar-status { margin-left: auto; }
.admin-link {
  margin-left: 6px;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.back-link {
  text-decoration: none;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.shell {
  position: relative;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 80px;
}
.query-console {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 32, 51, .78);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
  padding: 22px;
}
.console-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}
.console-head h1 {
  max-width: none;
  font-size: clamp(28px, 4vw, 44px);
}
.console-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.console-stats span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}
.console-stats strong { color: var(--text); font-size: 13px; }
.primary-query { margin-top: 18px; }
.primary-query .input { height: 52px; font-size: 16px; }
.primary-query button { min-width: 132px; }
.search-inline { margin-top: 14px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: stretch;
}
.kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, p { margin: 0; }
h1 {
  max-width: 780px;
  font-size: clamp(40px, 6vw, 78px);
  line-height: 1.05;
  letter-spacing: 0;
}
.lead {
  max-width: 760px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}
.hero-card, .panel, .detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 32, 51, .82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}
.hero-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-card span { color: var(--amber); font-size: 13px; font-weight: 800; }
.hero-card strong { display: block; margin: 10px 0; font-size: 24px; line-height: 1.25; }
.hero-card p, .panel p { color: var(--muted); line-height: 1.7; }
.status-band {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(23, 32, 51, .72);
}
.status-band div { padding: 18px 22px; border-right: 1px solid var(--line); }
.status-band div:last-child { border-right: none; }
.status-band span { display: block; color: var(--muted); font-size: 13px; }
.status-band strong { display: block; margin-top: 8px; font-size: 20px; }
.tool-grid { margin-top: 28px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; }
.panel { padding: 22px; }
.panel h2 { font-size: 21px; margin-bottom: 8px; }
.accent-panel { border-color: rgba(109, 141, 255, .38); }
.query-row { display: flex; gap: 10px; margin-top: 16px; }
.input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, .72);
  color: var(--text);
  outline: none;
  padding: 0 14px;
  font-size: 15px;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(109, 141, 255, .12); }
button {
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6d8dff, #6952e8);
  color: white;
  font-weight: 700;
  padding: 0 22px;
  cursor: pointer;
  white-space: nowrap;
}
.feedback { min-height: 22px; margin-top: 12px; color: var(--green); font-size: 14px; }
.task-progress {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(109, 141, 255, .34);
  border-radius: 8px;
  background: rgba(8, 13, 28, .42);
  color: var(--text);
}
.task-progress.done { border-color: rgba(34,197,94,.42); }
.task-progress.failed { border-color: rgba(239,68,68,.55); }
.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.progress-head strong { font-size: 15px; }
.progress-head span {
  color: var(--muted);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.progress-bar {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, .18);
}
.progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d8dff, #22c55e);
  transition: width .35s ease;
}
.task-progress.failed .progress-bar i { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.progress-steps span {
  position: relative;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.progress-steps span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: rgba(148, 163, 184, .4);
}
.progress-steps span.active { color: var(--text); }
.progress-steps span.active::before { background: var(--green); box-shadow: 0 0 0 4px rgba(34,197,94,.12); }
.task-progress p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.progress-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 10px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(34,197,94,.16);
  color: var(--green);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}
.section-head {
  margin-top: 42px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}
.section-head h2 { font-size: 30px; }
.legend { color: var(--muted); font-size: 13px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); margin-right: 6px; }
.report-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.report-card {
  display: block;
  min-height: 350px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-decoration: none;
  transition: transform .2s, border-color .2s, background .2s;
}
.report-card:hover { transform: translateY(-3px); border-color: rgba(109, 141, 255, .42); background: var(--panel-2); }
.report-card.amber { border-color: rgba(245, 158, 11, .56); }
.report-card.red { border-color: rgba(239, 68, 68, .68); }
.quote-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.code { color: var(--blue); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.quote-head .code {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 6px;
  background: rgba(109, 141, 255, .14);
  margin-top: 8px;
}
.badge { padding: 5px 8px; border-radius: 8px; font-size: 12px; font-weight: 800; background: rgba(34,197,94,.16); color: var(--green); }
.badge.amber { background: rgba(245,158,11,.16); color: var(--amber); }
.badge.red { background: rgba(239,68,68,.16); color: var(--red); }
.report-card h3 { margin: 0; font-size: 22px; }
.quote-price {
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.quote-price strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}
.quote-price span {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 800;
}
.rise { color: var(--red); }
.fall { color: var(--green); }
.summary { color: var(--muted); line-height: 1.65; min-height: 78px; }
.thesis {
  margin-top: 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}
.decision-line {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: rgba(8, 13, 28, .38);
}
.decision-line strong { font-size: 14px; }
.decision-line span { color: var(--muted); font-size: 12px; text-align: right; }
.decision-line.red strong { color: var(--red); }
.decision-line.amber strong { color: var(--amber); }
.decision-line.green strong { color: var(--green); }
.scan-metrics {
  margin-top: 14px;
  display: grid;
  gap: 0;
}
.scan-metrics p {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .10);
  color: var(--muted);
}
.scan-metrics p:last-child { border-bottom: none; }
.scan-metrics strong {
  color: var(--text);
  font-size: 14px;
  text-align: right;
}
.scan-metrics strong.hot { color: var(--red); }
.radar-strip {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(8, 13, 28, .38);
}
.radar-strip strong {
  display: block;
  font-size: 13px;
}
.radar-strip span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.radar-strip.green { border-color: rgba(34,197,94,.38); }
.radar-strip.amber { border-color: rgba(245,158,11,.45); }
.radar-strip.red { border-color: rgba(239,68,68,.52); }
.tag-row {
  min-height: 27px;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-row em,
.radar-groups em,
.signal-footer em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(109, 141, 255, .12);
  color: #b9c6ff;
  font-style: normal;
  font-size: 12px;
  line-height: 1;
}
.signal-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(239, 68, 68, .24);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.signal-footer.quiet { border-top-color: rgba(148, 163, 184, .12); }
.signal-footer em {
  background: rgba(239, 68, 68, .12);
  color: #fecaca;
}
.signal-footer.quiet em {
  background: rgba(109, 141, 255, .12);
  color: #b9c6ff;
}
.metric { padding: 10px; border-radius: 8px; background: rgba(8, 13, 28, .42); }
.metric span { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 4px; font-size: 16px; }
.empty-state {
  margin-top: 18px;
  padding: 52px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.hidden { display: none; }
.toast {
  position: fixed;
  right: 20px;
  top: 84px;
  transform: translateX(140%);
  transition: transform .25s;
  padding: 12px 16px;
  border-radius: 8px;
  background: #0f766e;
  color: white;
  z-index: 50;
}
.toast.show { transform: translateX(0); }
.detail-shell { max-width: 1180px; }
.detail-card { padding: 28px; }
.detail-title { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.detail-title h1 { font-size: clamp(32px, 5vw, 54px); }
.warning-list { display: grid; gap: 10px; margin-top: 24px; }
.warning {
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(8, 13, 28, .35);
}
.warning.amber { border-color: rgba(245,158,11,.5); }
.warning.red { border-color: rgba(239,68,68,.55); }
.warning.info { border-color: rgba(109,141,255,.5); }
.detail-metrics { margin-top: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.radar-panel,
.decision-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(8, 13, 28, .36);
}
.radar-panel.green, .decision-panel.green { border-color: rgba(34,197,94,.42); }
.radar-panel.amber, .decision-panel.amber { border-color: rgba(245,158,11,.48); }
.radar-panel.red, .decision-panel.red { border-color: rgba(239,68,68,.58); }
.radar-panel h2, .decision-panel h2 { margin: 0; font-size: 24px; }
.radar-panel p, .decision-panel p { margin-top: 8px; color: var(--muted); line-height: 1.65; }
.action-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.action-grid div {
  padding: 14px;
  border-radius: 8px;
  background: rgba(23, 32, 51, .64);
}
.action-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.action-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}
.radar-groups,
.signal-groups {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.radar-groups div,
.signal-groups div {
  padding: 12px;
  border-radius: 8px;
  background: rgba(23, 32, 51, .58);
}
.radar-groups span,
.signal-groups span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.radar-groups em,
.signal-groups em {
  margin: 0 6px 6px 0;
}
.source-note { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); line-height: 1.7; }
.question-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.question-card {
  min-height: 164px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(8, 13, 28, .34);
}
.question-card.green { border-color: rgba(34,197,94,.38); }
.question-card.amber { border-color: rgba(245,158,11,.44); }
.question-card.red { border-color: rgba(239,68,68,.56); }
.question-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.question-card strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
}
.question-card.green strong { color: var(--green); }
.question-card.amber strong { color: var(--amber); }
.question-card.red strong { color: var(--red); }
.question-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.module-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.info-module {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, .28);
}
.info-module h2 {
  margin: 0 0 14px;
  font-size: 20px;
}
.compact-list {
  display: grid;
  gap: 10px;
}
.compact-list p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}
.compact-list strong {
  color: var(--text);
  font-size: 16px;
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-cloud em {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(109, 141, 255, .12);
  color: #b9c6ff;
  font-style: normal;
  font-size: 13px;
}
.report-sections {
  margin-top: 24px;
  display: grid;
  gap: 14px;
}
.report-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 28, .28);
  padding: 18px;
}
.report-section h2 { margin: 0 0 8px; font-size: 20px; }
.report-section p { color: var(--muted); line-height: 1.65; }
.report-section ul { margin: 12px 0 0; padding-left: 20px; color: var(--text); line-height: 1.75; }
.admin-shell { width: min(1280px, calc(100% - 32px)); }
.admin-table-wrap {
  margin-top: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 32, 51, .72);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
.admin-table th {
  color: var(--muted);
  font-weight: 700;
  background: rgba(8, 13, 28, .35);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .14);
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.status-pill.done, .status-pill.success, .status-pill.green { background: rgba(34,197,94,.14); color: var(--green); }
.status-pill.pending, .status-pill.retrying, .status-pill.running { background: rgba(245,158,11,.14); color: var(--amber); }
.status-pill.failed, .status-pill.red { background: rgba(239,68,68,.14); color: var(--red); }
.status-pill.amber { background: rgba(245,158,11,.14); color: var(--amber); }
.status-pill.gray { background: rgba(148,163,184,.14); color: var(--muted); }

@media (max-width: 860px) {
  .hero, .tool-grid, .status-band, .report-grid, .detail-metrics, .radar-groups, .signal-groups, .action-grid, .module-grid, .question-grid { grid-template-columns: 1fr; }
  .console-head { align-items: start; flex-direction: column; }
  .console-stats { justify-content: flex-start; }
  .status-band div { border-right: none; border-bottom: 1px solid var(--line); }
  .status-band div:last-child { border-bottom: none; }
  .query-row { flex-direction: column; }
  button { height: 46px; }
  .section-head { align-items: start; flex-direction: column; }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1181px) and (max-width: 1420px) {
  .report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
