:root {
    --primary-color: #6C63FF;
    --primary-hover: #5753C9;
    --secondary-color: #F95738;
    --secondary-hover: #DD492F;
    --accent-color: #FFBE0B;
    --danger-color: #F94144;
    --success-color: #43AA8B;
    --light-color: #F8F9FA;
    --dark-color: #2B2D42;
    --white-color: #fff;
    --gray-color: #8D99AE;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 600px;
    width: 100%;
    background: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    min-height: 600px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 装饰元素 */
.container::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(108, 99, 255, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.container::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 250px;
    height: 250px;
    background: rgba(249, 87, 56, 0.1);
    border-radius: 50%;
    z-index: 0;
}

/* 标题样式 */
h1 {
    color: var(--primary-color);
    text-align: center;
    margin: 30px 0 20px;
    font-size: 36px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

h2 {
    color: var(--secondary-color);
    text-align: center;
    margin: 20px 0;
    font-size: 24px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* 屏幕样式 */
.screen {
    display: none !important;
    width: 100%;
    height: 0;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    padding: 30px;
    z-index: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen.active {
    display: flex !important;
    height: auto;
    overflow: visible;
    position: relative;
    z-index: 1;
    flex-direction: column;
    justify-content: center;
    animation: fadeIn 0.5s ease-in-out;
}

/* 模式选择样式 */
.mode-selection,
.difficulty-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
    align-items: center;
    width: 100%;
}

.difficulty-options label {
    width: 80%;
    max-width: 400px;
    text-align: left;
}

.difficulty-options label {
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    width: 100%;
    background: var(--light-color);
    border: 2px solid transparent;
}

.difficulty-options label:hover {
    background: rgba(108, 99, 255, 0.05);
    border-color: rgba(108, 99, 255, 0.2);
}

.difficulty-options input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

/* 按钮样式 */
.btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    margin: 8px auto;
    width: 100%;
    max-width: 300px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    display: block;
}

.btn:not(.back-btn) {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white-color);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.3);
}

.btn:not(.back-btn):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.4);
}

.back-btn {
    background: linear-gradient(135deg, var(--gray-color), #6c757d);
    color: var(--white-color);
    box-shadow: 0 5px 15px rgba(141, 153, 174, 0.3);
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(141, 153, 174, 0.4);
}

/* 游戏信息样式 */
.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    font-weight: bold;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.game-info p {
    font-size: 18px;
    color: var(--dark-color);
}

.game-info span {
    color: var(--primary-color);
    font-size: 20px;
}

/* 问题容器样式 */
.question-container {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(108, 99, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
}

.question-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    background: var(--accent-color);
    color: var(--white-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

#question {
    font-size: 32px;
    text-align: center;
    color: var(--dark-color);
    font-weight: 600;
    line-height: 1.4;
}

/* 选项容器样式 */
.options-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
    width: 100%;
}

#true-btn {
    background: linear-gradient(135deg, var(--success-color), #358c74);
    color: white;
    flex: 1;
    max-width: none;
}

#true-btn:hover {
    box-shadow: 0 8px 25px rgba(67, 170, 139, 0.4);
}

#false-btn {
    background: linear-gradient(135deg, var(--danger-color), #d33336);
    color: white;
    flex: 1;
    max-width: none;
}

#false-btn:hover {
    box-shadow: 0 8px 25px rgba(249, 65, 68, 0.4);
}

/* 结果样式 */
.result {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    min-height: 30px;
    margin-top: 15px;
    padding: 10px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.correct {
    color: var(--success-color);
    background: rgba(67, 170, 139, 0.1);
    border: 2px solid rgba(67, 170, 139, 0.3);
}

.incorrect {
    color: var(--danger-color);
    background: rgba(249, 65, 68, 0.1);
    border: 2px solid rgba(249, 65, 68, 0.3);
}

/* 游戏结束样式 */
#game-over {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#game-over p {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--dark-color);
}

#final-score {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 当final-time元素内容为空时隐藏它 */
#final-time:empty {
    display: none;
}

.result-comment {
    animation: pulse 2s infinite;
    margin: 25px 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.log-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 5px;
}

.log-container h3 {
    margin-bottom: 10px;
    color: var(--secondary-color);
    font-size: 18px;
    text-align: center;
}

.log-output {
    height: 150px;
    overflow-y: auto;
    background-color: var(--white-color);
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid #ddd;
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
        min-height: 450px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .options-container {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        padding: 10px;
    }

    #question {
        font-size: 20px;
    }

    .game-info {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
}