:root {
  --bg: #0a0f1c;
  --bg-2: #0e1424;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.10);
  --text: #e7ecf5;
  --muted: #8a96ad;
  --accent: #4cc9f0;
  --accent-2: #7b5cff;
  --warm: #ff8a4c;
  --good: #2dd4bf;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* 中文 → 宋体 (SimSun);英文 → Times New Roman。
   先列拉丁字体,系统就会让英文走 Times New Roman,中文回落到宋体。
   最小字号 16px(= 小四 12pt) */
html { font-size: 16px; }

body {
  font-family: "Times New Roman", "Times", "SimSun", "STSong", "宋体", serif;
  font-size: 16px;
  line-height: 1.7;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(123, 92, 255, 0.18), transparent 60%),
              radial-gradient(900px 500px at -10% 10%, rgba(76, 201, 240, 0.14), transparent 60%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.topbar, .hero, .block, .footer { position: relative; z-index: 1; }

/* ===== Top Bar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.brand strong { font-size: 22px; letter-spacing: 0.4px; }
.brand-sub {
  color: var(--muted); font-size: 16px; max-width: 520px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.logo-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--warm), var(--accent));
  box-shadow: 0 0 14px rgba(76, 201, 240, 0.6);
  flex-shrink: 0;
}
.topnav { display: flex; gap: 26px; }
.topnav a {
  color: var(--muted); text-decoration: none; font-size: 16px; transition: color .15s;
}
.topnav a:hover { color: var(--text); }

.stu-logo {
  display: flex; align-items: center; justify-content: center;
  height: 48px; padding: 6px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
}
.stu-logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(76, 201, 240, 0.25);
}
.stu-logo img {
  height: 36px; width: auto; display: block;
}

/* ===== Hero ===== */
.hero {
  padding: 64px 56px 40px;
  max-width: 1280px;
  margin: 0 auto;
}
.eyebrow {
  color: var(--accent); font-size: 16px; letter-spacing: 2px; text-transform: uppercase;
  margin: 0 0 14px;
}
.hero h1 {
  font-size: 48px; line-height: 1.22; margin: 0 0 22px;
  background: linear-gradient(120deg, #fff 30%, #b9c2d8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.lede {
  color: var(--muted); max-width: 760px; font-size: 18px; line-height: 1.75;
  margin: 0 0 12px;
}
.credits {
  color: var(--muted); font-size: 16px; margin: 14px 0 0;
}
.credits a {
  color: var(--accent); text-decoration: none; border-bottom: 1px dashed rgba(76, 201, 240, 0.5);
  padding-bottom: 1px;
}
.credits a:hover { color: var(--text); border-bottom-color: var(--text); }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 16px; margin-top: 32px;
}
.hero-stats > div {
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border);
}
.hero-stats strong { display: block; font-size: 26px; }
.hero-stats span { color: var(--muted); font-size: 16px; }
.hero-stats .hl {
  background: linear-gradient(120deg, rgba(76, 201, 240, 0.15), rgba(123, 92, 255, 0.15));
  border-color: rgba(76, 201, 240, 0.4);
}

/* ===== Block layout ===== */
.block {
  padding: 30px 56px 60px;
  max-width: 1280px; margin: 0 auto;
}
.block-head { margin-bottom: 26px; }
.block-head h2 {
  margin: 0 0 10px; font-size: 26px; letter-spacing: 0.2px;
}
.block-head p { margin: 0; color: var(--muted); font-size: 16px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; font-size: 16px; color: var(--muted);
}
.chip {
  background: rgba(76, 201, 240, 0.12); color: var(--accent);
  border: 1px solid rgba(76, 201, 240, 0.3);
  padding: 3px 12px; border-radius: 999px; font-size: 14px;
}
.chip.soft { background: rgba(255, 255, 255, 0.05); color: var(--muted); border-color: var(--border); }

/* ===== Interactive ===== */
.interactive-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
}
.globe-card {
  position: relative;
  background: radial-gradient(circle at 50% 60%, rgba(76, 201, 240, 0.08), transparent 65%), #050912;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 540px;
}
#globeViz { width: 100%; height: 540px; }
.globe-legend {
  position: absolute; left: 16px; bottom: 14px;
  display: flex; gap: 20px; align-items: center;
  font-size: 16px; color: var(--muted);
  background: rgba(10, 15, 28, 0.75); padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--border); backdrop-filter: blur(6px);
}
.globe-legend .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.globe-legend .dot.user { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.globe-legend .dot.svc  { background: var(--warm);   box-shadow: 0 0 6px var(--warm); }
.globe-legend .line {
  display: inline-block; width: 18px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  vertical-align: middle; margin-right: 6px;
}
.globe-legend .hint { margin-left: auto; color: #687490; font-size: 14px; }

.predict-card .ctrl { margin-bottom: 14px; }
.predict-card label {
  display: block; color: var(--muted); font-size: 16px; margin-bottom: 8px;
}
.predict-card select {
  width: 100%; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 16px;
  font-family: inherit;
  outline: none;
}
.predict-card select:focus { border-color: var(--accent); }
.ghost {
  background: transparent; border: 1px solid var(--border);
  color: var(--text); padding: 6px 14px; border-radius: 8px; font-size: 14px;
  font-family: inherit;
  cursor: pointer; transition: all .15s;
}
.ghost:hover { background: rgba(76, 201, 240, 0.1); border-color: var(--accent); }

.seg {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.seg button {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  color: var(--muted); padding: 10px; border-radius: 8px; font-size: 14px;
  font-family: inherit;
  cursor: pointer; transition: all .15s;
}
.seg button:hover { color: var(--text); }
.seg button.active {
  background: rgba(76, 201, 240, 0.15); border-color: var(--accent); color: var(--accent);
}

.pair-info {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 18px 0 16px;
}
.pair-info > div {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.pair-info span { color: var(--muted); font-size: 14px; display: block; }
.pair-info strong { font-size: 16px; line-height: 1.35; display: block; margin-top: 6px; word-break: break-word; }

.results-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 16px;
}
.result-card {
  padding: 16px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.result-card span { color: var(--muted); font-size: 14px; }
.result-card strong {
  display: block; font-size: 26px; margin: 6px 0 4px; font-weight: 700;
}
.result-card small { color: var(--muted); font-size: 14px; }
.result-card small em { font-style: normal; color: var(--text); margin-left: 4px; }
.result-card.truth    strong { color: var(--good); }
.result-card.qosdiff  { border-color: rgba(76, 201, 240, 0.4); background: rgba(76, 201, 240, 0.06); }
.result-card.qosdiff  strong { color: var(--accent); }
.result-card.baseline { border-color: rgba(255, 138, 76, 0.4); background: rgba(255, 138, 76, 0.06); }
.result-card.baseline strong { color: var(--warm); }

.bar-compare .bar-row {
  display: grid; grid-template-columns: 72px 1fr; align-items: center;
  gap: 10px; margin-bottom: 10px;
}
.bar-compare .lbl { font-size: 14px; color: var(--muted); }
.bar-compare .bar {
  height: 12px; background: rgba(255, 255, 255, 0.05); border-radius: 6px; overflow: hidden;
}
.bar-compare .fill {
  height: 100%; border-radius: 6px; transition: width .35s ease;
}
.fill.qos  { background: linear-gradient(90deg, var(--accent), #66d8ff); }
.fill.base { background: linear-gradient(90deg, var(--warm), #ffb88a); }
.fill.tr   { background: linear-gradient(90deg, var(--good), #6ee7d8); }

/* ===== Architecture ===== */
.arch-card {
  padding: 24px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.arch-svg { width: 100%; height: auto; }
.arch-svg text {
  font-family: "Times New Roman", "SimSun", "宋体", serif;
}
/* SVG 里那些 9-10 的小标签拉到 12;11-13 的稍微调大;保持视觉层次 */
.arch-svg text[font-size="9"]  { font-size: 12px; }
.arch-svg text[font-size="10"] { font-size: 12px; }
.arch-svg text[font-size="11"] { font-size: 13px; }
.arch-svg text[font-size="12"] { font-size: 14px; }
.arch-svg text[font-size="13"] { font-size: 16px; }
.arch-notes {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 22px;
}
.arch-notes > div {
  font-size: 16px; color: var(--muted); line-height: 1.75;
  padding: 14px 16px; background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border); border-radius: 10px;
}
.kbd {
  display: inline-block; padding: 3px 10px; margin-right: 6px;
  border-radius: 6px; font-size: 14px; color: var(--accent);
  background: rgba(76, 201, 240, 0.1); border: 1px solid rgba(76, 201, 240, 0.3);
}

/* ===== Results ===== */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.result-grid .wide { grid-column: 1 / -1; }
.chart { height: 320px; width: 100%; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse; font-size: 16px;
}
th, td {
  padding: 12px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 500; font-size: 16px; }
td { color: var(--text); }
tr.best td { background: rgba(76, 201, 240, 0.06); }
tr.best td:first-child { color: var(--accent); }
td.win { color: var(--accent); font-weight: 600; }

/* ===== Result toolbar / table extras ===== */
.result-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.result-toolbar .seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(96px, max-content); gap: 6px; }
.toolbar-hint { color: var(--muted); font-size: 14px; margin-left: auto; }

#metricsTable th, #metricsTable td { white-space: nowrap; }
#metricsTable thead tr.sub th {
  color: var(--muted); font-size: 14px; padding: 6px 14px; border-bottom: 1px solid var(--border);
}
#metricsTable th[colspan] {
  text-align: center; color: var(--text); font-size: 15px;
  border-bottom: 1px solid var(--border);
}
#metricsTable tr.qos td {
  background: rgba(76, 201, 240, 0.10);
}
#metricsTable tr.qos td:first-child {
  color: var(--accent); font-weight: 600;
}
#metricsTable td.win { color: var(--accent); font-weight: 600; }

.rob-takeaway p {
  margin: 0; color: var(--muted); font-size: 16px; line-height: 1.85;
}
.rob-takeaway strong { color: var(--text); }

/* ===== Footer ===== */
.footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 30px 56px; max-width: 1280px; margin: 20px auto 0;
  color: var(--muted); font-size: 16px; border-top: 1px solid var(--border);
}
.footer a { color: var(--accent); text-decoration: none; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .interactive-grid { grid-template-columns: 1fr; }
  .arch-notes { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .brand-sub { display: none; }
}
@media (max-width: 640px) {
  .topbar, .hero, .block, .footer { padding-left: 20px; padding-right: 20px; }
  .topnav { gap: 14px; }
  .topnav a { font-size: 14px; }
  .stu-logo { height: 40px; padding: 4px 10px; }
  .stu-logo img { height: 28px; }
}
