#battle-screen {
    background: linear-gradient(to bottom, #1e1b4b 0%, #312e81 100%);
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.battle-ui {
    position: relative;
    z-index: 10;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-bottom: 100px;
}

/* 战斗头部 - 固定浮动在顶端 */
.battle-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 2px solid #3b82f6;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* 为固定头部留出空间 */
.battle-ui {
    padding-top: 100px; /* 头部高度 + 间距 */
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-info .avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 3px solid var(--primary);
}

.player-info .hp-text {
    font-size: 12px;
    text-align: center;
    color: var(--text-muted);
    margin-top: 4px;
}

.battle-timer {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    border: 3px solid var(--warning);
    color: var(--warning);
    animation: pulse 2s infinite;
}

.enemy-info {
    text-align: right;
}

.enemy-info .enemy-name {
    font-size: 18px;
    font-weight: bold;
    color: #fbbf24;
    margin-bottom: 8px;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}

/* 进度条 - 固定在头部下方 */
.battle-progress {
    position: fixed;
    top: 90px; /* 头部高度 */
    left: 0;
    right: 0;
    z-index: 99;
    background: rgba(15, 23, 42, 0.95);
    padding: 10px 20px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
    backdrop-filter: blur(10px);
}

.battle-progress .progress-info {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.battle-progress .progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.battle-progress .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* 敌人舞台 - 调整位置避免被遮挡 */
.enemy-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 150px;
    max-height: 30vh;
    margin-top: 60px; /* 为进度条留出空间 */
}

.enemy-sprite {
    font-size: 120px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    transition: all 0.3s;
}

/* 题目面板 */
.question-panel {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    color: #1e293b;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.3);
    min-height: auto;
    max-height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.question-type {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.question-word {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: #0f172a;
    margin: 15px 0;
    word-break: break-word;
}

/* 语音按钮样式 */
.phonetic-box {
    display: inline-flex;
    align-items: center;
    background: rgba(99, 102, 241, 0.1);
    padding: 8px 16px;
    border-radius: 25px;
    color: var(--primary);
    font-family: 'Times New Roman', serif;
    font-size: 20px;
    margin: 10px 0;
    border: 2px solid rgba(99, 102, 241, 0.2);
    flex-wrap: wrap;
    gap: 8px;
}

.audio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    margin-left: 10px;
    vertical-align: middle;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    position: relative;
    flex-shrink: 0;
}

.audio-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.audio-btn:active {
    transform: scale(0.95);
}

.audio-btn.playing {
    animation: soundWave 1.2s ease-in-out infinite;
    background: linear-gradient(135deg, #10b981, #059669);
}

/* 例句框 */
.example-box {
    background: rgba(251, 191, 36, 0.1);
    border-left: 4px solid #fbbf24;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 12px 12px 0;
    position: relative;
    padding-right: 50px;
    word-break: break-word;
}

.example-box .example-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 600;
}

.example-box .example-text {
    font-size: 16px;
    color: #475569;
    line-height: 1.5;
    padding-right: 10px;
}

.example-box .audio-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    font-size: 16px;
}

.example-box .audio-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

/* 选项区域 */
.answer-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.option-btn {
    padding: 15px;
    border: 3px solid #e2e8f0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    transition: all 0.2s;
    color: #334155;
    word-break: break-word;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.option-btn:hover {
    border-color: var(--primary);
    background: #eef2ff;
    transform: translateY(-2px);
}

.option-btn.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #15803d;
    animation: correctPulse 0.5s ease;
}

.option-btn.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
    animation: shake 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 输入区域 */
.input-area {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.input-area input {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
    text-transform: lowercase;
    outline: none;
    transition: border-color 0.2s;
}

.input-area input:focus {
    border-color: var(--primary);
}

.input-area button {
    padding: 15px 30px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.input-area button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* 战斗控制按钮 */
.battle-controls {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    position: sticky;
    bottom: 20px;
    margin-top: auto;
    background: rgba(30, 27, 75, 0.9);
    padding: 10px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    z-index: 20;
}

.skill-btn {
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.skill-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.flee-btn {
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.flee-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

/* 战斗结果面板 - 默认强制隐藏 */
.battle-result {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

/* 显示状态：通过添加 active 类触发 */
.battle-result.active {
    display: flex !important;
    animation: fadeIn 0.4s ease;
}

/* 入场动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 胜利/失败样式区分 */
.battle-result.victory {
    border: 2px solid rgba(16, 185, 129, 0.3);
    box-shadow: inset 0 0 100px rgba(16, 185, 129, 0.1);
}

.battle-result.defeat {
    border: 2px solid rgba(239, 68, 68, 0.3);
    box-shadow: inset 0 0 100px rgba(239, 68, 68, 0.1);
}

/* 结果标题动画 */
.battle-result h2 {
    animation: slideUp 0.5s ease 0.1s both;
    text-align: center;
}

/* 奖励区域动画 */
.rewards {
    animation: slideUp 0.5s ease 0.2s both;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 按钮动画 */
.battle-result .btn-primary {
    animation: slideUp 0.5s ease 0.3s both;
    min-width: 200px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 600px) {
    .battle-header {
        padding: 8px 12px;
        gap: 10px;
    }
    
    .battle-header .avatar {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    
    .battle-timer {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .enemy-info .enemy-name {
        font-size: 14px;
    }
    
    .battle-ui {
        padding-top: 90px;
    }
    
    .battle-progress {
        top: 80px;
        padding: 8px 12px;
    }
    
    .enemy-stage {
        margin-top: 50px;
        min-height: 120px;
    }
    
    .enemy-sprite {
        font-size: 80px;
    }
    
    .battle-controls {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 8px;
    }
    
    .skill-btn {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .flee-btn {
        grid-column: span 3;
    }
}

/* 填空题样式 */
.fill-blank-box {
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 24px;
    margin: 16px 0;
    text-align: center;
}

.fill-blank-box .blank-sentence {
    font-size: 1.1rem;
    color: #0f172a;
    line-height: 1.8;
    margin-bottom: 12px;
    font-weight: 500;
}

.fill-blank-box .blank-hint {
    color: #64748b;
    font-size: 0.9rem;
}

/* 考点标签样式 */
.exam-point-tag {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid #fbbf24;
    border-radius: 20px;
    padding: 6px 14px;
    margin: 12px 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.exam-point-tag:hover {
    background: rgba(251, 191, 36, 0.25);
    transform: scale(1.02);
}

.exam-point-tag .tag-label {
    color: #fbbf24;
    font-size: 0.85rem;
    font-weight: bold;
}

.exam-point-tag .tag-rate {
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 收藏按钮样式 */
.collect-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    border-radius: 10px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collect-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    transform: scale(1.1);
}

/* 伤害数字动画 */
.damage-number {
    position: absolute;
    animation: floatUp 1s ease-out forwards;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

@keyframes floatUp {
    0% { transform: translate(-50%, 0) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -30px) scale(1.3); opacity: 0.8; }
    100% { transform: translate(-50%, -60px) scale(1.5); opacity: 0; }
}

/* 战斗统计样式 */
.battle-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0;
    padding: 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.battle-stats .stat-item {
    text-align: center;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.battle-stats .bonus-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #fbbf24;
    font-weight: bold;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 8px;
}