/* ============ 反应速度测试：仅保留工具专属样式（布局/卡片/按钮等公共样式由 common.css 提供） ============ */

/* ---------- 反应区域 ---------- */
.reaction-area {
    width: 100%;
    height: 280px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid #e5e7eb;
    user-select: none;
    -webkit-user-select: none;
}

.reaction-content {
    text-align: center;
    color: #ffffff;
}

.reaction-text {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.reaction-subtext {
    font-size: 16px;
    opacity: 0.9;
}

.state-idle { background-color: #1e293b; }
.state-waiting { background-color: #dc2626; }
.state-ready { background-color: #16a34a; }
.state-success { background-color: #2563eb; }
.state-fail { background-color: #d97706; }

/* ---------- 成绩卡（本次成绩 + 统计，合为一卡） ---------- */
.score-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.score-main {
    text-align: center;
    padding: 28px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #ddd6fe;
}

.result-time {
    font-size: 60px;
    font-weight: 800;
    color: #7c3aed;
    line-height: 1;
    letter-spacing: -1px;
}

.result-unit {
    font-size: 24px;
    font-weight: 600;
    color: #8b5cf6;
    margin-left: 6px;
}

.result-rating {
    display: inline-block;
    margin-top: 14px;
    padding: 5px 20px;
    border-radius: 999px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    background: #d97706;
}

.result-percentile {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
}

.rating-excellent { background: #dc2626; }
.rating-great { background: #ea580c; }
.rating-good { background: #ca8a04; }
.rating-normal { background: #16a34a; }
.rating-poor { background: #2563eb; }
.rating-bad { background: #6b7280; }

/* ---------- 统计 ---------- */
.score-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.stat-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-item:hover {
    border-color: #c4b5fd;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
    transform: translateY(-1px);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #374151;
}

/* ---------- 记录区 ---------- */
.records-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: start;
    margin-top: 24px;
}

.history-panel {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 500;
    color: #374151;
    font-size: 15px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 6px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: #c4b5fd;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.08);
}

.history-item.history-fail {
    background: #fef3c7;
    border-color: #f59e0b;
}

.history-index {
    font-size: 13px;
    color: #9ca3af;
    width: 45px;
}

.history-time {
    font-size: 15px;
    font-weight: 500;
    color: #374151;
}

.history-rating {
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 4px;
    background: #f3e8ff;
    color: #7c3aed;
}

@media (max-width: 768px) {
    .records-container {
        grid-template-columns: 1fr;
    }

    .score-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
