/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --success-color: #8BC34A;
    --bg-light: #f5f5f5;
    --bg-dark: #333;
    --text-primary: #333;
    --text-secondary: #666;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
    --gold: #FFD700;
    --purple: #9C27B0;
    --pink: #E91E63;
    --cyan: #00BCD4;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    overflow: hidden;
}

#app {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 屏幕容器 ===== */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease;
}

/* 通用隐藏类 */
.hidden {
    display: none !important;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* ===== 主菜单 ===== */
.menu-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.5s ease;
}

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

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

.game-subtitle {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.menu-character {
    margin: 20px 0;
}

.character-sprite {
    font-size: 4em;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

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

.character-name {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-primary);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

/* ===== 按钮样式 ===== */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

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

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 2px solid #ddd;
}

.btn-icon {
    font-size: 1.2em;
}

.menu-footer {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.footer-text {
    margin-top: 5px;
}

/* ===== 信息容器 ===== */
.info-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.info-container h2 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* ===== 玩法说明 ===== */
.howto-section {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 10px;
}

.howto-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.howto-section ul {
    padding-left: 20px;
}

.howto-section li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.btn-back {
    margin-top: 20px;
    width: 100%;
}

/* ===== 知识图鉴 ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.card-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.card-item:not(.locked):hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.card-number {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.card-title-small {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.card-preview {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.locked-text {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== 关卡选择 ===== */
.level-select-container {
    max-width: 700px;
}

.progress-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.progress-info p {
    margin: 5px 0;
}

.progress-info span {
    font-weight: bold;
    font-size: 1.2em;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.level-item {
    background: white;
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.level-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-item:hover::before {
    opacity: 1;
}

.level-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.level-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.level-item.locked:hover {
    transform: none;
    box-shadow: none;
}

.level-item.completed {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
}

.level-item.boss {
    border-color: var(--danger-color);
    border-width: 4px;
}

.level-item.boss .level-enemy {
    font-size: 3.5em;
}

.level-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.level-enemy {
    font-size: 3em;
    margin: 10px 0;
}

.level-name {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 0.95em;
}

.level-scene {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.level-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: bold;
    margin-top: 5px;
}

.level-item:not(.completed):not(.locked) .level-status {
    background: var(--warning-color);
    color: white;
}

.level-item.completed .level-status {
    background: var(--success-color);
    color: white;
}

.level-item.locked .level-status {
    background: var(--text-secondary);
    color: white;
}

.level-stars {
    margin-top: 5px;
    font-size: 1.2em;
}

.level-stars .star {
    color: #ddd;
}

.level-stars .star.earned {
    color: #FFD700;
}

/* ===== 游戏界面 ===== */
#game-screen {
    background: linear-gradient(180deg, #87CEEB 0%, #E0F7FA 100%);
}

.status-bar {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: var(--shadow);
    z-index: 100;
    max-width: 95vw;
}

.status-left,
.status-center,
.status-right {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.status-center {
    align-items: center;
}

.status-bar .label {
    font-weight: bold;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.status-bar .value {
    color: var(--primary-color);
    font-weight: bold;
}

.status-bar .separator {
    color: var(--text-secondary);
    margin: 0 3px;
}

.level-indicator,
.rank-indicator,
.score-indicator,
.skill-points {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.9em;
}

.hearts {
    display: flex;
    gap: 3px;
}

.heart {
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.heart.lost {
    opacity: 0.3;
    filter: grayscale(100%);
}

.exp-bar {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
}

.exp-fill-container {
    width: 80px;
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.exp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.5s ease;
    border-radius: 5px;
}

.exp-text {
    font-size: 0.8em;
    color: var(--text-secondary);
    min-width: 50px;
}

.pause-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pause-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.highlight {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2em;
}

.game-area {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
}

/* ===== 战斗场景 ===== */
.battle-scene {
    width: 90%;
    max-width: 800px;
    height: 350px;
    position: relative;
    margin-bottom: 20px;
}

.scene-background {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
}

/* 场景样式 */
.scene-plains {
    background: linear-gradient(180deg, #87CEEB 0%, #90EE90 100%);
}

.scene-mountain {
    background: linear-gradient(180deg, #87CEEB 0%, #D2B48C 100%);
}

.scene-volcano {
    background: linear-gradient(180deg, #FF4500 0%, #8B0000 100%);
}

.scene-desert {
    background: linear-gradient(180deg, #F4A460 0%, #DEB887 100%);
}

.scene-swamp {
    background: linear-gradient(180deg, #556B2F 0%, #2F4F4F 100%);
}

.scene-crown {
    background: linear-gradient(180deg, #4B0082 0%, #000000 100%);
}

.enemy-area {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.enemy-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.enemy-sprite {
    font-size: 5em;
    animation: enemyIdle 2s infinite ease-in-out;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
    position: relative;
}

/* 怪物特定样式 */
.enemy-sprite.dandruff {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    animation: dandruffFloat 3s infinite ease-in-out;
}

@keyframes dandruffFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(5deg); }
    50% { transform: translateY(-5px) rotate(-5deg); }
    75% { transform: translateY(-12px) rotate(3deg); }
}

.enemy-sprite.oily {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    animation: oilyGlow 2s infinite alternate;
}

@keyframes oilyGlow {
    0% { filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6)); }
    100% { filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.9)); }
}

.enemy-sprite.dry {
    filter: sepia(0.5) drop-shadow(0 0 10px rgba(210, 180, 140, 0.5));
    animation: dryCrack 4s infinite;
}

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

.enemy-sprite.boss {
    font-size: 6em;
    filter: drop-shadow(0 0 30px rgba(255, 0, 0, 0.8));
    animation: bossPulse 1.5s infinite ease-in-out;
}

@keyframes bossPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 30px rgba(255, 0, 0, 0.8)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 50px rgba(255, 0, 0, 1)); }
}

.enemy-sprite.final-boss {
    font-size: 7em;
    filter: drop-shadow(0 0 40px rgba(128, 0, 128, 0.9));
    animation: finalBossAura 2s infinite ease-in-out;
}

@keyframes finalBossAura {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 40px rgba(128, 0, 128, 0.9));
    }
    50% {
        transform: scale(1.15) rotate(5deg);
        filter: drop-shadow(0 0 60px rgba(75, 0, 130, 1));
    }
}

/* 怪物背景光环 */
.enemy-container::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    z-index: -1;
    animation: auraGlow 3s infinite ease-in-out;
}

@keyframes auraGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes enemyIdle {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

.enemy-sprite.attacking {
    animation: enemyAttack 0.5s ease;
}

@keyframes enemyAttack {
    0% { transform: translateX(0); }
    25% { transform: translateX(20px); }
    50% { transform: translateX(-20px); }
    75% { transform: translateX(20px); }
    100% { transform: translateX(0); }
}

.enemy-sprite.hurt {
    animation: enemyHurt 0.5s ease;
}

@keyframes enemyHurt {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(2) hue-rotate(180deg); }
}

.enemy-sprite.defeated {
    animation: enemyDefeat 1s ease forwards;
}

@keyframes enemyDefeat {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
    100% { opacity: 0; transform: scale(0) rotate(360deg); }
}

.enemy-name {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--danger-color);
    margin-top: 10px;
    text-shadow: 1px 1px 2px white;
}

.enemy-health-bar {
    width: 150px;
    height: 15px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
    border: 2px solid white;
}

.enemy-health-fill {
    height: 100%;
    background: linear-gradient(90deg, #f44336, #ff9800);
    transition: width 0.5s ease;
    border-radius: 10px;
}

.player-area {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 30px;
}

.character-container,
.grandpa-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-sprite,
.grandpa-sprite {
    font-size: 3.5em;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.3));
}

.player-sprite.attacking {
    animation: playerAttack 0.5s ease;
}

@keyframes playerAttack {
    0% { transform: translateX(0); }
    50% { transform: translateX(30px) scale(1.2); }
    100% { transform: translateX(0); }
}

.player-sprite.hurt {
    animation: playerHurt 0.5s ease;
}

@keyframes playerHurt {
    0%, 100% { filter: brightness(1); }
    25%, 75% { filter: brightness(0.5); }
    50% { filter: brightness(1.5) hue-rotate(180deg); }
}

.character-name {
    font-size: 0.9em;
    font-weight: bold;
    color: var(--text-primary);
    margin-top: 5px;
    text-shadow: 1px 1px 2px white;
}

/* ===== 对话框 ===== */
.dialogue-box {
    width: 90%;
    max-width: 700px;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 15px;
    animation: slideUp 0.3s ease;
}

.speaker {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.dialogue-content {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 1.05em;
}

/* ===== 问题框 ===== */
.question-box {
    width: 90%;
    max-width: 700px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    color: white;
}

.question-text {
    font-size: 1.3em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
}

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

.option-btn {
    padding: 15px 20px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 3px solid #4a5568;
    border-radius: 10px;
    color: #ffffff;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.option-btn:hover {
    background: linear-gradient(135deg, #34495e 0%, #3d566e 100%);
    border-color: #5a6578;
    transform: translateX(5px) translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.option-btn.correct {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
    border-color: #229954 !important;
    color: #ffffff !important;
    animation: correctPulse 0.6s ease;
}

.option-btn.wrong {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%) !important;
    border-color: #b03a2e !important;
    color: #ffffff !important;
    animation: wrongShake 0.5s ease;
}

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

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

/* ===== 知识卡片弹出 ===== */
.knowledge-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.knowledge-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 2em;
}

.card-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--text-primary);
}

.card-number {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.card-content h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4em;
}

.card-explanation {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.card-explanation p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--text-primary);
}

.card-explanation strong {
    color: var(--danger-color);
}

.card-solution,
.card-mnemonic {
    background: white;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
}

.solution-label,
.mnemonic-label {
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.solution-content,
.mnemonic-content {
    font-size: 1.1em;
    color: var(--text-primary);
}

.mnemonic-content {
    font-style: italic;
    color: var(--primary-color);
}

.card-btn {
    width: 100%;
    margin-top: 15px;
}

/* ===== 战斗结果 ===== */
.battle-result {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.result-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.result-title {
    font-size: 2em;
    font-weight: bold;
    color: var(--success-color);
    margin-bottom: 15px;
}

.result-message {
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.result-rewards {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.reward-item {
    color: var(--primary-color);
    font-weight: bold;
}

/* ===== 游戏结束/通关 ===== */
.result-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    padding-bottom: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s ease;
}

.complete-content {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    max-height: calc(90vh - 150px);
}

.game-over-icon,
.complete-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.game-over-content h2 {
    color: var(--danger-color);
    margin-bottom: 15px;
}

.complete-content h2 {
    color: var(--success-color);
    margin-bottom: 15px;
}

.encouragement,
.complete-message {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.1em;
}

.final-stats {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
}

.final-stats p {
    margin: 10px 0;
    color: var(--text-primary);
}

.final-stats span {
    color: var(--primary-color);
    font-weight: bold;
}

.game-over-buttons,
.complete-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== 证书 ===== */
.certificate {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
}

.certificate-border {
    border: 5px solid white;
    padding: 20px;
    border-radius: 10px;
}

.certificate-title {
    font-size: 2em;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 15px;
}

.certificate-name {
    font-size: 1.3em;
    color: white;
    margin-bottom: 15px;
}

.certificate-text {
    color: white;
    line-height: 1.8;
    font-size: 1.1em;
}

.certificate-signature {
    margin-top: 20px;
    text-align: right;
}

.signature-line {
    display: inline-block;
    border-top: 2px solid white;
    padding-top: 5px;
    color: white;
    font-style: italic;
}

.final-knowledge {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: var(--bg-light);
    border-radius: 10px;
}

.final-knowledge h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    background: var(--bg-light);
    padding: 5px 0;
}

.knowledge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.knowledge-item {
    background: var(--success-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .game-title {
        font-size: 2em;
    }

    .battle-scene {
        height: 280px;
    }

    .enemy-sprite {
        font-size: 4em;
    }

    .player-sprite,
    .grandpa-sprite {
        font-size: 2.5em;
    }

    .player-area {
        gap: 15px;
    }

    .status-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 8px 15px;
    }

    .question-text {
        font-size: 1.1em;
    }

    .option-btn {
        padding: 12px 15px;
        font-size: 1em;
    }

    .result-container,
    .menu-container,
    .info-container {
        padding: 25px;
        width: 95%;
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .character-sprite {
        font-size: 3em;
    }

    .enemy-sprite {
        font-size: 3em;
    }

    .player-sprite,
    .grandpa-sprite {
        font-size: 2em;
    }

    .menu-buttons {
        gap: 10px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 1em;
    }
}

/* ===== 暂停菜单 ===== */
.pause-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.3s ease;
}

.pause-container h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.pause-info {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.pause-info p {
    margin: 8px 0;
    color: var(--text-primary);
}

.pause-info span {
    color: var(--primary-color);
    font-weight: bold;
}

.pause-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== 技能界面 ===== */
.skills-container {
    max-width: 700px;
}

.skills-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.skill-item {
    background: white;
    border: 2px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    transition: all 0.3s ease;
}

.skill-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.skill-item.maxed {
    border-color: #FFD700;
    background: linear-gradient(135deg, #fffef0 0%, #fff9c4 100%);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.skill-icon {
    font-size: 2.5em;
}

.skill-name {
    font-weight: bold;
    font-size: 1.1em;
    color: var(--text-primary);
}

.skill-level {
    background: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.85em;
}

.skill-description {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.skill-bonus {
    color: var(--success-color);
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.skill-upgrade-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.skill-upgrade-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.skill-upgrade-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.skills-buttons {
    display: flex;
    gap: 10px;
}

/* ===== 装备界面 ===== */
.equipment-container {
    max-width: 700px;
}

.equipment-stats {
    background: linear-gradient(135deg, #FFA500 0%, #FF6347 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.equipment-item {
    background: white;
    border: 2px solid #ddd;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.equipment-item.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.equipment-item:not(.locked):hover {
    border-color: var(--warning-color);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.equipment-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.equipment-name {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.equipment-type {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.equipment-bonus {
    background: var(--bg-light);
    padding: 8px;
    border-radius: 8px;
    font-size: 0.85em;
}

.equipment-bonus div {
    margin: 3px 0;
    color: var(--success-color);
    font-weight: bold;
}

.equipment-buttons {
    display: flex;
    gap: 10px;
}

/* ===== 升级通知 ===== */
.level-up-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.5);
    z-index: 2000;
    animation: levelUpPop 0.5s ease;
    transition: opacity 0.5s ease;
}

@keyframes levelUpPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.level-up-content {
    text-align: center;
    color: white;
}

.level-up-icon {
    font-size: 4em;
    margin-bottom: 10px;
}

.level-up-text {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.level-up-detail {
    font-size: 1.3em;
    margin-bottom: 5px;
}

.level-up-reward {
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.3);
    padding: 5px 15px;
    border-radius: 15px;
    display: inline-block;
}

/* ===== 装备通知 ===== */
.equipment-notification {
    position: fixed;
    top: 20%;
    right: 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    animation: slideInRight 0.5s ease;
    transition: opacity 0.5s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.equipment-notification-content {
    text-align: center;
    color: white;
}

.equipment-notification-icon {
    font-size: 3em;
    margin-bottom: 5px;
}

.equipment-notification-text {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.equipment-notification-name {
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.3);
    padding: 3px 10px;
    border-radius: 10px;
    display: inline-block;
}

/* ===== 高级特效样式 ===== */

/* 连击系统 */
.combo-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    font-weight: bold;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    animation: comboPopup 0.8s ease-out forwards;
    z-index: 1000;
    pointer-events: none;
}

@keyframes comboPopup {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -80%) scale(1);
    }
}

/* 暴击特效 */
.crit-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4em;
    font-weight: bold;
    color: var(--danger-color);
    text-shadow: 0 0 30px rgba(244, 67, 54, 0.9);
    animation: critPopup 1s ease-out forwards;
    z-index: 1000;
    pointer-events: none;
}

@keyframes critPopup {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotate(-10deg);
    }
    40% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3) rotate(5deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -70%) scale(1) rotate(0deg);
    }
}

/* 完美答题特效 */
.perfect-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5em;
    font-weight: bold;
    background: linear-gradient(45deg, var(--gold), var(--warning-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: perfectPopup 1.2s ease-out forwards;
    z-index: 1000;
    pointer-events: none;
}

@keyframes perfectPopup {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotate(-15deg);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.4) rotate(10deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -80%) scale(1) rotate(0deg);
    }
}

/* 战斗场景粒子效果 */
.battle-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: particleFloat 3s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 1;
    }
}

/* 技能释放特效 */
.skill-cast-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.6) 0%, transparent 70%);
    animation: skillCast 1s ease-out forwards;
    z-index: 999;
    pointer-events: none;
}

@keyframes skillCast {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* 升级光效 */
.level-up-glow {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: levelUpGlow 2s ease-out forwards;
    z-index: 998;
    pointer-events: none;
}

@keyframes levelUpGlow {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* 连击计数器 */
.combo-counter {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    font-size: 1.5em;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(156, 39, 176, 0.5);
    z-index: 100;
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 成就解锁通知 */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--gold), var(--warning-color));
    color: var(--bg-dark);
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.5);
    z-index: 2000;
    animation: achievementSlide 0.5s ease;
}

@keyframes achievementSlide {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.achievement-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.achievement-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 0.9em;
    opacity: 0.9;
}

/* 选项按钮样式已在前面定义，此处删除重复定义 */

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

/* wrongShake动画已定义 */

/* Boss血条特效 */
.boss-health-bar {
    position: relative;
    height: 30px;
    background: linear-gradient(180deg, #2c2c2c 0%, #1a1a1a 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.boss-health-fill {
    height: 100%;
    background: linear-gradient(90deg, #f44336 0%, #ff9800 50%, #f44336 100%);
    background-size: 200% 100%;
    animation: bossHealthPulse 2s linear infinite;
    transition: width 0.5s ease;
}

@keyframes bossHealthPulse {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* 对话框升级 */
.dialogue-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 245, 245, 0.95) 100%);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.speaker {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* 场景背景特效 */
.scene-background {
    position: relative;
    overflow: hidden;
}

.scene-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* 心形生命值动画 */
.heart {
    display: inline-block;
    transition: all 0.3s ease;
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

.heart.lost {
    animation: heartBreak 0.5s ease forwards;
    opacity: 0.3;
}

@keyframes heartBreak {
    0% { transform: scale(1); }
    50% { transform: scale(1.3) rotate(20deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* 经验值条动画 */
.exp-fill {
    background: linear-gradient(90deg, var(--cyan), var(--secondary-color));
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.exp-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: expShine 2s infinite;
}

@keyframes expShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 知识卡片3D效果 */
.knowledge-card {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border: 3px solid var(--gold);
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.3);
    transform: perspective(1000px) rotateX(5deg);
    transition: all 0.3s ease;
}

.knowledge-card:hover {
    transform: perspective(1000px) rotateX(0deg) scale(1.02);
}

/* 成就系统样式 */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px;
}

.achievement-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.achievement-item.unlocked {
    background: linear-gradient(135deg, #FFE57F 0%, #FFD54F 100%);
    border-color: var(--gold);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.achievement-item.locked {
    opacity: 0.6;
    filter: grayscale(0.5);
}

/* 统计数据美化 */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-label {
    font-size: 1em;
    opacity: 0.9;
}

/* 加载动画 */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(102, 126, 234, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 霓虹灯效果 */
.neon-text {
    text-shadow:
        0 0 7px #fff,
        0 0 10px #fff,
        0 0 21px #fff,
        0 0 42px var(--primary-color),
        0 0 82px var(--primary-color),
        0 0 92px var(--primary-color);
}

/* 玻璃态效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 成就容器样式 */
.achievements-container {
    max-width: 800px;
}

.achievements-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* 关卡选择卡片升级 */
.level-item {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.level-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.level-item:hover::before {
    opacity: 1;
}

.level-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.level-item.completed {
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
    color: white;
}

.level-item.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7); }
    50% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
}

.level-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.level-number {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.level-name {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.level-status {
    font-size: 0.9em;
    opacity: 0.8;
}

/* 知识卡片升级 */
.card-item {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(253, 203, 110, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 3px solid transparent;
}

.card-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(253, 203, 110, 0.4);
}

.card-item.locked {
    background: linear-gradient(135deg, #b2bec3 0%, #636e72 100%);
    box-shadow: 0 10px 25px rgba(99, 110, 114, 0.3);
    cursor: not-allowed;
}

.card-number {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--bg-dark);
    margin-bottom: 10px;
}

.card-title-small {
    font-size: 1em;
    font-weight: bold;
    color: var(--bg-dark);
    margin-bottom: 8px;
}

.card-preview {
    font-size: 0.9em;
    color: var(--text-primary);
    font-style: italic;
}

.locked-text {
    color: white;
    font-size: 0.9em;
    margin: 5px 0;
}

/* ===== 完整角色样式 - 只保留头部 ===== */

.full-character {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: characterIdle 2s ease-in-out infinite;
}

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

.character-body {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== 头部设计 ===== */
.character-head {
    position: relative;
    width: 90px;
    height: 90px;
    z-index: 2;
}

/* 双马尾已隐藏 */
.character-head::before,
.character-head::after {
    display: none;
}

/* 蝴蝶结装饰 - 小柔 */
.player-character .character-head {
    /* 粉色和黄色蝴蝶结 */
    background-image:
        radial-gradient(ellipse at 15px 18px, #FFB6C1 0%, #FF69B4 100%),
        radial-gradient(ellipse at 32px 18px, #FFD700 0%, #FFA500 100%);
    background-size: 18px 14px, 18px 14px;
    background-position: -8px 8px, 25px 8px;
    background-repeat: no-repeat;
}

.character-face {
    font-size: 4.5em;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.25));
}

/* 可爱的面部光晕 */
.character-face::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95px;
    height: 95px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.5) 60%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

/* ===== 隐藏所有身体部分 ===== */
.character-torso,
.character-legs,
.character-leg,
.character-arms,
.character-arm {
    display: none !important;
}

/* ===== 身体设计 ===== */
.character-torso {
    width: 60px;
    height: 50px;
    border-radius: 30px 30px 20px 20px;
    position: relative;
    z-index: 1;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* 小柔 - 淡蓝色泡泡袖上衣 + 渐变裙 */
.player-character .character-torso {
    background: linear-gradient(180deg,
        #87CEEB 0%,
        #87CEEB 45%,
        #FFB6C1 45%,
        #FFD700 60%,
        #87CEEB 75%,
        #87CEEB 100%
    );
    border: 3px solid #5FB3D9;
}

/* 黄色领口蝴蝶结 */
.player-character .character-torso::before {
    content: '🎀';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* 裙摆蕾丝边 */
.player-character .character-torso::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: repeating-linear-gradient(
        90deg,
        #fff 0px,
        #fff 4px,
        transparent 4px,
        transparent 8px
    );
    border-radius: 0 0 20px 20px;
    opacity: 0.9;
}

/* 老发根爷爷 - 绿色风 */
.grandpa-character .character-torso {
    background: linear-gradient(180deg, #A5D6A7 0%, #81C784 50%, #66BB6A 100%);
    border: 3px solid #90EE90;
    border-radius: 25px;
}

.grandpa-character .character-torso::before {
    content: '🌿';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    opacity: 0.8;
}

/* ===== 腿部设计 ===== */
.character-legs {
    display: flex;
    gap: 12px;
    margin-top: -2px;
    z-index: 1;
}

.character-leg {
    width: 20px;
    height: 35px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* 白色蕾丝边袜子 */
.player-character .character-leg {
    background: linear-gradient(180deg,
        #fff 0%,
        #fff 70%,
        #FFE4E1 70%,
        #FFE4E1 100%
    );
    border: 2px solid #ddd;
    overflow: hidden;
}

/* 袜子蕾丝边装饰 */
.player-character .character-leg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        #fff 0px,
        #fff 3px,
        transparent 3px,
        transparent 6px
    );
    opacity: 0.8;
}

/* 奶油色玛丽珍鞋 */
.player-character .character-leg::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: -2px;
    width: 24px;
    height: 12px;
    background: linear-gradient(180deg, #FFF8DC 0%, #F5DEB3 100%);
    border-radius: 8px 8px 10px 10px;
    border: 2px solid #DEB887;
}

.grandpa-character .character-leg {
    background: linear-gradient(180deg, #A5D6A7 0%, #81C784 100%);
    border: 2px solid #90EE90;
}

/* ===== 手臂设计 ===== */
.character-arms {
    position: absolute;
    top: 90px;
    width: 140px;
    display: flex;
    justify-content: space-between;
    z-index: 3;
}

.character-arm {
    width: 14px;
    height: 35px;
    border-radius: 7px;
    position: relative;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.player-character .character-arm {
    background: linear-gradient(180deg, #87CEEB 0%, #5FB3D9 100%);
    border: 2px solid #4682B4;
}

/* 泡泡袖效果 */
.player-character .character-arm::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -4px;
    width: 22px;
    height: 12px;
    background: radial-gradient(ellipse, #87CEEB 0%, #5FB3D9 100%);
    border-radius: 50%;
    border: 2px solid #4682B4;
}

/* 可爱的小手 */
.player-character .character-arm::after {
    content: '✋';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.grandpa-character .character-arm {
    background: linear-gradient(180deg, #A5D6A7 0%, #81C784 100%);
    border: 2px solid #90EE90;
}

.grandpa-character .character-arm::after {
    content: '👋';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
}

.character-arm.left {
    transform: rotate(8deg);
}

.character-arm.right {
    transform: rotate(-8deg);
}

.character-shadow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 14px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.25) 0%, transparent 70%);
    border-radius: 50%;
}

/* 可爱的柔和光晕 - 头部版 */
.player-character::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle,
        rgba(255, 182, 193, 0.2) 0%,
        rgba(135, 206, 235, 0.1) 50%,
        transparent 70%
    );
    border-radius: 50%;
    animation: cuteGlow 3s ease-in-out infinite;
    z-index: -1;
}

.grandpa-character::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(165, 214, 167, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: cuteGlow 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes cuteGlow {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

/* 攻击动画 - 头部版 */
.player-character.attacking {
    animation: playerAttackHead 0.5s ease-out;
}

@keyframes playerAttackHead {
    0% { transform: translateX(0) scale(1); }
    30% { transform: translateX(-8px) scale(0.95); }
    50% { transform: translateX(25px) scale(1.15); }
    100% { transform: translateX(0) scale(1); }
}

/* 攻击时的心心特效 */
.player-character.attacking::after {
    content: '💕';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.8em;
    animation: heartEffect 0.8s ease-out forwards;
}

@keyframes heartEffect {
    0% { opacity: 0; transform: scale(0.5) translateY(0); }
    40% { opacity: 1; transform: scale(1.3) translateY(-5px); }
    100% { opacity: 0; transform: scale(1.8) translateY(-20px); }
}

/* 受伤动画 - 头部版 */
.player-character.hurt {
    animation: playerHurtHead 0.5s ease;
}

.player-character.hurt .character-head {
    animation: headShakeHead 0.5s ease;
}

.player-character.hurt::after {
    content: '😢';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.6em;
    animation: tearHead 0.8s ease-out forwards;
}

@keyframes playerHurtHead {
    0%, 100% { transform: translateX(0) filter: brightness(1); }
    15% { transform: translateX(-6px) filter: brightness(1.2) hue-rotate(-15deg); }
    30% { transform: translateX(5px) filter: brightness(0.85); }
    45% { transform: translateX(-4px) filter: brightness(1.15); }
    60% { transform: translateX(3px) filter: brightness(0.9); }
    75% { transform: translateX(-2px) filter: brightness(1.1); }
}

@keyframes headShakeHead {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-8deg) scale(0.95); }
    30% { transform: rotate(10deg) scale(1.05); }
    45% { transform: rotate(-6deg); }
    60% { transform: rotate(5deg); }
    75% { transform: rotate(-3deg); }
}

@keyframes tearHead {
    0% { opacity: 0; transform: translateX(-50%) translateY(0) scale(0.3); }
    25% { opacity: 1; transform: translateX(-50%) translateY(-8px) scale(1.3); }
    50% { opacity: 0.7; transform: translateX(-50%) translateY(-15px) scale(1.1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-30px) scale(0.9); }
}

/* 敌人完整形象 */
.enemy-sprite {
    font-size: 3em;
    position: relative;
    animation: enemyIdle 2s infinite ease-in-out;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

.enemy-sprite::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 15px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.5) 0%, transparent 70%);
    border-radius: 50%;
}

/* Boss级别的敌人特效 */
.enemy-sprite.boss {
    font-size: 4em;
    filter: drop-shadow(0 0 30px rgba(255, 0, 0, 0.8));
    animation: bossPulse 1.5s infinite ease-in-out;
}

.enemy-sprite.boss::before {
    content: '👑';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.5em;
    animation: crownFloat 2s infinite ease-in-out;
}

@keyframes crownFloat {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-5deg); }
    50% { transform: translateX(-50%) translateY(-10px) rotate(5deg); }
}

/* ===== 高级战斗场景样式 ===== */

/* 增强的战斗场景 */
.battle-scene {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.3);
}

.battle-scene::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
    animation: battleShine 8s linear infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes battleShine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* 增强的角色容器 */
.character-container,
.grandpa-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.character-container::before,
.grandpa-container::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 0 0 15px 15px;
}

/* 角色血条 */
.character-hp-bar {
    width: 80px;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

.character-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* 小柔角色增强 */
.player-sprite {
    font-size: 4em;
    position: relative;
    filter: drop-shadow(0 5px 15px rgba(102, 126, 234, 0.5));
    transition: all 0.3s ease;
}

.player-sprite::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: playerAura 3s infinite ease-in-out;
    z-index: -1;
}

@keyframes playerAura {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

/* 老发根爷爷角色增强 */
.grandpa-sprite {
    font-size: 3.5em;
    position: relative;
    filter: drop-shadow(0 5px 15px rgba(76, 175, 80, 0.5));
}

.grandpa-sprite::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: radial-gradient(circle, rgba(76, 175, 80, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: grandpaAura 4s infinite ease-in-out;
    z-index: -1;
}

@keyframes grandpaAura {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.7; }
}

/* 角色名称标签增强 */
.character-name {
    font-size: 0.9em;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 5px;
    padding: 3px 10px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
    border-radius: 10px;
}

/* 攻击动画增强 */
.player-sprite.attacking {
    animation: playerAttack 0.5s ease-out;
}

.player-sprite.attacking::after {
    content: '⚔️';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 2em;
    animation: slashEffect 0.5s ease-out forwards;
}

@keyframes playerAttack {
    0% { transform: translateX(0) scale(1); }
    30% { transform: translateX(50px) scale(1.2); }
    50% { transform: translateX(80px) scale(1); }
    100% { transform: translateX(0) scale(1); }
}

@keyframes slashEffect {
    0% { opacity: 0; transform: rotate(0deg) scale(0); }
    50% { opacity: 1; transform: rotate(45deg) scale(1.5); }
    100% { opacity: 0; transform: rotate(90deg) scale(2); }
}

/* 受伤动画增强 */
.player-sprite.hurt {
    animation: playerHurt 0.5s ease;
}

.player-sprite.hurt::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.6) 0%, transparent 70%);
    animation: hurtImpact 0.5s ease-out forwards;
}

@keyframes playerHurt {
    0%, 100% { transform: translateX(0); filter: brightness(1); }
    25% { transform: translateX(-10px); filter: brightness(2) hue-rotate(180deg); }
    50% { transform: translateX(5px); filter: brightness(1.5); }
    75% { transform: translateX(-5px); filter: brightness(1.2); }
}

@keyframes hurtImpact {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* 敌人动画增强 */
.enemy-sprite.hurt {
    animation: enemyHurt 0.5s ease;
}

.enemy-sprite.hurt::after {
    content: '💥';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3em;
    animation: enemyHitEffect 0.5s ease-out forwards;
}

@keyframes enemyHurt {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(0.9) rotate(-5deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    75% { transform: scale(0.95) rotate(-2deg); }
}

@keyframes enemyHitEffect {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.5) rotate(180deg); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2) rotate(360deg); }
}

/* 敌人击败动画 */
.enemy-sprite.defeated {
    animation: enemyDefeat 1.5s ease-out forwards;
}

.enemy-sprite.defeated::after {
    content: '💫';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    animation: starBurst 1s ease-out forwards;
}

@keyframes enemyDefeat {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    30% { transform: scale(1.3) rotate(180deg); opacity: 0.8; }
    60% { transform: scale(0.8) rotate(360deg); opacity: 0.5; filter: brightness(2); }
    100% { transform: scale(0) rotate(720deg); opacity: 0; }
}

@keyframes starBurst {
    0% { opacity: 0; transform: scale(0); }
    50% { opacity: 1; transform: scale(1.5); }
    100% { opacity: 0; transform: scale(3); }
}

/* 技能释放特效 */
.skill-cast {
    position: absolute;
    top: 50%;
    left: 30%;
    width: 150px;
    height: 150px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
}

.skill-cast::before {
    content: '✨';
    position: absolute;
    font-size: 4em;
    animation: skillCastOrb 1s ease-out forwards;
}

.skill-cast::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(102, 126, 234, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: skillWave 1s ease-out forwards;
}

@keyframes skillCastOrb {
    0% { transform: scale(0) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.5) rotate(180deg); opacity: 0.8; }
    100% { transform: scale(0.5) rotate(360deg); opacity: 0; }
}

@keyframes skillWave {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* 战斗界面装饰 */
.battle-scene::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg,
        var(--primary-color) 0%,
        var(--secondary-color) 25%,
        var(--purple) 50%,
        var(--pink) 75%,
        var(--primary-color) 100%);
    background-size: 200% 100%;
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* 敌人等级徽章 */
.enemy-level-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(156, 39, 176, 0.5);
    z-index: 10;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* 敌人血条增强 */
.enemy-health-bar {
    width: 120px;
    height: 20px;
    background: linear-gradient(180deg, #2c2c2c 0%, #1a1a1a 100%);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.enemy-health-fill {
    height: 100%;
    background: linear-gradient(90deg, #f44336 0%, #ff9800 50%, #f44336 100%);
    background-size: 200% 100%;
    transition: width 0.5s ease;
    position: relative;
    animation: bossHealthPulse 2s linear infinite;
}

.enemy-health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* 角色称号 */
.character-title {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 2px;
    font-style: italic;
}
}
