* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* 开始页面 */
.start-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logo {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.title {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-item .icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.info-item span:last-child {
    font-size: 12px;
    color: #666;
}

.btn {
    width: 100%;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.category-select {
    margin-top: 20px;
}

.category-select h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.category-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.category-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: white;
}

/* 答题页面 */
.game-page {
    padding: 20px;
}

.game-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.back-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.back-btn:active {
    transform: translateY(0);
}

.game-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .back-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .game-stats {
        gap: 10px;
        font-size: 12px;
    }
    
    .game-header {
        padding: 15px;
    }
    
    .game-header-top {
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .back-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .game-stats {
        gap: 8px;
        font-size: 11px;
        flex-wrap: wrap;
    }
    
    .game-header {
        padding: 12px;
    }
    
    .game-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 10px;
    }
}

@media (max-width: 360px) {
    .back-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .game-header {
        padding: 10px;
    }
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.stat {
    color: #666;
}

.stat.timer {
    color: #e74c3c;
    font-weight: bold;
}

.question-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.question-category {
    display: inline-block;
    padding: 5px 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 12px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.question-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
}

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

.option {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.option:active {
    transform: scale(0.98);
    background: #f0f0f0;
}

.option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

@media (hover: none) {
    .option:hover {
        background: white;
        border-color: #e0e0e0;
    }
}

.option.selected {
    border-color: #667eea;
    background: #eef2ff;
}

.option.correct {
    border-color: #27ae60;
    background: #e8f5e9;
}

.option.incorrect {
    border-color: #e74c3c;
    background: #ffebee;
}

.option.disabled {
    pointer-events: none;
}

.option-letter {
    width: 28px;
    height: 28px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    font-weight: bold;
    font-size: 14px;
    color: #666;
}

.option.selected .option-letter,
.option:hover .option-letter {
    background: #667eea;
    color: white;
}

.option.correct .option-letter {
    background: #27ae60;
    color: white;
}

.option.incorrect .option-letter {
    background: #e74c3c;
    color: white;
}

.option-text {
    font-size: 15px;
    color: #333;
}

.feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    display: none;
}

.feedback.show {
    display: block;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.game-footer {
    margin-top: 20px;
}

/* 结果页面 */
.result-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.result-icon {
    font-size: 100px;
    margin-bottom: 20px;
}

.result-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 30px;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
}

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

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
}

.result-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.result-actions {
    display: flex;
    gap: 15px;
}

.result-actions .btn {
    flex: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page {
        padding: 15px;
    }
    
    .start-container,
    .result-container {
        padding: 30px 20px;
        max-width: 100%;
    }
    
    .logo {
        font-size: 60px;
        margin-bottom: 15px;
    }
    
    .title,
    .result-title {
        font-size: 22px;
    }
    
    .game-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
        gap: 15px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: center;
        min-width: 80px;
    }
    
    .category-buttons {
        gap: 8px;
    }
    
    .category-btn {
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .game-header {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .game-stats {
        font-size: 12px;
        gap: 8px;
    }
    
    .question-container {
        padding: 20px 15px;
    }
    
    .question-category {
        font-size: 11px;
        padding: 4px 12px;
        margin-bottom: 15px;
    }
    
    .question-text {
        font-size: 16px;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    
    .option {
        padding: 12px 15px;
        font-size: 14px;
        min-height: 50px;
    }
    
    .option-letter {
        width: 24px;
        height: 24px;
        font-size: 12px;
        margin-right: 12px;
    }
    
    .option-text {
        font-size: 14px;
    }
    
    .feedback {
        font-size: 14px;
        padding: 12px;
        margin-top: 15px;
    }
    
    .back-btn {
        top: 15px;
        left: 15px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .game-header {
        padding: 20px 15px 15px 60px;
    }
    
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .result-message {
        font-size: 14px;
        padding: 12px;
    }
    
    .result-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 10px;
    }
    
    .start-container,
    .result-container {
        padding: 25px 15px;
    }
    
    .logo {
        font-size: 50px;
        margin-bottom: 12px;
    }
    
    .title,
    .result-title {
        font-size: 20px;
    }
    
    .subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }
    
    .game-info {
        gap: 10px;
    }
    
    .info-item .icon {
        font-size: 20px;
    }
    
    .info-item span:last-child {
        font-size: 11px;
    }
    
    .category-select h3 {
        font-size: 13px;
    }
    
    .category-buttons {
        gap: 6px;
    }
    
    .category-btn {
        padding: 8px 10px;
        font-size: 10px;
    }
    
    .game-header {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .progress-bar {
        height: 6px;
        margin-bottom: 12px;
    }
    
    .game-stats {
        font-size: 11px;
        flex-wrap: wrap;
    }
    
    .stat {
        padding: 2px 5px;
    }
    
    .question-container {
        padding: 15px 12px;
    }
    
    .question-category {
        font-size: 10px;
        padding: 3px 10px;
        margin-bottom: 12px;
    }
    
    .question-text {
        font-size: 15px;
        margin-bottom: 15px;
        line-height: 1.4;
    }
    
    .options-container {
        gap: 10px;
    }
    
    .option {
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 13px;
        min-height: 45px;
    }
    
    .option-letter {
        width: 22px;
        height: 22px;
        font-size: 11px;
        margin-right: 10px;
    }
    
    .option-text {
        font-size: 13px;
    }
    
    .feedback {
        font-size: 13px;
        padding: 10px;
        margin-top: 12px;
        border-radius: 8px;
    }
    
    .game-footer {
        margin-top: 15px;
    }
    
    .result-icon {
        font-size: 80px;
        margin-bottom: 15px;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-item {
        padding: 12px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .result-message {
        font-size: 13px;
        padding: 10px;
        margin-bottom: 20px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
        margin-bottom: 10px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .logo {
        font-size: 45px;
    }
    
    .title,
    .result-title {
        font-size: 18px;
    }
    
    .question-text {
        font-size: 14px;
    }
    
    .option {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 40px;
    }
    
    .option-letter {
        width: 20px;
        height: 20px;
        font-size: 10px;
        margin-right: 8px;
    }
    
    .option-text {
        font-size: 12px;
    }
    
    .category-buttons {
        flex-direction: column;
    }
    
    .category-btn {
        width: 100%;
        text-align: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page:not(.hidden) {
    animation: fadeIn 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.3s ease-in-out;
}

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

.pulse {
    animation: pulse 0.5s ease-in-out;
}