:root {
  --bg: #0b0e14;
  --bg-card: #12161f;
  --bg-card2: #171c27;
  --border: #232a38;
  --text: #e6e9f0;
  --text-dim: #8b93a7;
  --accent: #f50;          /* 淘宝橙 */
  --accent2: #ff7a29;
  --blue: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --purple: #a78bfa;
  --teal: #2dd4bf;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

/* ===== Hero ===== */
.hero {
  background:
    radial-gradient(1200px 400px at 70% -50%, rgba(255,85,0,.18), transparent),
    radial-gradient(800px 300px at 10% 0%, rgba(59,130,246,.12), transparent),
    var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 34px 20px 26px;
}
.hero-inner { max-width: 1180px; margin: 0 auto; }
.hero-title { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo {
  font-size: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  width: 72px; height: 72px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 30px rgba(255,85,0,.35);
  flex-shrink: 0;
}
.hero-title h1 { font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.subtitle { color: var(--text-dim); margin-top: 4px; font-size: 14px; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.chip b { color: var(--text); font-weight: 600; }

/* ===== Layout ===== */
main { max-width: 1180px; margin: 0 auto; padding: 8px 20px 40px; }
.section { margin-top: 38px; }
.section h2 { font-size: 19px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.h2-hint { font-size: 12.5px; color: var(--text-dim); font-weight: 400; }

/* ===== KPI ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: transform .15s, border-color .15s;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--accent); }
.kpi .k-value { font-size: 26px; font-weight: 800; color: var(--accent2); font-variant-numeric: tabular-nums; }
.kpi .k-value .k-unit { font-size: 13px; color: var(--text-dim); font-weight: 500; margin-left: 3px; }
.kpi .k-label { font-size: 12.5px; color: var(--text); margin-top: 2px; font-weight: 600; }
.kpi .k-note { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

/* ===== 播放器 ===== */
.player {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}
.player-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.btn {
  background: var(--bg-card2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.primary:hover { background: var(--accent2); }
.btn.speed { padding: 5px 10px; font-size: 12.5px; }
.btn.speed.active { border-color: var(--accent); color: var(--accent2); background: rgba(255,85,0,.1); }
.speed-group { display: flex; align-items: center; gap: 6px; }
.speed-label { font-size: 12.5px; color: var(--text-dim); }
.time-display { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; }
.time-display .rel { color: var(--text-dim); font-size: 12.5px; font-weight: 500; margin-left: 8px; }

.master-timeline-wrap { position: relative; }
.master-timeline {
  position: relative;
  height: 118px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: crosshair;
}
.mt-lane { position: absolute; left: 0; right: 0; }
.mt-lane-label {
  position: absolute; left: 8px; top: 2px;
  font-size: 10px; color: var(--text-dim);
  z-index: 5; pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.mt-stages { top: 0; height: 26px; }
.mt-stage { position: absolute; top: 0; height: 26px; opacity: .85; display: flex; align-items: center; justify-content: center; font-size: 10px; color: rgba(255,255,255,.92); overflow: hidden; white-space: nowrap; cursor: pointer; transition: opacity .15s; }
.mt-stage:hover { opacity: 1; }
.mt-pages { top: 28px; height: 34px; }
.mt-page { position: absolute; top: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; white-space: nowrap; overflow: hidden; cursor: pointer; border: 1px solid rgba(255,255,255,.15); transition: transform .1s; }
.mt-page:hover { transform: scaleY(1.12); }
.mt-events { top: 64px; height: 52px; }
.mt-event {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  cursor: pointer; transition: transform .1s; z-index: 3;
}
.mt-event:hover { transform: translate(-50%, -50%) rotate(45deg) scale(1.5); z-index: 6; }
.mt-cursor {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  z-index: 8; pointer-events: none;
}
.mt-cursor::after {
  content: ""; position: absolute; top: -1px; left: -4px;
  border: 5px solid transparent; border-top-color: var(--accent);
}
#scrubber { width: 100%; margin-top: 10px; accent-color: var(--accent); cursor: pointer; height: 22px; }

.player-panels {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr 1.5fr;
  gap: 12px; margin-top: 14px;
}
@media (max-width: 980px) { .player-panels { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .player-panels { grid-template-columns: 1fr; } }
.panel {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 118px;
  display: flex; flex-direction: column;
}
.panel-label { font-size: 11.5px; color: var(--text-dim); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.current-page { font-size: 21px; font-weight: 800; line-height: 1.3; }
.page-note { font-size: 11.5px; color: var(--text-dim); margin-top: auto; }
.mem-value { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent2); line-height: 1.1; }
.mem-unit { font-size: 14px; color: var(--text-dim); margin-left: 4px; font-weight: 500; }
.mem-bar { height: 8px; background: #0d1117; border-radius: 4px; margin-top: 8px; overflow: hidden; border: 1px solid var(--border); }
.mem-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue), var(--accent2), var(--red)); transition: width .2s; }
.mem-sub { font-size: 11px; color: var(--text-dim); margin-top: 6px; font-variant-numeric: tabular-nums; }
.comp-count {
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 11px; padding: 1px 8px; margin-left: 6px; font-weight: 700;
}
.comp-chips { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; overflow-y: auto; max-height: 96px; }
.comp-chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid; white-space: nowrap;
  animation: chipIn .25s ease;
}
@keyframes chipIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
.comp-chip.cat-taobao { color: var(--accent2); border-color: rgba(255,122,41,.4); background: rgba(255,85,0,.08); }
.comp-chip.cat-dialog  { color: var(--red); border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.08); }
.comp-chip.cat-other  { color: var(--blue); border-color: rgba(59,130,246,.4); background: rgba(59,130,246,.08); }
.comp-chip.cat-tool   { color: var(--teal); border-color: rgba(45,212,191,.4); background: rgba(45,212,191,.08); }
.live-log { list-style: none; overflow-y: auto; max-height: 96px; font-size: 11.5px; }
.live-log li { padding: 2px 0; border-bottom: 1px dashed rgba(255,255,255,.05); display: flex; gap: 7px; align-items: baseline; }
.live-log .ll-t { color: var(--text-dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.live-log .ll-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 图表卡片 ===== */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-top: 14px;
}
.chart-card h3 { font-size: 15.5px; margin-bottom: 12px; }
.chart-subtitle { font-size: 13px; color: var(--text-dim); margin: 14px 0 8px; }
.chart-wrap { position: relative; width: 100%; height: 380px; }
.chart-wrap.small { height: 240px; }
#mem-chart, #comp-chart { width: 100%; height: 100%; display: block; }
.chart-tooltip {
  position: absolute; pointer-events: none;
  background: rgba(10, 13, 20, .96);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  display: none; z-index: 20;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  white-space: nowrap;
}
.chart-tooltip .tt-title { font-weight: 700; margin-bottom: 3px; }
.chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; color: var(--text-dim); }
.chart-tooltip .tt-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; user-select: none; padding: 3px 8px; border-radius: 7px; border: 1px solid transparent; }
.legend-item:hover { border-color: var(--border); }
.legend-item.off { opacity: .35; }
.legend-swatch { width: 16px; height: 4px; border-radius: 2px; }
.annotations-note { font-size: 11.5px; color: var(--text-dim); margin-top: 8px; }

/* ===== Gantt ===== */
.gantt { overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: 250px 1fr; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px dashed rgba(255,255,255,.04); min-width: 760px; }
.gantt-label { font-size: 12.5px; text-align: right; color: var(--text); }
.gantt-label .g-pid { color: var(--text-dim); font-size: 11px; }
.gantt-track { position: relative; height: 22px; background: #0d1117; border-radius: 6px; border: 1px solid var(--border); }
.gantt-bar {
  position: absolute; top: 3px; height: 16px; border-radius: 4px;
  min-width: 3px; opacity: .92; cursor: pointer;
  transition: opacity .15s;
}
.gantt-bar:hover { opacity: 1; }
.gantt-bar.cat-taobao { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.gantt-bar.cat-dialog  { background: repeating-linear-gradient(45deg, #7f1d1d, #7f1d1d 6px, #991b1b 6px, #991b1b 12px); }
.gantt-bar.cat-other  { background: var(--blue); }
.gantt-bar.cat-tool   { background: var(--teal); }
.gantt-note { font-size: 11px; color: var(--text-dim); grid-column: 2; margin-top: -3px; margin-bottom: 4px; }
.gantt-now { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,85,0,.5); }

/* ===== 文件活动 ===== */
.file-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.fb-card { background: var(--bg-card2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.fb-head { display: flex; justify-content: space-between; align-items: baseline; }
.fb-stage { font-size: 13px; font-weight: 700; }
.fb-count { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.fb-bar { height: 6px; background: #0d1117; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.fb-bar-fill { height: 100%; border-radius: 3px; }
.fb-detail { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.fb-card.blocked { border-color: rgba(239,68,68,.35); }
.fb-card.blocked .fb-count { color: var(--red); }
.fb-card.success { border-color: rgba(34,197,94,.35); }
.fb-card.success .fb-count { color: var(--green); }

/* ===== 两轮对比 ===== */
.rounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.round-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.round-card .rc-name { font-size: 16px; font-weight: 700; }
.round-card .rc-time { font-size: 12.5px; color: var(--text-dim); margin: 2px 0 10px; }
.round-card .rc-result { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; }
.round-card ul { list-style: none; }
.round-card li { font-size: 13px; padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.05); }

.rootcause { border-color: rgba(239,68,68,.3); }
.chain { list-style: none; counter-reset: chain; }
.chain li {
  counter-increment: chain;
  position: relative; padding: 8px 0 8px 40px;
  font-size: 13.5px; border-bottom: 1px dashed rgba(255,255,255,.05);
}
.chain li::before {
  content: counter(chain);
  position: absolute; left: 4px; top: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(239,68,68,.15); color: var(--red);
  border: 1px solid rgba(239,68,68,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.chain li:not(:last-child)::after {
  content: "↓"; position: absolute; left: 14px; bottom: -12px; color: rgba(239,68,68,.5); font-size: 12px;
}
.fix-box {
  margin-top: 14px; padding: 12px 14px;
  background: rgba(34,197,94,.07); border: 1px solid rgba(34,197,94,.35);
  border-radius: 10px; font-size: 13.5px;
}
.fix-box b { color: var(--green); }

/* ===== 踩坑 ===== */
.pitfall-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.pitfall {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 15px;
}
.pitfall .p-title { font-size: 13.5px; font-weight: 700; color: var(--yellow); }
.pitfall .p-detail { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.limits { list-style: none; }
.limits li { font-size: 13px; color: var(--text-dim); padding: 4px 0 4px 22px; position: relative; }
.limits li::before { content: "◇"; position: absolute; left: 4px; color: var(--purple); }

footer {
  margin-top: 46px; padding: 22px 20px 30px;
  border-top: 1px solid var(--border);
  text-align: center; color: var(--text-dim); font-size: 12px;
}
footer p { margin: 3px 0; }
