/* ============================================================
   键盘666 jianpan666.com — 专业在线键盘测试工具
   设计系统：默认亮色，[data-theme="dark"] 为深色科技/外设电竞风
   ============================================================ */

/* ---------- 设计变量（亮色 = 默认） ---------- */
:root {
    --bg: #f4f7fb;
    --bg-soft: #ffffff;
    --panel: #ffffff;
    --panel-2: #f6f8fc;
    --panel-3: #edf1f8;
    --line: rgba(15, 23, 42, 0.10);
    --line-strong: rgba(15, 23, 42, 0.20);

    --text: #17233b;
    --text-2: #46536b;
    --text-3: #6d7b94;

    --accent: #0891b2;
    --accent-2: #0ea5e9;
    --good: #059669;
    --good-deep: #0b7a55;
    --warn: #b45309;
    --bad: #d63355;
    --bad-deep: #b22343;
    --violet: #7c3aed;

    --key-face: linear-gradient(180deg, #ffffff 0%, #f2f5fa 55%, #e5eaf2 100%);
    --key-face-edge: rgba(255, 255, 255, 0.95);
    --key-shadow: inset 0 -3px 0 rgba(15, 23, 42, 0.10), inset 0 1px 0 var(--key-face-edge), 0 2px 5px rgba(15, 23, 42, 0.10);
    --keycap-text: #3a4761;
    --keycap-border: rgba(15, 23, 42, 0.10);
    --cnt-text: #0e7490;
    --cnt-tested: #059669;
    --cnt-chatter: #9f1239;
    --tested-face: linear-gradient(180deg, #d7f5e7, #c0ecda);
    --tested-text: #0b7a55;
    --tested-sub: rgba(11, 122, 85, 0.62);
    --chatter-face: linear-gradient(180deg, #fddce4, #f9c2cf);
    --chatter-text: #9f1239;

    --header-bg: rgba(255, 255, 255, 0.85);
    --footer-bg: rgba(244, 247, 251, 0.92);
    --bg-glow-a: rgba(14, 165, 233, 0.10);
    --bg-glow-b: rgba(99, 102, 241, 0.09);
    --accent-hover: #0e7490;
    --brand-icon: #0891b2;
    --tab-hover: rgba(15, 23, 42, 0.05);
    --scrollbar: #c9d4e4;
    --scrollbar-h: #aab9cf;
    --inset-bg: rgba(15, 23, 42, 0.06);
    --stage-grad: linear-gradient(180deg, #f9fbfd, #eef2f8);
    --stage-grad-full: linear-gradient(180deg, #f2f5fa, #e4eaf2);
    --hero-grad: linear-gradient(90deg, #101c33, #0e7490 55%, #0891b2);
    --screen-bg: #f7f9fc;
    --type-base: #9aa7ba;
    --cur-text: #075985;
    --err-text: #7f1d1d;
    --mask-bg: rgba(248, 250, 252, 0.82);
    --chip-text: #0e7490;
    --notice-text: #8a5c10;
    --notice-b: #6d4a06;
    --notice-info-text: #0e7490;
    --notice-info-b: #0c4a6e;
    --btn-hover-text: #0f1c30;
    --danger-hover-text: #7f1d1d;
    --switch-track: #d3dce9;
    --switch-knob: #ffffff;
    --switch-knob-on: #f0fdff;
    --led-off: #c3cedd;
    --toast-bg: rgba(255, 255, 255, 0.97);
    --toast-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);

    --radius: 14px;
    --radius-sm: 9px;
    --radius-lg: 20px;

    --header-h: 60px;
    --maxw: 1240px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica,
        Arial, sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- 深色主题 ---------- */
[data-theme="dark"] {
    --bg: #070b12;
    --bg-soft: #0b111c;
    --panel: #101827;
    --panel-2: #151f31;
    --panel-3: #1b2740;
    --line: rgba(148, 178, 255, 0.12);
    --line-strong: rgba(148, 178, 255, 0.24);

    --text: #e8eefb;
    --text-2: #aebbd4;
    --text-3: #74829e;

    --accent: #22d3ee;
    --accent-2: #0ea5e9;
    --good: #34d399;
    --good-deep: #0f9f6e;
    --warn: #fbbf24;
    --bad: #fb5d75;
    --bad-deep: #d63b55;
    --violet: #a78bfa;

    --key-face: linear-gradient(180deg, #2a3550 0%, #202a40 55%, #1a2236 100%);
    --key-face-edge: rgba(255, 255, 255, 0.10);
    --key-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 var(--key-face-edge), 0 3px 6px rgba(0, 0, 0, 0.45);
    --keycap-text: #cdd8ee;
    --keycap-border: rgba(255, 255, 255, 0.06);
    --cnt-text: rgba(103, 232, 249, 0.9);
    --cnt-tested: rgba(52, 211, 153, 0.95);
    --cnt-chatter: rgba(255, 255, 255, 0.95);
    --tested-face: linear-gradient(180deg, #14382c, #0f2c22);
    --tested-text: #a7f3d0;
    --tested-sub: rgba(167, 243, 208, 0.55);
    --chatter-face: linear-gradient(180deg, #4a1826, #38101c);
    --chatter-text: #fecdd6;

    --header-bg: rgba(9, 13, 22, 0.82);
    --footer-bg: rgba(8, 12, 20, 0.8);
    --bg-glow-a: rgba(34, 211, 238, 0.10);
    --bg-glow-b: rgba(99, 102, 241, 0.10);
    --accent-hover: #67e8f9;
    --brand-icon: #22d3ee;
    --tab-hover: rgba(148, 178, 255, 0.08);
    --scrollbar: #26324d;
    --scrollbar-h: #334263;
    --inset-bg: rgba(0, 0, 0, 0.3);
    --stage-grad: linear-gradient(180deg, #0d1524, #0a101c);
    --stage-grad-full: linear-gradient(180deg, #0d1524, #070b12);
    --hero-grad: linear-gradient(90deg, #fff, #a5f3fc 55%, var(--accent));
    --screen-bg: #0a111e;
    --type-base: #54627e;
    --cur-text: #d9f6fd;
    --err-text: #fff;
    --mask-bg: rgba(7, 11, 18, 0.78);
    --chip-text: #a5f3fc;
    --notice-text: #fde6a8;
    --notice-b: #fff3cf;
    --notice-info-text: #b9ecf6;
    --notice-info-b: #d9f6fd;
    --btn-hover-text: #fff;
    --danger-hover-text: #ffd6dd;
    --switch-track: #26324d;
    --switch-knob: #8fa0c0;
    --switch-knob-on: #04161c;
    --led-off: #33425e;
    --toast-bg: rgba(21, 31, 49, 0.96);
    --toast-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

:root { color-scheme: light; }

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    color: var(--text);
    background:
        radial-gradient(1100px 520px at 78% -12%, var(--bg-glow-a), transparent 60%),
        radial-gradient(900px 480px at 8% -8%, var(--bg-glow-b), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button { font-family: inherit; }
::selection { background: rgba(34, 211, 238, 0.35); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-h); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局容器 ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
main { flex: 1; }

/* ---------- 顶部导航 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.site-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); }
.brand-mark {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.22), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(34, 211, 238, 0.35);
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.22);
}
.brand-mark svg { width: 21px; height: 21px; stroke: var(--brand-icon); }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: 0.5px; white-space: nowrap; }
.brand-name em { font-style: normal; color: var(--accent); }
.brand-domain { font-size: 11px; color: var(--text-3); display: block; line-height: 1; margin-top: 2px; letter-spacing: 0.3px; }

.mode-nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; padding: 2px; }
.mode-nav::-webkit-scrollbar { display: none; }
.mode-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all .16s ease;
}
.mode-tab svg { width: 16px; height: 16px; flex-shrink: 0; }
.mode-tab:hover { color: var(--text); background: var(--tab-hover); }
.mode-tab.is-active {
    color: #062830;
    background: linear-gradient(135deg, var(--accent), #4ee0c8);
    box-shadow: 0 4px 18px rgba(34, 211, 238, 0.35);
}

/* 主题切换按钮 */
.theme-toggle {
    width: 38px; height: 38px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--panel-2);
    color: var(--text-2);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* 音效开关：激活时显示"有声"图标，否则显示"静音"图标 */
.theme-toggle.is-active { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon-sound-on { display: none; }
.theme-toggle.is-active .icon-sound-on { display: block; }
.theme-toggle.is-active .icon-sound-off { display: none; }

/* ---------- 通用卡片 / 按钮 ---------- */
.card {
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--text-2); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title svg { width: 16px; height: 16px; color: var(--accent); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 18px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--panel-3);
    color: var(--text);
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--accent); color: var(--btn-hover-text); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent-2), #0891b2);
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, #38bdf8, #06b6d4); color: #04161c; }
.btn-danger { background: rgba(251, 93, 117, 0.12); border-color: rgba(251, 93, 117, 0.4); color: var(--bad); }
.btn-danger:hover { background: rgba(251, 93, 117, 0.22); color: var(--danger-hover-text); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar .spacer { flex: 1; }

/* 分段选择器 */
.segmented { display: inline-flex; background: var(--inset-bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button {
    border: 0; background: transparent; color: var(--text-3);
    padding: 6px 13px; border-radius: 7px; font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap; transition: all .14s ease;
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--panel-3); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.switch input { display: none; }
.switch i {
    width: 38px; height: 21px; border-radius: 999px;
    background: var(--switch-track); position: relative; transition: background .18s ease; flex-shrink: 0;
    border: 1px solid var(--line);
}
.switch i::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--switch-knob); transition: all .18s ease;
}
.switch input:checked + i { background: rgba(34, 211, 238, 0.85); border-color: var(--accent); }
.switch input:checked + i::after { left: 18px; background: var(--switch-knob-on); }

/* ---------- Hero 区 ---------- */
.hero { padding: 34px 0 18px; text-align: center; }
.hero h1 {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 900;
    letter-spacing: 1px;
    background: var(--hero-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p { color: var(--text-2); margin-top: 10px; font-size: 15px; }
.hero .hero-tags { margin-top: 14px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.tag {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12.5px; font-weight: 600; color: var(--text-2);
    padding: 4px 11px; border-radius: 999px;
    background: rgba(148, 178, 255, 0.07);
    border: 1px solid var(--line);
}
.tag svg { width: 13px; height: 13px; color: var(--good); }

/* ---------- 模式面板 ---------- */
.mode-panel { display: none; animation: fadeUp .28s ease; }
.mode-panel.is-active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.panel-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin: 8px 0 16px;
}
.panel-head h2 { font-size: 20px; display: flex; align-items: center; gap: 9px; }
.panel-head h2 svg { width: 22px; height: 22px; color: var(--accent); }
.panel-head .panel-desc { color: var(--text-3); font-size: 13.5px; flex-basis: 100%; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.stat .stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.stat .stat-value { font-size: 26px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .stat-value small { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 2px; }
.stat.accent .stat-value { color: var(--accent); }
.stat.good .stat-value { color: var(--good); }
.stat.bad .stat-value { color: var(--bad); }
.stat.violet .stat-value { color: var(--violet); }

.progress {
    height: 8px; border-radius: 999px; background: var(--inset-bg);
    overflow: hidden; border: 1px solid var(--line);
}
.progress > i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--good-deep), var(--good)); transition: width .25s ease; box-shadow: 0 0 10px rgba(52, 211, 153, 0.5); }

/* ---------- 虚拟键盘 ---------- */
.keyboard-stage {
    background:
        radial-gradient(600px 260px at 50% 0%, rgba(34, 211, 238, 0.07), transparent 70%),
        var(--stage-grad);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px 22px 18px;
    overflow-x: auto;
}
.keyboard {
    display: grid;
    grid-template-columns: repeat(var(--cols, 92), minmax(0, 1fr));
    grid-auto-rows: var(--kb-keyh, 46px);
    gap: 7px;
    min-width: 760px;
    margin: 0 auto;
}
.keyboard.layout-sixty { --cols: 60; min-width: 560px; max-width: 760px; }
.keyboard.layout-tkl { --cols: 74; min-width: 640px; max-width: 900px; }

/* ---------- 全屏模式：键盘水平垂直居中并随屏幕放大 ---------- */
.keyboard-stage:fullscreen {
    display: flex; align-items: center; justify-content: center;
    background: var(--stage-grad-full);
    border: 0; border-radius: 0;
    padding: 2vh 2vw;
}
.keyboard-stage:fullscreen::before {
    content: '按 Esc 退出全屏';
    position: absolute; top: 14px; right: 20px;
    font-size: 12px; color: var(--text-3);
}
.keyboard-stage:fullscreen .keyboard {
    width: min(96vw, 1920px);
    max-width: none;
    min-width: 0;
    --kb-keyh: clamp(44px, 7vh, 92px);
    gap: clamp(6px, 0.8vh, 11px);
}
.keyboard-stage:fullscreen .keycap { border-radius: clamp(6px, 0.9vh, 11px); }
.keyboard-stage:fullscreen .keycap b { font-size: clamp(13px, 1.7vh, 22px); }
.keyboard-stage:fullscreen .keycap b.sm { font-size: clamp(9.5px, 1.25vh, 16px); }
.keyboard-stage:fullscreen .keycap b.md { font-size: clamp(11px, 1.45vh, 18px); }
.keyboard-stage:fullscreen .keycap .sub { font-size: clamp(9.5px, 1.15vh, 15px); }
.keyboard-stage:fullscreen .keycap .cnt { font-size: clamp(9px, 1.2vh, 15px); }
.keyboard-stage:fullscreen .keycap.ctr b,
.keyboard-stage:fullscreen .keycap.pad b { font-size: clamp(15px, 2vh, 26px); }

.kb-gap { }

.keycap {
    grid-column: span 4;
    position: relative;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 0 5px;
    border-radius: 7px;
    background: var(--key-face);
    border: 1px solid var(--keycap-border);
    box-shadow: var(--key-shadow);
    color: var(--keycap-text);
    font-size: 12px; font-weight: 600;
    line-height: 1.15;
    user-select: none;
    overflow: hidden;
    transition: background .08s, box-shadow .08s, color .08s, transform .05s;
}
.keycap b { font-size: 13px; font-weight: 700; margin: 0; line-height: 1.12; text-align: center; }
.keycap b.sm { font-size: 9.5px; }
.keycap b.md { font-size: 11px; }
.keycap.multi b { display: flex; flex-direction: column; gap: 1px; }
.keycap .sub { font-size: 9.5px; color: var(--text-3); margin: 0; }
/* 数字行/标点键：上挡符号在上、主字符在下，居中双印刷 */
.keycap.dual .sub { margin-bottom: 1px; }
/* 方向键/小键盘运算符：整体居中（与默认一致，仅放大字号） */
.keycap.ctr b { font-size: 16px; }
/* 小键盘数字键：主数字居中，导航小字悬浮左上角（实体键帽双印刷） */
.keycap.pad .sub { position: absolute; top: 3px; left: 5px; }
.keycap.pad b { font-size: 16px; line-height: 1; }
.keycap.is-down {
    background: linear-gradient(180deg, #0e7490, #0891b2);
    color: #e8feff;
    border-color: rgba(103, 232, 249, 0.8);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35), 0 0 14px rgba(34, 211, 238, 0.75), 0 0 36px rgba(34, 211, 238, 0.35);
    transform: translateY(2px);
}
.keycap.is-down .sub { color: rgba(255, 255, 255, 0.85); }
.keycap.is-down .cnt { color: rgba(255, 255, 255, 0.95); }
.keycap.is-tested:not(.is-down) {
    background: var(--tested-face);
    border-color: rgba(52, 211, 153, 0.45);
    color: var(--tested-text);
}
.keycap.is-tested:not(.is-down) .sub { color: var(--tested-sub); }
.keycap.is-chatter:not(.is-down) {
    background: var(--chatter-face);
    border-color: rgba(251, 93, 117, 0.7);
    color: var(--chatter-text);
    animation: chatterPulse 1.4s ease infinite;
}
.keycap.is-chatter:not(.is-down) .sub { color: var(--chatter-text); opacity: .65; }
.keycap.is-chatter:not(.is-down) .cnt { color: var(--cnt-chatter); }
@keyframes chatterPulse {
    0%, 100% { box-shadow: var(--key-shadow), 0 0 0 rgba(251, 93, 117, 0); }
    50% { box-shadow: var(--key-shadow), 0 0 16px rgba(251, 93, 117, 0.65); }
}
.keycap .cnt {
    position: absolute; top: 2px; right: 4px;
    font-size: 9px; font-weight: 700; color: var(--cnt-text);
    font-variant-numeric: tabular-nums;
}
.keycap.is-tested .cnt { color: var(--cnt-tested); }
.keycap.h2 { grid-row: span 2; }
.keycap.k-w2 { grid-column: span 8; }
.keycap.k-w15 { grid-column: span 6; }
.keycap.k-w175 { grid-column: span 7; }
.keycap.k-w225 { grid-column: span 9; }
.keycap.k-w275 { grid-column: span 11; }
.keycap.k-w625 { grid-column: span 25; }

/* 最近按键信息条 */
.key-strip {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin-top: 14px; padding: 12px 16px;
    background: var(--inset-bg);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
}
.key-strip .ks-name {
    min-width: 52px; text-align: center;
    padding: 6px 14px; border-radius: 8px;
    background: var(--panel-3); border: 1px solid var(--line-strong);
    font-weight: 800; font-size: 16px; color: var(--accent);
    font-family: var(--mono);
}
.key-strip .ks-item { color: var(--text-3); }
.key-strip .ks-item b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.key-strip .ks-hint { color: var(--text-3); }

/* ---------- 无冲模式 ---------- */
.ghost-hero {
    text-align: center;
    padding: 26px 20px 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: radial-gradient(520px 200px at 50% 0%, rgba(34, 211, 238, 0.1), transparent 70%), var(--panel);
    margin-bottom: 16px;
}
.ghost-now { font-size: 64px; font-weight: 900; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; text-shadow: 0 0 30px rgba(34, 211, 238, 0.45); }
.ghost-now small { font-size: 18px; color: var(--text-3); font-weight: 700; margin-left: 6px; }
.ghost-label { color: var(--text-3); font-size: 13.5px; font-weight: 600; margin-top: 8px; }
.ghost-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; min-height: 34px; }
.ghost-chip {
    padding: 5px 13px; border-radius: 8px; font-weight: 700; font-size: 13.5px;
    background: rgba(34, 211, 238, 0.15); border: 1px solid rgba(34, 211, 238, 0.5);
    color: var(--chip-text); font-family: var(--mono);
    animation: chipPop .15s ease;
}
@keyframes chipPop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.verdict { margin-top: 16px; font-size: 14.5px; font-weight: 700; }
.verdict.pass { color: var(--good); }
.verdict.info { color: var(--warn); }

.notice {
    display: flex; gap: 10px;
    padding: 12px 15px; border-radius: var(--radius-sm);
    font-size: 13px; line-height: 1.6;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--notice-text);
}
.notice.info { background: rgba(34, 211, 238, 0.07); border-color: rgba(34, 211, 238, 0.28); color: var(--notice-info-text); }
.notice svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; }
.notice b { color: var(--notice-b); }
.notice.info b { color: var(--notice-info-b); }

/* ---------- 抖动模式 ---------- */
.event-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.event-table th {
    text-align: left; color: var(--text-3); font-weight: 600; font-size: 12px;
    padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.event-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.event-table tr.is-bad td { color: var(--bad); font-weight: 700; }
.event-table tr.is-ok td { color: var(--text-3); }
.event-table .mono { font-family: var(--mono); }
.table-scroll { max-height: 300px; overflow-y: auto; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.bad { background: rgba(251, 93, 117, 0.15); color: var(--bad); }
.badge.ok { background: rgba(52, 211, 153, 0.13); color: var(--good); }
.empty-tip { color: var(--text-3); font-size: 13px; text-align: center; padding: 26px 10px; }

/* ---------- 打字测速 ---------- */
.type-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.type-screen {
    position: relative;
    background: var(--screen-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-height: 300px;
    padding: 26px 26px 22px;
    font-size: 19px;
    line-height: 2.1;
    letter-spacing: 1px;
    cursor: text;
    overflow: hidden;
}
.type-screen.is-focused { border-color: rgba(34, 211, 238, 0.5); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08); }
.type-text { font-family: var(--font); color: var(--type-base); word-break: break-all; }
.type-screen[data-lang="en"] .type-text { font-family: var(--mono); font-size: 18px; }
.type-text .ch { position: relative; border-radius: 3px; }
.type-text .ch.cur { background: rgba(34, 211, 238, 0.18); color: var(--cur-text); }
.type-text .ch.ok { color: var(--text); }
.type-text .ch.err { color: var(--err-text); background: rgba(251, 93, 117, 0.35); text-decoration: underline wavy var(--bad); }
.type-text .ch.skip { color: var(--bad); }
.type-caret {
    display: inline-block; width: 2px; height: 1.15em;
    background: var(--accent); vertical-align: text-bottom;
    animation: blink 1s steps(1) infinite; border-radius: 1px;
    box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
}
@keyframes blink { 50% { opacity: 0; } }
.type-mask {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    background: var(--mask-bg); backdrop-filter: blur(2px);
    text-align: center; padding: 20px;
}
.type-mask h3 { font-size: 20px; }
.type-mask p { color: var(--text-2); font-size: 14px; max-width: 420px; }
.type-input { position: absolute; top: 10px; left: 10px; width: 4px; height: 4px; opacity: 0; border: 0; padding: 0; pointer-events: none; }

.result-card { text-align: center; }
.result-big { font-size: 52px; font-weight: 900; color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums; }
.result-big small { display: block; font-size: 13px; color: var(--text-3); font-weight: 600; margin-top: 4px; }
.result-grade { font-size: 15px; font-weight: 800; margin: 10px 0 4px; }
.result-list { text-align: left; margin-top: 14px; font-size: 13.5px; }
.result-list li { display: flex; justify-content: space-between; padding: 6px 2px; border-bottom: 1px dashed var(--line); color: var(--text-3); list-style: none; }
.result-list li b { color: var(--text); font-variant-numeric: tabular-nums; }
.result-list { padding-left: 0; }

/* ---------- 反应速度 ---------- */
.react-arena {
    position: relative;
    height: 340px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 20px;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    transition: background .15s ease;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.react-arena.state-wait { background: linear-gradient(180deg, #5b1a28, #3a1019); border-color: rgba(251, 93, 117, 0.5); color: #ffe3e8; }
.react-arena.state-go { background: linear-gradient(180deg, #0c5e46, #083f30); border-color: rgba(52, 211, 153, 0.7); box-shadow: inset 0 0 90px rgba(52, 211, 153, 0.25); color: #d9fdf0; }
.react-arena.state-early { background: linear-gradient(180deg, #7a2a14, #4d1a0b); border-color: rgba(251, 145, 66, 0.6); color: #ffe8d9; }
.react-arena.state-wait .react-sub,
.react-arena.state-go .react-sub,
.react-arena.state-early .react-sub { color: rgba(255, 255, 255, 0.78); }
.react-main-num { font-size: 72px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.react-main-text { font-size: 24px; font-weight: 800; margin-top: 8px; }
.react-sub { color: var(--text-2); font-size: 14px; margin-top: 10px; max-width: 460px; }
.react-rounds { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.react-dot {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: var(--panel-3); border: 1px solid var(--line);
    font-size: 12px; font-weight: 700; color: var(--text-3);
}
.react-dot.done { color: var(--good); border-color: rgba(52, 211, 153, 0.5); background: rgba(52, 211, 153, 0.1); }
.react-dot.live { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px rgba(34, 211, 238, 0.35); }

/* ---------- 键值查询 ---------- */
.keycode-hero {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: radial-gradient(520px 220px at 50% 0%, rgba(167, 139, 250, 0.12), transparent 70%), var(--panel);
    padding: 28px; text-align: center; margin-bottom: 16px;
}
.kc-key {
    display: inline-grid; place-items: center;
    min-width: 110px; min-height: 110px; padding: 12px 26px;
    border-radius: 16px;
    background: var(--key-face);
    border: 1px solid rgba(167, 139, 250, 0.45);
    box-shadow: var(--key-shadow), 0 0 30px rgba(167, 139, 250, 0.18);
    font-size: 40px; font-weight: 800;
    word-break: break-all;
}
.kc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 20px; text-align: left; }
.kc-item { background: var(--inset-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 13px; }
.kc-item .k { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.kc-item .v { font-family: var(--mono); font-size: 14.5px; font-weight: 700; margin-top: 2px; word-break: break-all; }

.mod-leds { display: flex; gap: 10px; flex-wrap: wrap; }
.mod-led {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border-radius: 999px;
    background: var(--inset-bg); border: 1px solid var(--line);
    font-size: 13px; font-weight: 700; color: var(--text-3);
}
.mod-led i { width: 9px; height: 9px; border-radius: 50%; background: var(--led-off); }
.mod-led.on { color: var(--good); border-color: rgba(52, 211, 153, 0.45); background: rgba(52, 211, 153, 0.08); }
.mod-led.on i { background: var(--good); box-shadow: 0 0 8px rgba(52, 211, 153, 0.8); }

/* ---------- SEO 内容区 ---------- */
.seo-section { margin-top: 54px; }
.seo-section h2 { font-size: 24px; margin-bottom: 8px; }
.seo-section .lead { color: var(--text-2); margin-bottom: 22px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.feature-card {
    padding: 20px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--line);
    transition: border-color .2s ease, transform .2s ease;
}
.feature-card:hover { border-color: rgba(34, 211, 238, 0.4); transform: translateY(-3px); }
.feature-card .fc-icon {
    width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
    background: rgba(34, 211, 238, 0.12); border: 1px solid rgba(34, 211, 238, 0.3);
    margin-bottom: 12px;
}
.feature-card .fc-icon svg { width: 21px; height: 21px; color: var(--accent); }
.feature-card h3 { font-size: 16px; margin-bottom: 6px; }
.feature-card p { font-size: 13.5px; color: var(--text-3); }
.feature-card a { font-size: 13px; font-weight: 700; margin-top: 10px; display: inline-block; }

.faq-list { margin-top: 8px; display: grid; gap: 10px; }
.faq-list details {
    background: linear-gradient(180deg, var(--panel), var(--bg-soft));
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0 18px;
    transition: border-color .2s ease;
}
.faq-list details[open] { border-color: rgba(34, 211, 238, 0.35); }
.faq-list summary {
    cursor: pointer; padding: 15px 0; font-weight: 700; font-size: 14.5px;
    list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
    content: "+"; font-size: 20px; color: var(--accent); font-weight: 400; transition: transform .2s ease;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details > div { color: var(--text-2); font-size: 13.5px; padding: 0 0 16px; }
.faq-list details > div p + p { margin-top: 8px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; counter-reset: step; }
.step-card { position: relative; padding: 20px 18px 18px 54px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.step-card::before {
    counter-increment: step; content: counter(step);
    position: absolute; left: 16px; top: 18px;
    width: 26px; height: 26px; border-radius: 8px;
    display: grid; place-items: center;
    background: rgba(34, 211, 238, 0.15); border: 1px solid rgba(34, 211, 238, 0.4);
    color: var(--accent); font-weight: 800; font-size: 14px;
}
.step-card h3 { font-size: 14.5px; margin-bottom: 5px; }
.step-card p { font-size: 13px; color: var(--text-3); }

/* ---------- 页脚 ---------- */
.site-footer { margin-top: 60px; border-top: 1px solid var(--line); background: var(--footer-bg); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; padding: 38px 0 26px; }
.footer-brand p { color: var(--text-3); font-size: 13px; margin-top: 10px; max-width: 340px; }
.footer-col h4 { font-size: 13.5px; color: var(--text-2); margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-3); font-size: 13.5px; padding: 4px 0; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--line); padding: 16px 0; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--text-3); font-size: 12.5px; }
.footer-bottom a { color: var(--text-3); }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- 提示条 / Toast ---------- */
.mobile-tip { display: none; margin-bottom: 14px; }
.toast-host { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
    padding: 10px 20px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
    background: var(--toast-bg); border: 1px solid var(--line-strong);
    box-shadow: var(--toast-shadow);
    animation: toastIn .25s ease;
}
.toast.good { color: var(--good); border-color: rgba(52, 211, 153, 0.45); }
.toast.bad { color: var(--bad); border-color: rgba(251, 93, 117, 0.45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 工具类 ---------- */
.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.hide { display: none !important; }
.text-c { text-align: center; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .type-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .container { padding: 0 13px; }
    .mobile-tip { display: flex; }
    .brand-domain { display: none; }
    .mode-tab { padding: 7px 11px; font-size: 13px; }
    .hero { padding: 22px 0 12px; }
    .keyboard-stage { padding: 14px 12px; }
    .type-screen { font-size: 16px; padding: 20px 16px; line-height: 2; min-height: 260px; }
    .ghost-now { font-size: 50px; }
    .panel-head h2 { font-size: 18px; }
}

/* ---------- 无障碍 ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}

/* ---------- 多语言切换 ---------- */
/* 防闪烁：非默认语言在 i18n 字典应用前隐藏页面（1.2s 兜底强制显示） */
html[data-i18n-pending] body { visibility: hidden; }

.lang-switch { position: relative; }

.lang-toggle {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0 10px;
    cursor: pointer;
}
.lang-toggle svg { width: 15px; height: 15px; flex-shrink: 0; }
.lang-caret { font-size: 10px; color: var(--text-3); margin-left: -1px; }

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 132px;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
    padding: 6px;
    z-index: 1000;
}
.lang-menu.open { display: block; animation: langMenuIn .15s ease-out; }
@keyframes langMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.lang-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 13.5px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .12s;
}
.lang-menu button:hover { background: var(--panel-3); }
.lang-menu button.active {
    background: var(--inset-bg);
    color: var(--accent);
    font-weight: 700;
}

/* 文章/法律页面列表 */
.card ul { margin: 6px 0 0; padding-left: 20px; color: var(--text-2); }
.card ul li { margin: 5px 0; font-size: 14px; }

/* ============================================================
   屏幕测试工具
   ============================================================ */
.st-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.st-swatch {
    position: relative;
    height: 84px;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    transition: transform .15s ease, box-shadow .15s ease;
}
.st-swatch:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18); }
.st-swatch span {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 4px 0;
    font-size: 12px; font-weight: 700;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    text-align: center;
    backdrop-filter: blur(2px);
}
.st-swatch.st-wide { height: 84px; }
.st-swatch.st-pattern-grid {
    background-color: var(--panel-2);
    background-image: linear-gradient(var(--line-strong) 1px, transparent 1px), linear-gradient(90deg, var(--line-strong) 1px, transparent 1px);
    background-size: 16px 16px;
}
.st-swatch.st-pattern-text { background: var(--panel-2); color: var(--text); font-size: 20px; font-weight: 800; }
.st-swatch.st-pattern-text span { background: transparent; color: var(--text-3); position: absolute; bottom: 4px; font-size: 12px; }
.st-swatch.st-pattern-grid span { background: rgba(15, 23, 42, 0.55); color: #fff; }

/* 全屏检测覆盖层 */
.st-overlay {
    position: fixed; inset: 0; z-index: 1000;
    cursor: pointer;
    user-select: none;
}
/* 全屏控制条：无操作自动淡出，移动鼠标唤出 */
.st-bar {
    position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 14px;
    padding: 8px 16px; border-radius: 999px;
    background: rgba(15, 23, 42, 0.62); color: #fff;
    font-size: 13px;
    backdrop-filter: blur(4px);
    transition: opacity .5s ease;
    white-space: nowrap;
}
.st-bar.fade { opacity: 0; pointer-events: none; }
.st-bar-info b { font-size: 14px; }
.st-bar-info small { margin-left: 7px; opacity: .75; font-variant-numeric: tabular-nums; }
.st-bar-btns { display: flex; gap: 6px; }
.st-bar-btn {
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff; border-radius: 8px;
    padding: 4px 11px; font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: background .14s ease;
}
.st-bar-btn:hover { background: rgba(255, 255, 255, 0.28); }
.st-bar-btn.on { background: #22d3ee; border-color: #22d3ee; color: #04161c; }
.st-bar-tip { opacity: .65; font-size: 12px; }
@media (max-width: 720px) {
    .st-bar { flex-wrap: wrap; justify-content: center; white-space: normal; max-width: 92vw; border-radius: var(--radius); }
    .st-bar-tip { display: none; }
}
.st-overlay.st-grid-on {
    background-color: #20242c;
    background-image: linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 40px 40px;
}
.st-overlay.st-text-on { background: #fff; cursor: pointer; }
.st-text-stage {
    height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
    color: #111; text-align: center; padding: 0 6vw;
}
.st-text-line { margin: 0; }

/* ============================================================
   鼠标测试工具
   ============================================================ */
.mt-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: stretch; }

.mt-stage {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    min-height: 380px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background:
        radial-gradient(600px 260px at 50% 0%, rgba(34, 211, 238, 0.07), transparent 70%),
        var(--stage-grad);
    user-select: none;
    overflow: hidden;
}
.mt-stage-hint {
    position: absolute; bottom: 14px; left: 0; right: 0;
    text-align: center; font-size: 12.5px; color: var(--text-3);
    pointer-events: none;
}

/* 鼠标图示：3D 拟真鼠标（左/中/右三键 + 两个侧键） */
.mt-mouse-wrap {
    position: relative;
    width: 220px; height: 310px;
    margin: 4px 0 18px;
    perspective: 900px;
}
.mt-mouse {
    position: relative;
    width: 100%; height: 100%;
    transform-style: preserve-3d;
    transition: transform .2s ease;
}
.mt-stage:hover .mt-mouse { transform: rotateX(2deg) rotateY(-3deg); }

.mt-mouse-body {
    position: absolute; inset: 0;
    overflow: hidden;
    border: 2px solid #334155;
    border-radius: 106px 106px 76px 76px;
    background: linear-gradient(155deg, #475569 0%, #1e293b 68%, #0f172a 100%);
    box-shadow:
        0 22px 38px rgba(15, 23, 42, .28),
        inset 0 2px 2px rgba(255, 255, 255, .14),
        inset 0 -10px 24px rgba(0, 0, 0, .24);
}
.mt-mouse-body::after {
    content: '';
    position: absolute;
    left: 25px; right: 25px; bottom: 28px;
    height: 66px;
    border-radius: 12px 12px 48px 48px;
    background: linear-gradient(180deg, rgba(15, 23, 42, .2), rgba(15, 23, 42, .62));
    box-shadow: inset 0 1px rgba(255, 255, 255, .05);
}

/* 按键通用 */
.mt-btn {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    color: #e2e8f0;
    font-size: 13px; font-weight: 700;
    transition: background .12s ease, color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.mt-btn .cnt {
    margin-top: 6px;
    font-size: 11px; font-weight: 700;
    color: #7dd3fc;
    font-variant-numeric: tabular-nums;
}

/* 左右键 */
.mt-mouse-button {
    position: absolute; top: 0; z-index: 2;
    width: calc(50% - 2px); height: 132px;
    padding-top: 32px;
    border-bottom: 2px solid #1e293b;
    background: linear-gradient(160deg, #64748b, #334155);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, .13);
}
.mt-left { left: 0; border-right: 1px solid #1e293b; border-radius: 104px 5px 25px 8px; }
.mt-right { right: 0; border-left: 1px solid #1e293b; border-radius: 5px 104px 8px 25px; }

.mt-left.is-down {
    background: linear-gradient(155deg, #2dd4bf, #0e7490);
    color: #ecfeff;
    box-shadow: inset 0 5px 8px rgba(6, 78, 94, .35), 0 0 16px rgba(34, 211, 238, .55);
    transform: translateY(4px);
}
.mt-right.is-down {
    background: linear-gradient(155deg, #60a5fa, #2563eb);
    color: #eff6ff;
    box-shadow: inset 0 5px 8px rgba(30, 64, 175, .35), 0 0 16px rgba(96, 165, 250, .5);
    transform: translateY(4px);
}
.mt-mouse-button.is-down .cnt { color: #fff; }
.mt-mouse-button.is-tested:not(.is-down) {
    background: linear-gradient(160deg, #2f9e79, #17614a);
    color: #eafff5;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, .1), inset 0 0 14px rgba(52, 211, 153, .3);
}
.mt-btn.is-tested:not(.is-down) .cnt { color: #a7f3d0; }

/* 中间滚轮通道 */
.mt-center-channel {
    position: absolute; top: 28px; left: 50%; z-index: 4;
    width: 46px; height: 154px;
    border: 1px solid #0f172a;
    border-radius: 22px;
    background: #1e293b;
    transform: translateX(-50%);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .45);
}
.mt-middle {
    position: absolute; inset: 0;
    padding-top: 12px;
    border-radius: 22px;
    font-size: 11px;
    color: #cbd5e1;
}
.mt-middle b { margin-top: 82px; }

/* 滚轮 */
.mt-wheel {
    position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
    width: 28px; height: 70px;
    border: 1px solid #0f172a;
    border-radius: 10px;
    background:
        repeating-linear-gradient(180deg, transparent 0, transparent 8px, rgba(226, 232, 240, .55) 9px, transparent 11px),
        linear-gradient(180deg, #94a3b8, #475569);
    box-shadow: 0 3px 7px rgba(0, 0, 0, .45), inset 0 1px rgba(255, 255, 255, .2);
    transition: transform .14s ease, background .14s ease, box-shadow .14s ease;
    pointer-events: none;
}
.mt-middle.is-down {
    color: #f0fdf4;
}
.mt-middle.is-down .mt-wheel {
    background:
        repeating-linear-gradient(180deg, transparent 0, transparent 8px, rgba(240, 253, 244, .7) 9px, transparent 11px),
        linear-gradient(180deg, #4ade80, #059669);
    transform: translateX(-50%) translateY(4px);
    box-shadow: 0 0 14px rgba(34, 197, 94, .7), 0 0 28px rgba(34, 197, 94, .35);
}
.mt-middle.is-tested:not(.is-down) {
    color: #a7f3d0;
}
.mt-middle.is-tested:not(.is-down) .mt-wheel {
    background:
        repeating-linear-gradient(180deg, transparent 0, transparent 8px, rgba(240, 253, 244, .55) 9px, transparent 11px),
        linear-gradient(180deg, #34d399, #047857);
    box-shadow: 0 0 12px rgba(52, 211, 153, .55);
}

/* 滚动时滚轮位移反馈 */
.mt-mouse.scroll-up .mt-wheel {
    background:
        repeating-linear-gradient(180deg, transparent 0, transparent 8px, rgba(250, 245, 255, .7) 9px, transparent 11px),
        linear-gradient(180deg, #c084fc, #7c3aed);
    transform: translateX(-50%) translateY(-10px);
    box-shadow: 0 0 14px rgba(168, 85, 247, .6);
}
.mt-mouse.scroll-down .mt-wheel {
    background:
        repeating-linear-gradient(180deg, transparent 0, transparent 8px, rgba(250, 245, 255, .7) 9px, transparent 11px),
        linear-gradient(180deg, #c084fc, #7c3aed);
    transform: translateX(-50%) translateY(10px);
    box-shadow: 0 0 14px rgba(168, 85, 247, .6);
}

/* 侧键：悬于鼠标图示左侧 */
.mt-side-back, .mt-side-fwd {
    position: absolute; left: -56px; z-index: 2;
    width: 46px; height: 58px;
    padding-top: 9px;
    font-size: 11px;
    border: 1px solid #1e293b;
    border-radius: 12px 5px 5px 12px;
    background: linear-gradient(160deg, #64748b, #334155);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, .12), 0 8px 16px rgba(15, 23, 42, .18);
}
.mt-side-back { top: 96px; }
.mt-side-fwd { top: 160px; }
.mt-side-back .cnt, .mt-side-fwd .cnt { margin-top: 3px; }
.mt-side-back.is-down, .mt-side-fwd.is-down {
    background: linear-gradient(160deg, #a78bfa, #6d28d9);
    color: #f5f3ff;
    transform: translateY(3px);
}
.mt-side-back.is-down .cnt, .mt-side-fwd.is-down .cnt { color: #fff; }
.mt-side-back.is-tested:not(.is-down), .mt-side-fwd.is-tested:not(.is-down) {
    background: linear-gradient(160deg, #2f9e79, #17614a);
    color: #eafff5;
}

/* 底部灯条 */
.mt-led {
    position: absolute; left: 50%; bottom: 49px; z-index: 3;
    width: 36px; height: 4px;
    border-radius: 99px;
    background: #64748b;
    transform: translateX(-50%);
    transition: background .15s ease, box-shadow .15s ease;
}
.mt-led.active {
    background: #22d3ee;
    box-shadow: 0 0 8px #22d3ee, 0 0 20px rgba(34, 211, 238, .55);
}

/* 滚轮 / 回报率测试区 */
.mt-arena {
    position: relative;
    height: 260px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background:
        radial-gradient(520px 200px at 50% 0%, rgba(34, 211, 238, 0.08), transparent 70%),
        var(--panel);
    display: flex; align-items: center; justify-content: center;
    cursor: crosshair;
    user-select: none;
    overflow: hidden;
}
.mt-arena-center { text-align: center; pointer-events: none; }
.mt-wheel-dir {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 22px;
    border-radius: var(--radius);
    background: var(--inset-bg);
    border: 1px solid var(--line);
    color: var(--text-3);
    font-size: 16px; font-weight: 800;
    transition: all .15s ease;
}
.mt-wheel-dir svg { width: 22px; height: 22px; }
.mt-wheel-dir.live { color: var(--accent); border-color: rgba(34, 211, 238, 0.55); box-shadow: 0 0 16px rgba(34, 211, 238, 0.3); }
.mt-coords { margin-top: 14px; font-size: 14px; color: var(--text-2); font-weight: 600; }

/* CPS 点击测速 */
.cps-arena {
    position: relative;
    min-height: 300px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background:
        radial-gradient(520px 220px at 50% 0%, rgba(34, 211, 238, 0.08), transparent 70%),
        var(--panel);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cps-arena.running { border-color: rgba(34, 211, 238, 0.55); box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.12); }
.cps-center { text-align: center; pointer-events: none; }
.cps-num { font-size: 64px; font-weight: 900; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 0 30px rgba(34, 211, 238, 0.35); }
.cps-text { margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.cps-timer { margin-top: 6px; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 轨迹画线 */
.trail-stage {
    position: relative;
    height: 320px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background:
        radial-gradient(520px 200px at 50% 0%, rgba(34, 211, 238, 0.06), transparent 70%),
        var(--panel);
    overflow: hidden;
    cursor: crosshair;
}
.trail-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.trail-hint {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); font-size: 13.5px;
    pointer-events: none;
}
.trail-hint.hide { display: none; }

@media (max-width: 960px) {
    .mt-layout { grid-template-columns: 1fr; }
}

/* 小屏等比缩小鼠标模型，避免侧键超出测试区 */
@media (max-width: 680px) {
    .mt-stage { min-height: 340px; }
    .mt-mouse-wrap { width: 188px; height: 265px; margin: 2px 0 14px; }
    .mt-mouse-body { border-radius: 90px 90px 65px 65px; }
    .mt-mouse-body::after { left: 22px; right: 22px; bottom: 24px; height: 57px; }
    .mt-mouse-button { height: 113px; padding-top: 26px; font-size: 12px; }
    .mt-center-channel { top: 23px; width: 42px; height: 132px; }
    .mt-middle { padding-top: 10px; }
    .mt-middle b { margin-top: 68px; }
    .mt-wheel { top: 10px; width: 24px; height: 60px; }
    .mt-led { bottom: 42px; width: 30px; }
    .mt-side-back, .mt-side-fwd { left: -46px; width: 38px; height: 52px; font-size: 10px; }
    .mt-side-back { top: 82px; }
    .mt-side-fwd { top: 138px; }
}
