body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #1a1a2e;
    color: #eaeaea;
    transition: background-color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.container {
    text-align: center;
    margin: 20px auto;
    padding: 0 15px;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1 {
    color: #4cc9f0;
    margin: 20px 0 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.instructions {
    background-color: rgba(76, 201, 240, 0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    text-align: left;
    border: 1px solid rgba(76, 201, 240, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.instructions h3 {
    color: #4cc9f0;
    margin-top: 0;
}

.control-panel {
    margin: 20px 0;
    padding: 25px;
    background-color: #16213e;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.test-count-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.test-count-option {
    display: flex;
    align-items: center;
}

.test-count-option input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.test-count-option label {
    color: #eaeaea;
    font-size: 16px;
    cursor: pointer;
}

.game-container {
    position: relative;
    width: 100%;
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    overflow: hidden;
}

.circle {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background-color: #e63946;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 30px rgba(230, 57, 70, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 28px;
    font-weight: bold;
    border: 4px solid rgba(255, 255, 255, 0.1);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation; /* 优化触摸设备体验 */
}

.circle.green {
    background-color: #4cc9f0;
    transform: scale(1.15);
    box-shadow: 0 0 40px rgba(76, 201, 240, 0.8), 0 0 60px rgba(76, 201, 240, 0.4);
}

.circle.red {
    background-color: #e63946;
    box-shadow: 0 0 40px rgba(230, 57, 70, 0.8), 0 0 60px rgba(230, 57, 70, 0.4);
}

.circle.pulse {
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(1.4);
    }
    100% {
        transform: scale(1.15);
    }
}

.countdown {
    font-size: 90px;
    font-weight: bold;
    color: #4cc9f0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 0 0 20px rgba(76, 201, 240, 0.5);
    z-index: 10;
}

.countdown-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.countdown-chart {
    width: 80%;
    max-width: 600px;
    height: 200px;
    margin-top: 40px;
    opacity: 0.8;
}

.results {
    margin-top: 30px;
    padding: 25px;
    background-color: #16213e;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

#chart-container {
    width: 100%;
    height: 320px;
    margin: 25px auto;
    max-width: 800px;
}

.stats {
    margin: 25px 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background-color: #4cc9f0;
    border-color: #43b6d7;
    color: #1a1a2e;
    font-weight: bold;
    transition: all 0.2s;
    padding: 10px 25px;
    font-size: 18px;
}

.btn-primary:hover {
    background-color: #3dbae8;
    border-color: #35a6d1;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.3);
    color: #1a1a2e;
}

.btn-success {
    background-color: #4cc9f0;
    border-color: #43b6d7;
    color: #1a1a2e;
    font-weight: bold;
    transition: all 0.2s;
    padding: 10px 25px;
    font-size: 18px;
}

.btn-success:hover {
    background-color: #3dbae8;
    border-color: #35a6d1;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.3);
    color: #1a1a2e;
}

.message {
    font-size: 24px;
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    display: none;
    font-weight: bold;
}

.message.error {
    background-color: rgba(230, 57, 70, 0.2);
    color: #e63946;
    border: 1px solid rgba(230, 57, 70, 0.4);
    display: block;
}

.message.success {
    background-color: rgba(76, 201, 240, 0.2);
    color: #4cc9f0;
    border: 1px solid rgba(76, 201, 240, 0.4);
    display: block;
}

.rating {
    font-size: 36px;
    margin: 20px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.progress-info {
    margin: 25px 0;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 18px;
}

.footer {
    margin-top: 40px;
    padding: 20px;
    background-color: #16213e;
    color: #a0a0a0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .circle {
        width: 180px;
        height: 180px;
        font-size: 24px;
    }

    .countdown {
        font-size: 70px;
    }

    .game-container {
        height: 400px;
    }

    .countdown-chart {
        width: 90%;
        height: 150px;
    }

    #chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .circle {
        width: 150px;
        height: 150px;
        font-size: 20px;
    }

    .countdown {
        font-size: 50px;
    }

    .game-container {
        height: 300px;
    }

    .btn-primary, .btn-success {
        width: 100%;
        margin-bottom: 10px;
    }

    .results .btn-success {
        margin-left: 0;
        margin-top: 10px;
    }

    .test-count-options {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
        justify-content: center;
    }
}