/* ==========================================================================
   网络测速模块 · 样式（独立模块，仅作用于 /speedtest/ 下的页面）
   设计：与「全天电脑维修」全站一致的设计语言（深蓝 #16457c + 琥珀 #f59e0b）
        暗色默认，右上角一键切换亮色；圆角、克制阴影、商务干净。
   ========================================================================== */

/* 亮色（默认回退） */
:root {
  --hf-primary:      #16457c;
  --hf-primary-2:    #2f6fb5;
  --hf-accent:       #f59e0b;
  --hf-accent-2:     #e78a06;

  --bg:        #f5f7fa;
  --bg-soft:   #eef2f7;
  --card:      #ffffff;
  --card-2:    #f8fafc;

  --text:      #1f2937;
  --text-2:    #374151;
  --muted:     #6b7280;

  --line:      #e5e7eb;
  --line-2:    #eef2f7;
  --track:     #e5e7eb;
  --track-2:   #eef2f7;

  --good:      #10b981;
  --warn:      #f59e0b;
  --bad:       #ef4444;

  --gauge-fg:  #2f6fb5;
  --gauge-glow: rgba(47, 111, 181, .22);

  --nav-bg:    rgba(255, 255, 255, .86);
  --nav-border:#e5e7eb;
  --nav-text:  #1f2937;
  --nav-muted: #6b7280;

  --shadow:     0 1px 2px rgba(16, 24, 40, .04), 0 14px 34px -14px rgba(16, 24, 40, .18);
  --shadow-sm:  0 1px 2px rgba(16, 24, 40, .05), 0 8px 18px -12px rgba(16, 24, 40, .14);
  --radius:     14px;
  --radius-sm:  10px;

  --maxw: 1080px;
}

/* 暗色（speedtest 主页面默认） */
html.theme-dark {
  --bg:        #0e1622;
  --bg-soft:   #101b2b;
  --card:      #16202e;
  --card-2:    #1b2738;

  --text:      #e8eef6;
  --text-2:    #c3cde0;
  --muted:     #8a98ad;

  --line:      #243140;
  --line-2:    #1c2837;
  --track:     #223044;
  --track-2:   #1b2738;

  --good:      #34d399;
  --warn:      #fbbf24;
  --bad:       #f87171;

  --gauge-fg:  #4dabf7;
  --gauge-glow: rgba(77, 171, 247, .30);

  --nav-bg:    rgba(14, 22, 34, .82);
  --nav-border:#243140;
  --nav-text:  #e8eef6;
  --nav-muted: #8a98ad;

  --shadow:     0 1px 2px rgba(0, 0, 0, .30), 0 18px 40px -18px rgba(0, 0, 0, .60);
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, .30), 0 8px 20px -14px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

a { color: var(--hf-primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px 56px; }
.hidden { display: none !important; }
/* 仅供搜索引擎 / 读屏软件读取，不占首屏版面 */
.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; border: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ----------------------------------------------------------- 顶部导航 */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
}
.nav__in {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; color: var(--nav-text); flex: 0 0 auto; }
.nav__brand:hover { text-decoration: none; }
.nav__logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--hf-accent), var(--hf-accent-2));
  color: #fff; font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -8px rgba(245, 158, 11, .9);
}
.nav__name { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.nav__menu { display: flex; gap: 4px; margin-left: auto; flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.nav__menu::-webkit-scrollbar { display: none; }
.nav__menu a {
  color: var(--nav-muted); font-size: 13.5px;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
  transition: all .16s ease;
}
.nav__menu a:hover { color: var(--nav-text); background: var(--card-2); text-decoration: none; }
.nav__menu a.is-active {
  color: var(--hf-primary-2);
  background: var(--card-2);
  font-weight: 700;
}
html.theme-dark .nav__menu a.is-active { color: var(--gauge-fg); }
.nav__theme {
  margin-left: 8px; flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--nav-border); background: var(--card);
  color: var(--nav-text); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s ease;
}
.nav__theme:hover { border-color: var(--hf-primary-2); }
.nav__share {
  margin-left: 8px; flex: 0 0 auto;
  height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--nav-border); background: var(--card);
  color: var(--nav-text); font-size: 13.5px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 6px; font-family: inherit; white-space: nowrap;
  transition: all .18s ease;
}
.nav__share:hover { border-color: var(--hf-primary-2); color: var(--hf-primary-2); }

/* ----------------------------------------------------------- 标题区 */
.hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 18px; padding: 22px 22px 24px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--hf-primary), var(--hf-primary-2) 55%, var(--hf-accent));
}
.hero__title { margin: 4px 0 6px; font-size: 22px; font-weight: 800; letter-spacing: .2px; }
.hero__sep { color: var(--hf-accent); margin: 0 4px; }
.hero__desc { margin: 0; font-size: 13.5px; color: var(--muted); max-width: 720px; }

/* ----------------------------------------------------------- 测速主区 */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 16px; padding: 20px 22px 24px;
}
.panel__opts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.modes { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: var(--card-2); color: var(--text-2);
  border-radius: 999px; padding: 9px 16px; font-size: 14px; cursor: pointer;
  transition: all .18s ease; font-family: inherit; min-height: 40px;
}
.tab:hover { border-color: var(--hf-primary-2); }
.tab.is-on {
  background: linear-gradient(135deg, var(--hf-primary), var(--hf-primary-2));
  border-color: transparent; color: #fff; font-weight: 700;
  box-shadow: 0 8px 20px -10px rgba(22, 69, 124, .9);
}
.isps { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.chip {
  border: 1px solid var(--line); background: var(--card-2); color: var(--text-2);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; min-height: 36px; transition: all .16s ease;
}
.chip:hover { border-color: var(--hf-primary-2); }
.chip.is-on { background: color-mix(in srgb, var(--hf-primary-2) 14%, transparent); border-color: var(--hf-primary-2); color: var(--hf-primary-2); font-weight: 700; }
.panel__note {
  font-size: 12.5px; color: var(--muted);
  background: var(--card-2); border: 1px dashed var(--line);
  border-radius: 12px; padding: 9px 12px; margin: 14px 0 6px;
}

/* ============================================================
   左右分栏工作台
   左栏 = 主要测试项（综合评分 + 5 张核心指标卡 + 操作入口）
   右栏 = 当前电脑环境 + 测试流程 + 实时仪表 + 诊断报告 + 游戏延迟
   ============================================================ */
.workbench {
  display: grid; grid-template-columns: minmax(252px, 308px) 1fr;
  gap: 18px; margin-top: 14px; align-items: start;
}
.wb-side {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 14px 15px;
  position: sticky; top: 72px;
}
.wb-side__t {
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: .6px; text-transform: uppercase; margin-bottom: 6px;
}
.wb-side__d { font-size: 12px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
/* .actions--side 的规则已移至基类之后：见文件后段「层叠顺序修正」 */
.wb-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.wb-main .gauge { padding: 4px 0; }
.wb-main > .report,
.wb-main > .games { margin-top: 0; }
.wb-main .rpt { margin-top: 0; }
.wb-main .games--top { margin-top: 0; }

/* ---------------------------------------------- 左栏：综合评分徽章 */
.side-score:empty { display: none; }
.side-score { margin-bottom: 12px; }
.side-score .sband { padding: 11px 12px; gap: 11px; }
.side-score .sband__ring { width: 50px; height: 50px; }
.side-score .sband__num { font-size: 18px; }
.side-score .sband__cap { font-size: 9.5px; }
.side-score .sband__grade { font-size: 14px; }
.side-score .sband__sub { font-size: 11.5px; line-height: 1.5; }

/* ---------------------------------------------- 左栏：5 张核心指标卡（单列） */
/* .cards--side 的规则已移至基类之后：见文件后段「层叠顺序修正」 */

/* 卡片四态：待测 / 测试中 / 正常·一般·较差（由 app.js 动态写入 class） */
.rcard__status.status--idle { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.rcard__status.status--run  { color: var(--hf-accent); background: color-mix(in srgb, var(--hf-accent) 16%, transparent); }
.rcard__fill.status--idle { background: var(--track); }
.rcard__fill.status--run  { background: linear-gradient(90deg, color-mix(in srgb, var(--hf-accent) 65%, transparent), var(--hf-accent)); }
.rcard.is-running { border-color: color-mix(in srgb, var(--hf-accent) 45%, var(--line)); }
.rcard.is-running .rcard__val { color: var(--hf-accent); }

/* ---------------------------------------------- 右栏①：当前电脑环境条 */
.env {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card-2); padding: 11px 14px 12px;
}
.env__head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.env__t { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
.env__badge {
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  color: var(--hf-accent); background: color-mix(in srgb, var(--hf-accent) 15%, transparent);
}
.env__badge.is-ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.env__badge.is-fail { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.env__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 9px 14px; }
.env__i { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.env__k { font-size: 11.5px; color: var(--muted); }
.env__v { font-size: 14px; font-weight: 650; color: var(--text); overflow-wrap: anywhere; }
.env__v--mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; letter-spacing: .2px; }
.env__note { font-size: 11.5px; color: var(--muted); margin: 9px 0 0; line-height: 1.55; }
.env__note:empty { display: none; }

/* ---------------------------------------------- 右栏②：测试流程（横向 6 步） */
.flow { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); padding: 10px 12px 8px; }
.flow__t { display: block; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; margin: 0 0 8px 2px; }
/* .steps--flow 的规则已移至基类之后：见文件后段「层叠顺序修正」 */

/* 环形仪表 + 大数字 + 速率曲线 */
.gauge { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; padding: 8px 0 4px; }
.gauge__ring { position: relative; width: 220px; height: 220px; flex: 0 0 auto; }
.gauge__ring svg { display: block; }
.gauge__track { stroke: var(--track); }
#ringFg {
  stroke: var(--gauge-fg);
  stroke-dasharray: 376.99;   /* 2π·60，与 app.js RING_CIRC 一致 */
  filter: drop-shadow(0 0 6px var(--gauge-glow));
  transition: stroke-dashoffset .25s ease;
}
.gauge__center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none; text-align: center;
}
.gauge__num {
  font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.gauge__unit { font-size: 13px; color: var(--muted); margin-top: 8px; font-weight: 500; }

.gauge__curve { width: 300px; max-width: 100%; flex: 1 1 280px; min-width: 240px; }
#spark { width: 100%; height: 96px; display: block; }
.spark__area { fill: color-mix(in srgb, var(--gauge-fg) 16%, transparent); stroke: none; }
.spark__line { fill: none; stroke: var(--gauge-fg); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.gauge__phase { margin-top: 10px; font-size: 14px; color: var(--text-2); min-height: 22px; text-align: center; }
.gauge__phase .phase__hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* 巨型开始按钮 */
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.btn-start {
  font-family: inherit; font-size: 17px; font-weight: 700;
  border: 0; border-radius: 999px; cursor: pointer;
  padding: 16px 52px; min-height: 56px; color: #fff;
  background: linear-gradient(135deg, var(--hf-primary), var(--hf-primary-2) 60%, var(--hf-accent));
  box-shadow: 0 14px 30px -12px rgba(22, 69, 124, .85);
  transition: transform .16s ease, filter .16s ease;
}
.btn-start:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-start:active { transform: translateY(0); }
.btn-start:disabled { opacity: .55; cursor: not-allowed; filter: none; transform: none; }
.btn-again {
  font-family: inherit; font-size: 15px; font-weight: 600;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  padding: 14px 30px; min-height: 52px; color: var(--text-2); background: var(--card-2);
  transition: all .16s ease;
}
.btn-again:hover { border-color: var(--hf-primary-2); color: var(--hf-primary-2); }

/* ============================================================
   左栏主操作入口「开始测试」（修饰类必须位于 .actions 基类之后）
   目标：打开页面第一眼即可发现 —— 置于左栏最上方，
        加大尺寸 + 播放图标 + 琥珀色呼吸光晕，形成明确视觉焦点
   ============================================================ */
.actions--side { margin: 0 0 14px; flex-direction: column; gap: 8px; }
.actions--side .btn-start {
  width: 100%; padding: 16px 20px; font-size: 17.5px; min-height: 58px;
  letter-spacing: .5px; display: inline-flex; align-items: center; justify-content: center;
}
/* 播放图标：纯 CSS 三角形，跟随文字颜色 */
.actions--side .btn-start::before {
  content: ""; display: inline-block; width: 0; height: 0;
  border-left: 11px solid currentColor;
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
  margin-right: 10px;
}
/* 呼吸光晕：仅在按钮可用（可点击）时出现，禁用/测速中自动停止 */
.actions--side .btn-start:not(:disabled) { animation: st-cta 2.4s ease-in-out infinite; }
.actions--side .btn-start:hover {
  animation: none;
  box-shadow: 0 14px 30px -12px rgba(22, 69, 124, .85), 0 0 0 5px rgba(245, 158, 11, .35);
}
.actions--side .btn-start:disabled { animation: none; }
.actions--side .btn-again { width: 100%; padding: 11px 18px; min-height: 44px; }
@keyframes st-cta {
  0%, 100% { box-shadow: 0 14px 30px -12px rgba(22, 69, 124, .85), 0 0 0 0 rgba(245, 158, 11, .55); }
  55%      { box-shadow: 0 14px 30px -12px rgba(22, 69, 124, .85), 0 0 0 14px rgba(245, 158, 11, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .actions--side .btn-start:not(:disabled) { animation: none; }
}

/* 错误提示 */
.errbox {
  margin-top: 14px; background: color-mix(in srgb, var(--bad) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent);
  color: var(--bad); border-radius: 12px; padding: 12px 14px; font-size: 13.5px;
}

/* 步骤进度 */
.steps { list-style: none; margin: 18px 0 0; padding: 14px 16px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); }
.step { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; color: var(--muted); }
.step__dot {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line);
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: transparent; background: var(--card);
}
.step.is-run { color: var(--text); }
.step.is-run .step__dot { border-color: var(--hf-primary-2); }
.step.is-run .step__dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hf-primary-2); animation: st-pulse 1s ease-in-out infinite; }
.step.is-done { color: var(--text-2); }
.step.is-done .step__dot { border-color: var(--good); background: var(--good); color: #fff; }
.step.is-done .step__dot::after { content: "✓"; }
@keyframes st-pulse { 0%, 100% { opacity: .35; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }

/* 横向流程条（修饰类必须位于 .steps 基类之后） */
.steps--flow {
  list-style: none; display: flex; align-items: flex-start;
  margin: 0; padding: 0 2px 2px; background: transparent; border: 0; border-radius: 0;
}
.steps--flow .step {
  flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; padding: 0 3px; position: relative; font-size: 12px; line-height: 1.35;
}
.steps--flow .step__dot { width: 22px; height: 22px; z-index: 1; }
.steps--flow .step::before,
.steps--flow .step::after {
  content: ""; position: absolute; top: 10px; height: 2px; width: calc(50% - 14px);
  background: var(--line); border-radius: 2px;
}
.steps--flow .step::before { left: 0; }
.steps--flow .step::after  { right: 0; }
.steps--flow .step:first-child::before,
.steps--flow .step:last-child::after { display: none; }
.steps--flow .step.is-done::before { background: var(--good); }
.steps--flow .step.is-run::before  { background: color-mix(in srgb, var(--hf-primary-2) 60%, var(--line)); }
.steps--flow .step.is-done { color: var(--text-2); }
.steps--flow .step.is-run  { color: var(--text); font-weight: 650; }

/* ----------------------------------------------------------- 结果区 */
/* 综合评分徽章（左栏「主要测试项」面板顶部；由 app.js renderScoreBand 填充） */
.sband {
  display: flex; align-items: center; gap: 14px; flex: 1 1 auto;
  border-radius: var(--radius-sm); padding: 12px 16px;
  border: 1px solid var(--line); background: var(--card-2);
}
.sband__ring {
  width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 1px;
  background: conic-gradient(var(--sc) calc(var(--p, 64) * 1%), var(--track) 0);
}
.sband__num { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1; }
.sband__cap { font-size: 10px; color: var(--muted); }
.sband__grade { font-size: 15px; font-weight: 700; color: var(--text); }
.sband__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* 5 张指标卡片 */
.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.rcard {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 13px;
  display: flex; flex-direction: column; gap: 8px;
}
.rcard__top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rcard__label { font-size: 13px; color: var(--muted); font-weight: 600; }
.rcard__status {
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; line-height: 1.4;
}
.rcard__status.status--good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.rcard__status.status--warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.rcard__status.status--bad  { color: var(--bad);  background: color-mix(in srgb, var(--bad) 14%, transparent); }
.rcard__val { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.4px; color: var(--text); line-height: 1.1; }
.rcard__val i { font-size: 12px; font-style: normal; color: var(--muted); font-weight: 500; margin-left: 3px; }
.rcard__note { font-size: 11.5px; color: var(--muted); }
.rcard__bar { height: 7px; background: var(--track); border-radius: 999px; overflow: hidden; margin-top: 2px; }
.rcard__fill { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .9s cubic-bezier(.22, .9, .24, 1); }
.rcard__fill.status--good { background: linear-gradient(90deg, color-mix(in srgb, var(--good) 70%, #000 0%), var(--good)); }
.rcard__fill.status--warn { background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 70%, #000 0%), var(--warn)); }
.rcard__fill.status--bad  { background: linear-gradient(90deg, color-mix(in srgb, var(--bad) 70%, #000 0%), var(--bad)); }

/* 左栏 5 张核心指标卡（单列）—— 必须位于 .cards 基类之后 */
.cards--side { grid-template-columns: 1fr; gap: 9px; }
.cards--side .rcard { padding: 11px 12px; gap: 6px; }
.cards--side .rcard__val { font-size: 21px; }
.cards--side .rcard__note { display: none; }   /* 窄栏省纵向空间，状态徽章已表达优劣 */

/* ----------------------------------------------------------- 报告区 */
.rpt { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 18px; padding: 22px 20px 24px; }
.rpt__head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.score-ring { position: relative; width: 130px; height: 130px; flex: 0 0 auto; }
.score-ring svg { transform: rotate(-90deg); display: block; }
.score-ring__track { stroke: var(--track); }
.score-ring__in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring__num { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text); }
.score-ring__cap { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.rpt__summary { flex: 1 1 260px; min-width: 220px; }
/* 主页面嵌入形态：不显示评分环与等级胶囊（分数已在左栏呈现），结论段独占整行 */
.rpt__head--flat .rpt__summary { flex: 1 1 100%; min-width: 0; text-align: left; }
@media (max-width: 760px) { .rpt__head--flat .rpt__summary { text-align: center; } }
.grade-pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 6px 16px 6px 10px; font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--gc, var(--hf-primary)); background: color-mix(in srgb, var(--gc, var(--hf-primary)) 14%, transparent); }
.grade-pill__b { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; background: var(--gc, var(--hf-primary)); }
.grade--S { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.grade--S .grade-pill__b { background: linear-gradient(135deg, #059669, var(--good)); }
.grade--A { background: color-mix(in srgb, var(--hf-primary-2) 16%, transparent); color: var(--hf-primary-2); }
.grade--A .grade-pill__b { background: linear-gradient(135deg, var(--hf-primary), var(--hf-primary-2)); }
.grade--B { background: color-mix(in srgb, var(--hf-accent) 16%, transparent); color: var(--hf-accent-2); }
.grade--B .grade-pill__b { background: linear-gradient(135deg, var(--hf-accent-2), var(--hf-accent)); }
.grade--C { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.grade--C .grade-pill__b { background: linear-gradient(135deg, var(--warn), var(--hf-accent)); }
.grade--D { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.grade--D .grade-pill__b { background: linear-gradient(135deg, #dc2626, var(--bad)); }
.rpt__headline { font-size: 19px; font-weight: 750; margin: 0 0 6px; color: var(--text); }
.rpt__sub { font-size: 13px; color: var(--muted); margin: 0; }
.rpt__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag { font-size: 12px; color: var(--text-2); background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
.rpt__h { font-size: 15px; font-weight: 750; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.rpt__h::before { content: ""; width: 4px; height: 15px; border-radius: 2px; background: linear-gradient(180deg, var(--hf-primary-2), var(--hf-primary)); }

/* 维度条 */
.dims { display: grid; gap: 12px; }
.dim { display: grid; grid-template-columns: 92px 1fr 108px; align-items: center; gap: 12px; }
.dim__name { font-size: 13.5px; color: var(--text-2); }
.dim__bar { position: relative; height: 10px; background: var(--track); border-radius: 999px; overflow: hidden; }
.dim__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--hf-primary-2), var(--hf-primary)); transition: width .9s cubic-bezier(.22, .9, .24, 1); }
.dim__fill.is-warn { background: linear-gradient(90deg, #fbbf24, var(--warn)); }
.dim__fill.is-bad  { background: linear-gradient(90deg, #f87171, var(--bad)); }
.dim__mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted); border-radius: 2px; }
.dim__mark::after { content: "参考"; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.dim__val { text-align: right; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.dim__val small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }

/* 能力清单 */
.caps { display: flex; flex-wrap: wrap; gap: 9px; }
.cap { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); color: var(--text-2); }
.cap.is-ok { background: color-mix(in srgb, var(--good) 12%, transparent); border-color: color-mix(in srgb, var(--good) 36%, transparent); color: var(--good); }
.cap.is-no { background: var(--card-2); border-color: var(--line); color: var(--muted); }
.cap__ico { font-weight: 800; }
.cap.is-ok .cap__ico { color: var(--good); }
.cap.is-no .cap__ico { color: var(--muted); }

/* 建议 */
.adv { display: grid; gap: 10px; }
.adv__item { display: flex; gap: 12px; padding: 13px 15px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); border-left-width: 4px; }
.adv__item.lv-good { border-left-color: var(--good); }
.adv__item.lv-warn { border-left-color: var(--warn); }
.adv__item.lv-bad  { border-left-color: var(--bad); }
.adv__ico { font-size: 17px; line-height: 1.3; flex: 0 0 auto; }
.adv__t { font-size: 14px; font-weight: 700; margin: 0 0 3px; color: var(--text); }
.adv__d { font-size: 13px; color: var(--text-2); margin: 0; line-height: 1.6; }

/* 游戏延迟表 */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.gt { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
table.gt th, table.gt td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.gt th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--card-2); }
table.gt tbody tr:last-child td { border-bottom: 0; }
table.gt td.num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.pill { display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.pill--good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.pill--warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill--bad  { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pill--mute { background: var(--card-2); color: var(--muted); }

/* ----------------------------------------------------------- 游戏浏览区（按厂商分组） */
.gbrowse {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-top: 16px; padding: 14px 16px 16px;
}
.gbrowse__head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.gbrowse__head > div:first-child { flex: 1 1 320px; min-width: 0; }
.gbrowse__t { font-size: 16px; font-weight: 750; margin: 0; color: var(--text); }
.gbrowse__d { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.gsearch { flex: 0 0 240px; }
.gsearch input {
  width: 100%; box-sizing: border-box;
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 13px; outline: none;
  transition: border-color .16s ease;
}
.gsearch input:focus { border-color: var(--hf-primary-2); }
.gsearch input::placeholder { color: var(--muted); }
/* 厂商 chips 可达 140+ 组：默认只出热门厂商，其余靠「更多厂商」/关键词展开，区域限高内滚动 */
.gcompanies {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px; max-height: 108px; overflow-y: auto;
  padding: 2px 4px 2px 0; scrollbar-width: thin;
}
.gcompanies .chip { display: inline-flex; align-items: center; gap: 6px; }
/* 分组标签（热门厂商 / 匹配厂商） */
.glabel { font-size: 12px; color: var(--muted); align-self: center; }
/* 「更多厂商 / 收起」按钮：虚线弱化，区别于可选中的厂商 chip */
.chip--more { border-style: dashed; color: var(--hf-primary-2); font-weight: 600; }
/* 游戏清单统计行：占满整行，说明当前显示的是「热门 / 匹配 / 某厂商」的结果 */
.gstat { grid-column: 1 / -1; font-size: 12px; color: var(--muted); padding: 0 2px 2px; }
.chip__n {
  font-size: 11px; font-weight: 700; font-style: normal;
  background: var(--track); color: var(--muted);
  border-radius: 999px; padding: 1px 7px; line-height: 1.5;
  min-width: 18px; text-align: center;
}
.chip.is-on .chip__n { background: color-mix(in srgb, var(--hf-primary-2) 22%, transparent); color: var(--hf-primary-2); }
.glist {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px;
  /* 限高 = 3 整行条目高（真实数据实测单条 82px：3×82 + 2×8 间距 = 262），
     保证「点击即测速」新增的状态行不减少可见行数 */
  max-height: 262px; overflow-y: auto; padding: 2px 4px 2px 0;
  scrollbar-width: thin;
}
.gitem {
  border: 1px solid var(--line); background: var(--card-2);
  border-radius: var(--radius-sm); padding: 9px 11px;
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color .16s ease, transform .16s ease;
}
.gitem:hover { border-color: var(--hf-primary-2); transform: translateY(-1px); }
.gitem__name { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.4; }
.gitem__meta { font-size: 11px; color: var(--muted); line-height: 1.5; }
.glist__empty { grid-column: 1 / -1; font-size: 13px; color: var(--muted); padding: 18px 0; text-align: center; }

/* --- 清单条目「点击即测速」交互态 ---
   .gitem 是 <button>：清掉浏览器默认按钮样式，只保留卡片外观，使整块可点 */
button.gitem {
  font-family: inherit; text-align: left; width: 100%;
  line-height: inherit;   /* 复位 button 默认 line-height:normal，保持与改造前一致 */
  cursor: pointer; -webkit-appearance: none; appearance: none;
}
button.gitem:focus-visible { outline: 2px solid var(--hf-primary-2); outline-offset: 2px; }
/* 右下角状态区：未测「点击测速 ›」/ 测速中 / 已测「23ms 优秀 重测 ›」 */
.gitem__res {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: 2px; min-height: 16px;
}
.gitem__go { font-size: 11px; font-weight: 600; color: var(--hf-primary-2); margin-left: auto; white-space: nowrap; }
button.gitem:hover .gitem__go { text-decoration: underline; }
.gitem.is-testing { border-color: var(--hf-accent); }
.gitem.is-done { border-color: color-mix(in srgb, var(--good) 34%, var(--line)); }
.gitem__ms { font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.gitem__ms i { font-size: 10px; font-weight: 600; font-style: normal; margin-left: 1px; }
.gitem__ms.is-good { color: var(--good); }
.gitem__ms.is-warn { color: var(--warn); }
.gitem__ms.is-bad  { color: var(--bad); }
.gitem__ms.is-mute { color: var(--muted); font-size: 12.5px; }
.gitem__tag {
  font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px; line-height: 1.6;
}
.gitem__tag.is-good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.gitem__tag.is-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.gitem__tag.is-bad  { color: var(--bad);  background: color-mix(in srgb, var(--bad) 14%, transparent); }
.gitem__tag.is-mute { color: var(--muted); background: var(--track); }
.gitem__testing { font-size: 11.5px; color: var(--hf-accent); font-weight: 600; }
.gitem__spin {
  width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--hf-accent) 30%, transparent);
  border-top-color: var(--hf-accent);
  animation: st-spin .7s linear infinite;
}
@keyframes st-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gitem__spin { animation-duration: 1.6s; } }

/* 游戏模式：结果置顶区（与底部 .games 共用基础样式） */
.games--top { margin-top: 16px; }

/* 游戏结果·厂商分组 chips（「热门游戏官方服务器延迟」分区内） */
.grp-chips {
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
  margin-bottom: 12px; padding: 10px 12px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
/* 结果区查询行：关键词输入 + 全部结果 */
.grp-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grp-search__input {
  flex: 0 1 280px; min-width: 170px; height: 32px; padding: 0 10px;
  font-size: 12.5px; font-family: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; outline: none;
}
.grp-search__input::placeholder { color: var(--muted); }
.grp-search__input:focus { border-color: var(--hf-primary-2); }
/* 命中项区：146 家厂商可能命中较多，限高内滚动，不撑高结果区 */
.grp-hits {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  max-height: 108px; overflow-y: auto; scrollbar-width: thin;
}
.grp-tip { font-size: 12.5px; color: var(--muted); }
.chip--game .chip__n { font-weight: 500; opacity: .7; }
.grp-chips__t { font-size: 12.5px; color: var(--muted); margin-right: 2px; }
.grp-chips .chip { padding: 6px 12px; font-size: 12.5px; min-height: 32px; }
.grp-hint { font-size: 12px; color: var(--muted); padding: 2px 0 8px; }

/* ----------------------------------------------------------- 分享区 */
.share { margin-top: 18px; background: linear-gradient(135deg, #0f1c2e, #16304f 55%, #12203a); border-radius: var(--radius); padding: 20px; color: #e8eefc; }
.share__t { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.share__d { font-size: 12.5px; color: #9fb0cc; margin: 0 0 14px; }
.share__row { display: flex; gap: 10px; flex-wrap: wrap; }
.share__link { flex: 1 1 260px; min-width: 0; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; padding: 11px 14px; font-size: 12.5px; color: #cfe0ff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn--share { background: #fff; color: #16304f; border: 0; border-radius: 10px; padding: 11px 20px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; min-height: 42px; }
.btn--share:hover { background: #eef4ff; }
.btn--share-ghost { background: rgba(255, 255, 255, .1); color: #e8eefc; border: 1px solid rgba(255, 255, 255, .2); border-radius: 10px; padding: 11px 18px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; min-height: 42px; }
.btn--share-ghost:hover { background: rgba(255, 255, 255, .17); }
.share__tip { font-size: 12px; color: #8fa3c4; margin: 12px 0 0; line-height: 1.6; }

/* ----------------------------------------------------------- 说明 / 页脚 / 提示 */
.hint { font-size: 12.5px; color: var(--muted); background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; margin-top: 14px; line-height: 1.7; }
.foot { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 26px; line-height: 1.9; }
.foot a { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 14px); background: rgba(15, 23, 42, .94); color: #fff; font-size: 13.5px; padding: 11px 20px; border-radius: 999px; opacity: 0; pointer-events: none; transition: all .24s ease; z-index: 60; max-width: 86vw; text-align: center; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.skeleton { color: var(--muted); font-size: 13.5px; padding: 26px 0; text-align: center; }

/* ----------------------------------------------------------- 响应式 */
@media (max-width: 900px) {
  /* 分栏堆叠：左栏（测试项）在上、右栏（流程/报告）在下 */
  .workbench { grid-template-columns: 1fr; gap: 14px; }
  .wb-side { position: static; }
  /* 堆叠后左栏变整宽 ⇒ 指标卡改为自适应多列，恢复辅助说明文字 */
  .cards--side { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .cards--side .rcard__note { display: block; }
}
@media (max-width: 820px) {
  .gauge { gap: 16px; }
  .cards--side { grid-template-columns: repeat(2, 1fr); }
  .cards--side .rcard:nth-child(5) { grid-column: span 2; }
}
@media (max-width: 760px) {
  .panel__opts { flex-direction: column; align-items: flex-start; }
  .isps { margin-left: 0; }
  .gauge__curve { min-width: 0; }
  .dim { grid-template-columns: 74px 1fr 84px; gap: 9px; }
  .dim__name { font-size: 12.5px; }
  .rpt { padding: 18px 15px 20px; }
  .rpt__head { gap: 14px; justify-content: center; }
  .rpt__summary { text-align: center; }
  .rpt__meta { justify-content: center; }
  .score-ring { width: 116px; height: 116px; }
  .score-ring__num { font-size: 30px; }
  /* 横向流程条：窄屏折行，去掉连接线避免错位 */
  .steps--flow { flex-wrap: wrap; row-gap: 10px; }
  .steps--flow .step { flex: 1 1 30%; }
  .steps--flow .step::before,
  .steps--flow .step::after { display: none; }
  .env__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .nav__name { display: none; }
  .nav__share { display: none; }
  .nav__menu a { padding: 7px 10px; font-size: 12.5px; }
  .hero { padding: 18px 16px 20px; }
  .hero__title { font-size: 19px; }
  .panel { padding: 16px 15px 20px; }
  .gauge__ring { width: 190px; height: 190px; }
  .gauge__num { font-size: 40px; }
  .btn-start { width: 100%; max-width: none; }
  .steps--flow .step { flex: 1 1 45%; }
}
@media (max-width: 420px) {
  .cards--side { grid-template-columns: 1fr; }
  .cards--side .rcard:nth-child(5) { grid-column: auto; }
  .tab { padding: 8px 13px; font-size: 13px; }
  .env__grid { grid-template-columns: 1fr; }
}
