* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    width: 580px;
    max-width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-height: 95vh;
    overflow-y: auto;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* 标签切换 */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.tab-btn.active {
    background: #f39c12;
    color: #1e3c72;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 设置区 */
.settings {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.settings label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.settings input, .settings select {
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* 模式选择 */
.mode-select {
    margin: 12px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.mode-select > label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.95rem;
}

.mode-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    flex: 1;
    min-width: 100px;
}

.mode-option:hover {
    background: rgba(255, 255, 255, 0.15);
}

.mode-option input[type="radio"] {
    accent-color: #f39c12;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.mode-option input[type="radio"]:checked + span {
    color: #f39c12;
}

.mode-option span {
    font-weight: bold;
    font-size: 0.95rem;
}

.mode-option small {
    font-size: 0.75rem;
    color: #aaa;
    margin-left: auto;
}

/* 按钮 */
.start-btn {
    width: 100%;
    padding: 12px;
    background: #2ecc71;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.3s;
    margin: 5px 0 10px;
}

.start-btn:hover:not(:disabled) {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 警告区域 */
.warning-area {
    padding: 10px 14px;
    margin: 8px 0;
    background: rgba(241, 196, 15, 0.2);
    border: 1px solid #f39c12;
    border-radius: 8px;
    color: #f1c40f;
    font-size: 0.9rem;
    text-align: center;
}

.warning-area.error {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

/* 游戏区域 */
.game-area {
    margin-top: 10px;
}

.stats {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 5px;
}

.question-box {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin: 12px 0;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    word-break: break-all;
}

.input-area {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.input-area input {
    flex: 1;
    padding: 12px;
    font-size: 1.3rem;
    border: none;
    border-radius: 8px;
    text-align: center;
    outline: none;
}

.input-area button {
    padding: 12px 25px;
    background: #3498db;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
}

.input-area button:hover:not(:disabled) {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.input-area button:disabled,
.input-area input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback {
    text-align: center;
    font-size: 1rem;
    min-height: 35px;
    padding: 8px;
    margin: 8px 0;
}

.feedback.correct {
    color: #2ecc71;
}

.feedback.wrong {
    color: #e74c3c;
}

/* 锁屏 */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.lock-screen[style*="display: flex"] {
    display: flex !important;
}

.lock-content {
    font-size: 2.5rem;
    text-align: center;
    color: #e74c3c;
    animation: pulse 1s ease-in-out infinite;
}

.lock-content span {
    display: block;
    margin: 8px 0;
}

.lock-content .lock-reason {
    font-size: 1.2rem;
    color: #ecf0f1;
}

.lock-content .lock-timer {
    font-size: 4rem;
    font-weight: bold;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 成绩面板 */
.result-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}

.result-panel h2 {
    text-align: center;
    color: #f1c40f;
    font-size: 1.5rem;
}

.game-over-reason {
    text-align: center;
    font-size: 1.1rem;
    color: #e74c3c;
    margin: 10px 0;
    padding: 10px;
    background: rgba(231, 76, 60, 0.15);
    border-radius: 8px;
}

.result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 15px 0;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.result-stats p {
    font-size: 0.9rem;
}

.result-stats strong {
    color: #f1c40f;
}

.result-details {
    max-height: 200px;
    overflow-y: auto;
    margin: 12px 0;
}

.result-details h3 {
    margin-bottom: 8px;
    color: #ecf0f1;
    font-size: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    margin: 4px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.85rem;
    gap: 8px;
}

.detail-item .penalty {
    color: #e74c3c;
    font-weight: bold;
}

.result-panel > button {
    display: block;
    margin: 15px auto 0;
    padding: 10px 35px;
    background: #f39c12;
    border: none;
    border-radius: 8px;
    color: #1e3c72;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.result-panel > button:hover {
    transform: scale(1.05);
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #f39c12;
    border-radius: 10px;
}

/* 响应式 */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    .question-box {
        font-size: 1.8rem;
        padding: 15px;
    }
    .stats {
        font-size: 0.75rem;
    }
    .settings {
        flex-direction: column;
    }
    .result-stats {
        grid-template-columns: 1fr;
    }
    .mode-options {
        flex-direction: column;
    }
}