/* ============================================================
   #21 帧率计数器 · 电竞计分板 / 蓝白 HUD
   前缀 fps- · 冰蓝底 + 电光蓝 + 荧光绿，浅色默认深色整套覆盖
   ============================================================ */
.fps-page, .fps-toast {
    --fps-bg: #f5f8ff;
    --fps-bg2: #e9effc;
    --fps-panel: #ffffff;
    --fps-panel2: #f8faff;
    --fps-ink: #101a36;
    --fps-sub: #5c6a8c;
    --fps-line: #dbe4f7;
    --fps-line2: #c4d2ee;
    --fps-brand: #2451d6;
    --fps-brand-deep: #173aa5;
    --fps-brand-soft: #e7eeff;
    --fps-good: #009e6c;
    --fps-good-soft: #dff7ec;
    --fps-warn: #d95c0b;
    --fps-warn-soft: #fff0e2;
    --fps-chart: #f2f6ff;
    --fps-shadow: 0 14px 34px rgba(27, 52, 120, .10);
    --fps-shadow-sm: 0 3px 12px rgba(27, 52, 120, .07);
    --fps-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
:root[data-theme="dark"] .fps-page, :root[data-theme="dark"] .fps-toast {
    --fps-bg: #0a1020;
    --fps-bg2: #101a31;
    --fps-panel: #121d35;
    --fps-panel2: #182645;
    --fps-ink: #e8eeff;
    --fps-sub: #96a6ca;
    --fps-line: #27365c;
    --fps-line2: #354878;
    --fps-brand: #7fa5ff;
    --fps-brand-deep: #a9c2ff;
    --fps-brand-soft: #1b2c55;
    --fps-good: #43dfa7;
    --fps-good-soft: #123a30;
    --fps-warn: #ffab6b;
    --fps-warn-soft: #3a2718;
    --fps-chart: #0e1830;
    --fps-shadow: 0 14px 34px rgba(0, 0, 0, .34);
    --fps-shadow-sm: 0 3px 12px rgba(0, 0, 0, .26);
}
.fps-page {
    background: var(--fps-bg); color: var(--fps-ink); padding: 0 0 56px; min-height: 60vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px; line-height: 1.75;
}
.fps-wrap { max-width: 1140px; margin: 0 auto; padding: 18px 16px 0; }
.fps-page .detail-breadcrumb { font-size: 13px; color: var(--fps-sub); margin: 10px 0 18px; }
.fps-page .detail-breadcrumb a { color: var(--fps-sub); text-decoration: none; }
.fps-page .detail-breadcrumb a:hover { color: var(--fps-brand); }
.fps-page .detail-breadcrumb .current { color: var(--fps-brand); font-weight: 700; }
.fps-page .detail-breadcrumb .sep { margin: 0 8px; opacity: .6; }

/* ---------- 首屏 ---------- */
.fps-hero { display: grid; grid-template-columns: 1.12fr .88fr; gap: 26px; align-items: stretch; margin-bottom: 24px; }
.fps-hero > * { min-width: 0; }
.fps-tag {
    display: inline-block; font: 700 11px var(--fps-mono); letter-spacing: 1.5px;
    color: var(--fps-brand); background: var(--fps-brand-soft);
    border: 1px solid var(--fps-line2); border-radius: 20px; padding: 6px 14px; margin-bottom: 14px;
}
.fps-page h1 { font-size: 35px; line-height: 1.22; font-weight: 800; margin: 0 0 14px; }
.fps-sub { font-size: 15px; line-height: 1.95; color: var(--fps-sub); margin: 0 0 20px; max-width: 620px; }
.fps-sub b { color: var(--fps-ink); }
.fps-cta { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.fps-btn {
    border: 1px solid var(--fps-line2); background: var(--fps-panel); color: var(--fps-ink);
    border-radius: 8px; padding: 10px 17px; font-size: 14px; font-weight: 650; cursor: pointer;
    transition: transform .12s, box-shadow .12s, background .12s; font-family: inherit;
}
.fps-btn:hover { transform: translateY(-1px); box-shadow: var(--fps-shadow-sm); }
.fps-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.fps-btn-main { background: var(--fps-brand); border-color: var(--fps-brand-deep); color: #fff; box-shadow: 0 5px 16px rgba(36, 81, 214, .25); }
.fps-btn-main:hover { background: var(--fps-brand-deep); }
.fps-btn-ghost { background: transparent; }
.fps-hero-note { font-size: 12.5px; color: var(--fps-sub); line-height: 1.85; border-left: 3px solid var(--fps-good); padding-left: 11px; }
.fps-hero-note b { color: var(--fps-ink); }

/* ---------- HUD 表盘 ---------- */
.fps-hud {
    background: linear-gradient(150deg, var(--fps-panel), var(--fps-panel2));
    border: 1px solid var(--fps-line2); border-radius: 16px; box-shadow: var(--fps-shadow);
    padding: 16px 18px; display: flex; flex-direction: column; justify-content: space-between;
}
.fps-hud-top { display: flex; justify-content: space-between; align-items: center; font: 700 11px var(--fps-mono); letter-spacing: 1.5px; color: var(--fps-sub); }
.fps-hud-top b { color: var(--fps-good); background: var(--fps-good-soft); border-radius: 20px; padding: 3px 12px; letter-spacing: 0; }
.fps-dial { display: flex; justify-content: center; padding: 8px 0; }
.fps-ring {
    width: 188px; height: 188px; border-radius: 50%; padding: 13px;
    background: conic-gradient(var(--fps-brand) 0deg, var(--fps-good) var(--fps-deg, 0deg), var(--fps-bg2) var(--fps-deg, 0deg) 360deg);
    box-shadow: 0 0 0 1px var(--fps-line), inset 0 0 22px rgba(36, 81, 214, .10);
}
.fps-ring-in {
    width: 100%; height: 100%; border-radius: 50%; background: var(--fps-panel);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.fps-ring-in b { font: 800 54px/1 var(--fps-mono); color: var(--fps-brand); }
.fps-ring-in span { font: 700 12px var(--fps-mono); letter-spacing: 2px; color: var(--fps-sub); margin-top: 6px; }
.fps-hud-foot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fps-hud-foot > div { text-align: center; border-top: 1px solid var(--fps-line); padding-top: 9px; min-width: 0; }
.fps-hud-foot span { display: block; font-size: 11px; color: var(--fps-sub); }
.fps-hud-foot b { display: block; font: 700 12.5px/1.6 var(--fps-mono); color: var(--fps-ink); word-break: break-all; }

/* ---------- 区块 ---------- */
.fps-section {
    background: var(--fps-panel); border: 1px solid var(--fps-line); border-radius: 14px;
    box-shadow: var(--fps-shadow-sm); padding: 20px; margin-bottom: 20px;
}
.fps-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.fps-page h2 { font-size: 19px; margin: 0; font-weight: 800; }
.fps-page h2::before { content: ''; display: inline-block; width: 14px; height: 4px; background: var(--fps-brand); border-radius: 2px; margin-right: 9px; vertical-align: 4px; }
.fps-sec-sub { font: 11.5px var(--fps-mono); color: var(--fps-sub); }
.fps-chart-box { background: var(--fps-chart); border: 1px solid var(--fps-line); border-radius: 10px; padding: 8px; }
#fpsChart { display: block; width: 100%; height: 210px; }
.fps-chart-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 11.5px; color: var(--fps-sub); margin-top: 9px; }
.fps-lg { display: inline-block; width: 16px; height: 3px; vertical-align: 3px; margin-right: 5px; border-radius: 2px; }
.fps-lg-line { background: var(--fps-brand); }
.fps-lg-target { background: var(--fps-good); }
.fps-lg-bad { background: var(--fps-warn); }

/* ---------- 控制与动画舞台 ---------- */
.fps-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.fps-ctrl { min-width: 0; }
.fps-ctrl label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 7px; }
.fps-seg { display: flex; flex-wrap: wrap; gap: 5px; }
.fps-seg button {
    border: 1px solid var(--fps-line2); background: var(--fps-panel2); color: var(--fps-sub);
    border-radius: 6px; padding: 7px 10px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.fps-seg button.is-on { border-color: var(--fps-brand); background: var(--fps-brand-soft); color: var(--fps-brand-deep); font-weight: 700; }
.fps-select {
    width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--fps-line2);
    border-radius: 7px; background: var(--fps-panel2); color: var(--fps-ink); font-size: 13px; font-family: inherit;
}
.fps-stage {
    position: relative; height: 108px; overflow: hidden; border-radius: 10px;
    background: repeating-linear-gradient(90deg, var(--fps-chart) 0 39px, var(--fps-panel2) 39px 40px), var(--fps-chart);
    border: 1px dashed var(--fps-line2);
}
.fps-box { position: absolute; width: 15px; height: 15px; border-radius: 3px; background: var(--fps-brand); opacity: .72; will-change: transform; }

/* ---------- 统计 ---------- */
.fps-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fps-stat { border: 1px solid var(--fps-line); border-radius: 10px; background: var(--fps-panel2); padding: 11px 13px; min-width: 0; }
.fps-stat span { display: block; font-size: 11.5px; color: var(--fps-sub); }
.fps-stat b { display: block; font: 800 22px/1.4 var(--fps-mono); color: var(--fps-brand); }
.fps-stat.is-good b { color: var(--fps-good); }
.fps-stat.is-warn b { color: var(--fps-warn); }
.fps-verdict { margin-top: 14px; border: 1px solid var(--fps-line2); border-left: 5px solid var(--fps-good); border-radius: 0 10px 10px 0; background: var(--fps-good-soft); padding: 12px 16px; }
.fps-verdict[hidden] { display: none !important; }
.fps-verdict.is-warn { border-left-color: var(--fps-warn); background: var(--fps-warn-soft); }
.fps-verdict b { display: block; font-size: 15px; margin-bottom: 4px; }
.fps-verdict p { margin: 0; font-size: 12.5px; line-height: 1.9; color: var(--fps-sub); }
.fps-history-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 12px; }
.fps-history-tip { font-size: 11.5px; color: var(--fps-sub); }
.fps-table-scroll { overflow-x: auto; }
.fps-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fps-table th, .fps-table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--fps-line); }
.fps-table th { background: var(--fps-bg2); color: var(--fps-sub); white-space: nowrap; font-size: 11.5px; }
.fps-table td { font-family: var(--fps-mono); }
.fps-table .fps-empty { text-align: center; color: var(--fps-sub); padding: 22px; font-family: inherit; }
.fps-pill { display: inline-block; border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 700; background: var(--fps-good-soft); color: var(--fps-good); }
.fps-pill.warn { background: var(--fps-warn-soft); color: var(--fps-warn); }
.fps-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 14px);
    background: var(--fps-ink); color: var(--fps-panel); border-radius: 8px; padding: 10px 18px;
    font-size: 13px; box-shadow: var(--fps-shadow); opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s; z-index: 999;
}
.fps-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
    .fps-hero { grid-template-columns: 1fr; }
    .fps-controls { grid-template-columns: 1fr 1fr; }
    .fps-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .fps-wrap { padding: 12px 12px 0; }
    .fps-page h1 { font-size: 28px; }
    .fps-sub { font-size: 14px; line-height: 1.85; }
    .fps-section { padding: 15px 13px; }
    .fps-controls, .fps-stats { grid-template-columns: 1fr 1fr; }
    .fps-ring { width: 158px; height: 158px; }
    .fps-ring-in b { font-size: 44px; }
    .fps-table th, .fps-table td { padding: 8px 7px; font-size: 11.5px; }
    .fps-hud-foot b { font-size: 11.5px; }
}

/* 深色主按钮：亮电光蓝底配深墨字 */
:root[data-theme="dark"] .fps-btn-main { color: #0a1430; }
:root[data-theme="dark"] .fps-btn-main:hover { color: #0a1430; }
