.test-tool-top.keyboard-tool-page .hero-content,
.test-tool-top.mouse-tool-page .hero-content,
.test-tool-top.reaction-tool-page .hero-content {
    position: relative;
    padding: 1.6rem 1.8rem 1.2rem;
    border-radius: 28px;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.18), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.07);
}

.test-tool-top.keyboard-tool-page .hero-content::after,
.test-tool-top.mouse-tool-page .hero-content::after,
.test-tool-top.reaction-tool-page .hero-content::after {
    content: "";
    display: block;
    width: 120px;
    height: 6px;
    margin-top: 1rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb 0%, rgba(37, 99, 235, 0.1) 100%);
}

.test-tool-top.keyboard-tool-page .hero-content::before,
.test-tool-top.mouse-tool-page .hero-content::before,
.test-tool-top.reaction-tool-page .hero-content::before {
    content: "";
    position: absolute;
    inset: auto -40px -40px auto;
    width: 180px;
    height: 180px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(191, 219, 254, 0.75) 0%, rgba(191, 219, 254, 0) 72%);
    pointer-events: none;
}

.test-tool-top .test-tool-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
    align-items: start;
}

.test-tool-top .tool-box {
    max-width: none;
}

.test-tool-top .test-panel {
    border: 1px solid #d4e4fb;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.14), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.08);
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
}

.test-tool-top .test-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.85rem;
}

.test-tool-top .tool-note {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.8;
    margin-top: 0.75rem;
}

.test-tool-top .test-panel::after {
    content: "";
    position: absolute;
    inset: auto auto -36px -36px;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(219, 234, 254, 0.6) 0%, rgba(219, 234, 254, 0) 70%);
    pointer-events: none;
}

.test-tool-top .info-grid,
.test-tool-top .metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.test-tool-top .metric-card,
.test-tool-top .info-card {
    padding: 1rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #d7e6fa;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    position: relative;
}

.test-tool-top .metric-label,
.test-tool-top .info-label {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
    margin-bottom: 0.42rem;
}

.test-tool-top .metric-value,
.test-tool-top .info-value {
    color: #0f172a;
    font-size: 1.25rem;
    font-weight: 700;
    word-break: break-word;
    line-height: 1.35;
}

.test-tool-top .metric-card::before,
.test-tool-top .info-card::before {
    content: "";
    position: absolute;
    left: 0.95rem;
    top: 0.9rem;
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa 0%, rgba(96, 165, 250, 0.05) 100%);
}

.test-tool-top .metric-label,
.test-tool-top .info-label {
    padding-top: 0.5rem;
}

.test-tool-top .event-log,
.test-tool-top .history-list {
    margin: 0;
    padding-left: 1.25rem;
    color: #475569;
    line-height: 1.85;
    font-size: 0.98rem;
}

.test-tool-top .event-log li,
.test-tool-top .history-list li {
    margin-bottom: 0.35rem;
}

.test-tool-top .keyboard-layout-picker,
.test-tool-top .keyboard-extra-tip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.test-tool-top .keyboard-extra-tip {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.8;
}

.test-tool-top .keyboard-stage {
    padding: 0.85rem;
    border-radius: 24px;
    background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
    border: 1px solid #d9e8fc;
    position: relative;
    overflow: hidden;
}

.test-tool-top .keyboard-board {
    display: grid;
    gap: 0.65rem;
    position: relative;
    width: max-content;
    transform-origin: top left;
    transform: scale(var(--keyboard-scale, 1));
}

.test-tool-top .keyboard-row {
    display: inline-flex;
    gap: 0.65rem;
    flex-wrap: nowrap;
    min-width: max-content;
}

.test-tool-top .key-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 74px;
    min-width: 0;
    flex: 1 1 0;
    padding: 0.8rem 0.45rem;
    border-radius: 16px;
    border: 1px solid #d4e4fb;
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
    color: #334155;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.06);
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.test-tool-top .key-chip strong {
    font-size: 1.18rem;
    letter-spacing: 0.01em;
}

.test-tool-top .key-chip span {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
}

.test-tool-top .key-chip.active {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border-color: #1d4ed8;
    color: #fff;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.24);
}

.test-tool-top .key-chip.active span {
    color: rgba(255, 255, 255, 0.85);
}

.test-tool-top .key-chip.key-wide-125 { flex-grow: 1.25; }
.test-tool-top .key-chip.key-wide-150 { flex-grow: 1.5; }
.test-tool-top .key-chip.key-wide-175 { flex-grow: 1.75; }
.test-tool-top .key-chip.key-wide-200 { flex-grow: 2; }
.test-tool-top .key-chip.key-wide-225 { flex-grow: 2.25; }
.test-tool-top .key-chip.key-wide-275 { flex-grow: 2.75; }
.test-tool-top .key-chip.key-wide-625 { flex-grow: 6.25; }

.test-tool-top .key-chip.key-gap {
    visibility: hidden;
    pointer-events: none;
}

.test-tool-top.keyboard-tool-page .test-panel:first-child {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.test-tool-top.keyboard-tool-page .keyboard-board {
    background:
        linear-gradient(180deg, #edf4ff 0%, #e7f0ff 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 18px 36px rgba(37, 99, 235, 0.08);
}

.test-tool-top.keyboard-tool-page .keyboard-layout-picker .screen-btn {
    min-width: 106px;
}

.test-tool-top.keyboard-tool-page .metric-card {
    background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
}

.test-tool-top .mouse-stage {
    position: relative;
    min-height: 380px;
    border-radius: 22px;
    border: 2px dashed #93c5fd;
    background: radial-gradient(circle at center, rgba(219, 234, 254, 0.9) 0%, rgba(239, 246, 255, 0.9) 70%, rgba(248, 250, 252, 1) 100%);
    overflow: hidden;
    user-select: none;
}

.test-tool-top .mouse-stage-copy {
    padding: 1.15rem;
    color: #334155;
    max-width: 360px;
    line-height: 1.85;
    font-size: 1rem;
    font-weight: 500;
}

.test-tool-top .mouse-crosshair {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.16);
    border: 3px solid rgba(37, 99, 235, 0.55);
    pointer-events: none;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 50%;
}

.test-tool-top .mouse-button-row {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.test-tool-top .mouse-button {
    flex: 1;
    padding: 0.9rem 0.6rem;
    border-radius: 16px;
    border: 1px solid #d7e6fa;
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
    text-align: center;
    color: #475569;
    font-weight: 700;
}

.test-tool-top .mouse-button.active {
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #60a5fa;
    color: #1d4ed8;
}

.test-tool-top.mouse-tool-page .test-panel:first-child {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f5faff 100%);
}

.test-tool-top.mouse-tool-page .mouse-stage {
    background:
        radial-gradient(circle at 78% 12%, rgba(96, 165, 250, 0.24), transparent 12%),
        radial-gradient(circle at center, rgba(219, 234, 254, 0.9) 0%, rgba(239, 246, 255, 0.94) 68%, rgba(248, 250, 252, 1) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.test-tool-top.mouse-tool-page .mouse-button {
    letter-spacing: 0.04em;
}

.test-tool-top .screen-preview {
    display: grid;
    gap: 0.9rem;
}

.test-tool-top .screen-canvas {
    min-height: 380px;
    border-radius: 22px;
    border: 1px solid #cbd5e1;
    background: var(--screen-bg, #ffffff);
    color: var(--screen-fg, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.2rem;
    transition: background 0.18s ease, color 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.test-tool-top .screen-canvas.mode-grid {
    background-image:
        linear-gradient(90deg, rgba(15, 23, 42, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
}

.test-tool-top .screen-canvas.mode-gradient {
    background: linear-gradient(135deg, #111827 0%, #1d4ed8 25%, #22c55e 50%, #facc15 75%, #ef4444 100%);
    color: #fff;
}

.test-tool-top .screen-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.test-tool-top .screen-btn,
.test-tool-top .action-btn {
    border: 1px solid #cfdced;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #0f172a;
    border-radius: 14px;
    padding: 0.82rem 1.05rem;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
    font-weight: 600;
}

.test-tool-top .screen-btn:hover,
.test-tool-top .action-btn:hover {
    border-color: #2563eb;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.test-tool-top .screen-btn.active {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    border-color: #60a5fa;
}

.test-tool-top .reaction-app {
    display: grid;
    gap: 1rem;
}

.test-tool-top .reaction-stage {
    min-height: 380px;
    border-radius: 24px;
    border: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #0f172a;
    color: #fff;
    padding: 1.6rem;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.12s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.test-tool-top .reaction-stage:hover {
    transform: translateY(-1px);
}

.test-tool-top .reaction-stage.waiting {
    background: #f59e0b;
}

.test-tool-top .reaction-stage.ready {
    background: #22c55e;
}

.test-tool-top .reaction-stage.early {
    background: #ef4444;
}

.test-tool-top .reaction-stage.result {
    background: #1d4ed8;
}

.test-tool-top.reaction-tool-page .test-panel:first-child {
    background:
        radial-gradient(circle at top left, rgba(250, 204, 21, 0.18), transparent 24%),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.test-tool-top.reaction-tool-page .reaction-stage {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #0f172a 0%, #111f38 100%);
}

.test-tool-top.reaction-tool-page .reaction-stage.waiting {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.test-tool-top.reaction-tool-page .reaction-stage.ready {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.1), transparent 30%),
        linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.test-tool-top.reaction-tool-page .reaction-stage.early {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.test-tool-top.reaction-tool-page .reaction-stage.result {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 30%),
        linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

.test-tool-top.reaction-tool-page .action-btn {
    min-width: 132px;
}

.test-tool-top.reaction-tool-page .metric-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.test-tool-top.reaction-tool-page .history-list {
    padding: 1rem 1rem 1rem 2rem;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid #e2e8f0;
}

.test-tool-top.keyboard-tool-page .event-log,
.test-tool-top.reaction-tool-page .history-list {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.test-tool-top.keyboard-tool-page .event-log {
    padding: 1rem 1rem 1rem 2rem;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid #e2e8f0;
}

.test-tool-top .reaction-stage-inner {
    max-width: 520px;
}

.test-tool-top .reaction-main {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.7rem;
}

.test-tool-top .reaction-sub {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.75;
}

.test-tool-top .action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.test-tool-top .action-btn.primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.test-tool-top .action-btn.danger-soft {
    background: #fff7f7;
    color: #b91c1c;
    border-color: #fecaca;
}

.test-tool-top .history-inline {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.85;
}

@media (max-width: 900px) {
    .test-tool-top .test-tool-layout,
    .test-tool-top .info-grid,
    .test-tool-top .metric-grid {
        grid-template-columns: 1fr;
    }

    .test-tool-top .test-panel {
        padding: 1rem;
        border-radius: 18px;
    }

    .test-tool-top .keyboard-stage {
        padding: 0.7rem;
    }
}

@media (max-width: 640px) {
    .test-tool-top .key-chip {
        min-height: 58px;
        padding: 0.65rem 0.35rem;
    }

    .test-tool-top .key-chip strong {
        font-size: 1rem;
    }

    .test-tool-top .key-chip span {
        font-size: 0.7rem;
    }

    .test-tool-top .mouse-stage,
    .test-tool-top .screen-canvas,
    .test-tool-top .reaction-stage {
        min-height: 300px;
    }

    .test-tool-top .mouse-button-row,
    .test-tool-top .screen-controls,
    .test-tool-top .action-row {
        flex-direction: column;
    }
}
