/* 反应时间测试样式 */

.test-info {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-out;
}

.test-info h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    position: relative;
    display: inline-block;
    font-weight: 600;
}

.test-info h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
}

.test-description {
    max-width: 700px;
    margin: 0 auto 2rem;
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.test-description p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-light);
}

.test-description p:last-child {
    margin-bottom: 0;
}

.highlight-red {
    color: var(--accent-color);
    font-weight: 600;
}

.highlight-green {
    color: var(--secondary-color);
    font-weight: 600;
}

.test-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    min-width: 140px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.test-tips {
    max-width: 700px;
    margin: 0 auto 2rem;
    background-color: rgba(0, 122, 255, 0.08);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    text-align: left;
}

.test-tips h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.test-tips ul {
    padding-left: 1.5rem;
    margin-bottom: 0;
}

.test-tips li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.back-btn {
    margin-top: 1.5rem;
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

.back-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

.test-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4rem;
    animation: fadeIn 1s ease-out 0.3s both;
}

#reaction-box {
    width: 100%;
    max-width: 600px;
    height: 350px;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#reaction-box:hover {
    transform: scale(1.01);
}

#reaction-box:active {
    transform: scale(0.99);
}

#reaction-box.waiting {
    background-color: var(--light-color);
    color: var(--text-light);
}

#reaction-box.ready {
    background-color: var(--accent-color);
    color: white;
}

#reaction-box.go {
    background-color: var(--secondary-color);
    color: white;
}

#reaction-box.clicked {
    background-color: #f5f5f5;
    color: #333;
}

#reaction-box.early {
    background-color: #ff9800;
    color: white;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 77, 77, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 77, 77, 0);
    }
}

.instruction {
    font-size: 1rem;
    font-weight: normal;
    opacity: 0.7;
    margin-top: 1rem;
    position: absolute;
    bottom: 20px;
}

.results-area {
    width: 100%;
    max-width: 700px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#current-result {
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.attempt-container {
    margin-bottom: 2rem;
}

.attempt-container h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

.attempt-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.attempt-item {
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.attempt-item:hover {
    background-color: rgba(0, 122, 255, 0.08);
    border-left-color: var(--primary-color);
}

.final-results {
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.avg-result, .percentile, .rating-container {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: bold;
}

.avg-result {
    font-size: 1.3rem;
    color: var(--text-color);
}

.percentile {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.rating-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.rating-label {
    font-size: 1rem;
    color: var(--text-light);
}

#rating-text {
    font-size: 1.1rem;
    color: var(--text-color);
    padding: 0.3rem 1rem;
    background-color: rgba(0, 122, 255, 0.08);
    border-radius: 20px;
    display: inline-block;
}

#restart-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    transform: translateY(0);
    transition: all 0.3s ease;
    margin-top: 15px;
    font-weight: bold;
}

#restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

#restart-btn:active {
    transform: translateY(1px);
}

.share-results {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.share-results h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.share-btn {
    transition: all 0.2s ease;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    background: linear-gradient(135deg, #2962ff, #768fff);
    color: white;
    font-weight: bold;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.3);
}

.hidden {
    display: none;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.toast.visible {
    opacity: 1;
    visibility: visible;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .test-info {
        flex-direction: column;
    }
    
    .test-description {
        max-width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .test-tips {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    #reaction-box {
        height: 250px;
        font-size: 1.5rem;
    }
    
    .test-stats {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .stat-item {
        width: 100%;
        max-width: 280px;
    }
    
    .attempt-list {
        grid-template-columns: 1fr;
    }
    
    #current-result {
        font-size: 1.5rem;
    }
    
    .final-results {
        padding: 1rem;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .share-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 576px) {
    .test-area {
        padding: 1rem;
    }
    
    #reaction-box {
        height: 220px;
        font-size: 1.3rem;
    }
    
    .stat-item {
        padding: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .back-btn {
        margin-bottom: 1rem;
    }
    
    #restart-btn {
        width: 180px;
    }
}

@media (max-width: 480px) {
    .test-description {
        padding: 1rem;
    }
    
    #reaction-box {
        height: 200px;
        font-size: 1.2rem;
    }
    
    .final-results {
        padding: 0.8rem;
    }
    
    .results-area {
        padding: 1.5rem;
    }
    
    .share-results h3 {
        font-size: 1.1rem;
    }
    
    .toast {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    #reaction-box {
        height: 180px;
        font-size: 1.1rem;
    }
    
    .stat-item {
        padding: 0.5rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    #current-result {
        font-size: 1.3rem;
    }
}

/* 增强结果显示样式 */
.rating {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
}

.rating.excellent {
    background-color: #FFD700;
    color: #333;
}

.rating.great {
    background-color: #00c853;
    color: white;
}

.rating.very-good {
    background-color: #2962ff;
    color: white;
}

.rating.good {
    background-color: #2979ff;
    color: white;
}

.rating.above-average {
    background-color: #00b0ff;
    color: white;
}

.rating.average {
    background-color: #b388ff;
    color: white;
}

.rating.below-average {
    background-color: #ff9100;
    color: white;
}

.rating.needs-practice {
    background-color: #ff5252;
    color: white;
}

.rating-message {
    display: block;
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

/* 历史记录样式 */
.history-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.history-section h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #2962ff;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #f5f5f7;
    border-radius: 6px;
    font-size: 0.9rem;
}

.history-rank {
    font-weight: bold;
    color: #2962ff;
    width: 30px;
}

.history-score {
    font-weight: bold;
    flex-grow: 1;
    text-align: center;
}

.history-date {
    color: #666;
    font-size: 0.8rem;
}

.history-empty {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 10px;
} 