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

body {
    font-family: 'Microsoft YaHei', 'SimSun', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    overflow: hidden;
    color: #e0e0e0;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* 开始界面 */
#start-screen {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #0d0d0d 0%, #1a1a2e 50%, #16213e 100%);
    position: relative;
    overflow: hidden;
}

.title-container {
    text-align: center;
    z-index: 10;
    animation: fadeInUp 1s ease;
}

.game-title {
    font-size: 4rem;
    color: #ff6b9d;
    text-shadow: 0 0 20px rgba(255, 107, 157, 0.5), 
                 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 1rem;
    letter-spacing: 0.5rem;
    animation: titleGlow 2s ease-in-out infinite;
}

.game-subtitle {
    font-size: 1.5rem;
    color: #a0a0a0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-style: italic;
}

.start-menu {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 3rem;
    z-index: 10;
    animation: fadeInUp 1s ease 0.3s backwards;
}

.menu-btn {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    border: 2px solid #ff6b9d;
    background: rgba(255, 107, 157, 0.1);
    color: #ff6b9d;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.menu-btn:hover {
    background: rgba(255, 107, 157, 0.3);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
}

/* 樱花效果 */
.sakura-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.sakura {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #ffb7c5 0%, #ff69b4 100%);
    border-radius: 50% 0 50% 50%;
    opacity: 0.8;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 107, 157, 0.5), 
                     2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    50% {
        text-shadow: 0 0 30px rgba(255, 107, 157, 0.8), 
                     2px 2px 4px rgba(0, 0, 0, 0.8),
                     0 0 40px rgba(255, 107, 157, 0.4);
    }
}

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

/* 游戏主界面 */
#game-screen {
    flex-direction: column;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a2e 100%);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 107, 157, 0.3);
}

.location-info, .status-info {
    font-size: 1rem;
    color: #e0e0e0;
}

.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.scene-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.scene-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease;
    position: relative;
}

.scene-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(0, 0, 0, 0.1) 50%, 
        rgba(0, 0, 0, 0.5) 100%);
}

.scene-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
}

/* 对话容器 */
.dialogue-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.character-avatar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    position: relative;
    height: 200px;
}

.avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    position: absolute;
    bottom: 0;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    border: 3px solid rgba(255, 107, 157, 0.5);
}

.avatar.hidden {
    opacity: 0;
    transform: translateY(20px);
}

#avatar-left {
    left: 0;
}

#avatar-right {
    right: 0;
}

.dialogue-box {
    width: 100%;
    max-width: 1000px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(255, 107, 157, 0.5);
    border-radius: 10px;
    padding: 1.5rem 2rem;
    margin-top: -80px;
    position: relative;
    z-index: 10;
    cursor: pointer;
    backdrop-filter: blur(10px);
    animation: slideUp 0.3s ease;
}

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

.speaker-name {
    font-size: 1.3rem;
    color: #ff6b9d;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.dialogue-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ffffff;
    min-height: 60px;
}

.dialogue-hint {
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* 选择按钮容器 */
.choices-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 20;
    width: 100%;
    max-width: 600px;
    padding: 0 1rem;
}

.choice-question {
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ff6b9d;
    border-radius: 10px;
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
}

.choice-btn {
    padding: 1rem 2rem;
    background: rgba(255, 107, 157, 0.1);
    border: 2px solid #ff6b9d;
    color: #e0e0e0;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 5px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 157, 0.3), transparent);
    transition: left 0.5s ease;
}

.choice-btn:hover::before {
    left: 100%;
}

.choice-btn:hover {
    background: rgba(255, 107, 157, 0.3);
    transform: translateX(10px);
    box-shadow: 0 0 15px rgba(255, 107, 157, 0.4);
}

.choice-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 游戏统计 */
.game-stats {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 107, 157, 0.3);
}

.game-stats h3 {
    color: #ff6b9d;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.game-stats p {
    color: #e0e0e0;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

/* 游戏底部状态栏 */
.game-footer {
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 2rem;
    border-top: 1px solid rgba(255, 107, 157, 0.3);
}

.character-status {
    display: flex;
    gap: 3rem;
    justify-content: center;
}

.status-bar {
    flex: 1;
}

.status-label {
    font-size: 0.9rem;
    color: #ff6b9d;
    display: block;
    margin-bottom: 0.5rem;
}

.bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.bar {
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    flex: 1;
    position: relative;
}

.health-bar {
    background: linear-gradient(90deg, #ff4444, #ff6b6b);
}

.mental-bar {
    background: linear-gradient(90deg, #4a90e2, #67b26f);
}

.bar-text {
    font-size: 0.8rem;
    color: #e0e0e0;
    min-width: 40px;
    text-align: right;
}

/* 关于界面 */
#about-screen {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.9);
}

.about-container {
    max-width: 800px;
    text-align: center;
}

.about-title {
    font-size: 2.5rem;
    color: #ff6b9d;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
}

.about-content {
    text-align: left;
    line-height: 2;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 10px;
}

.about-content p {
    margin-bottom: 1rem;
}

.about-content ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.about-content li {
    margin-bottom: 0.5rem;
}

/* 结局界面 */
#ending-screen {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.95);
    padding: 2rem;
}

.ending-container {
    text-align: center;
    max-width: 700px;
}

.ending-title {
    font-size: 3rem;
    color: #ff6b9d;
    margin-bottom: 2rem;
    text-shadow: 0 0 30px rgba(255, 107, 157, 0.7);
    animation: titleGlow 2s ease-in-out infinite;
}

.ending-text {
    font-size: 1.2rem;
    line-height: 2;
    margin-bottom: 3rem;
    color: #e0e0e0;
}

/* 场景背景图样式 */
.scene-classroom {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><rect fill="%231a1a2e" width="1920" height="1080"/><rect fill="%232d2d44" x="0" y="600" width="1920" height="480"/><rect fill="%233d3d5c" x="200" y="500" width="300" height="400" rx="5"/><rect fill="%234a4a6a" x="220" y="520" width="260" height="360"/><rect fill="%233d3d5c" x="600" y="500" width="300" height="400" rx="5"/><rect fill="%234a4a6a" x="620" y="520" width="260" height="360"/><rect fill="%233d3d5c" x="1000" y="500" width="300" height="400" rx="5"/><rect fill="%234a4a6a" x="1020" y="520" width="260" height="360"/><rect fill="%233d3d5c" x="1400" y="500" width="300" height="400" rx="5"/><rect fill="%234a4a6a" x="1420" y="520" width="260" height="360"/><circle fill="%23ffd700" cx="1600" cy="200" r="80" opacity="0.8"/><rect fill="%232d2d44" x="0" y="0" width="1920" height="200"/><rect fill="%233d3d5c" x="50" y="50" width="300" height="120"/><text x="80" y="110" fill="%23ff6b9d" font-size="24">黑板</text></svg>');
}

.scene-auditorium {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><rect fill="%231a1a2e" width="1920" height="1080"/><rect fill="%232d2d44" x="0" y="0" width="1920" height="600"/><ellipse fill="%233d3d5c" cx="960" cy="700" rx="800" ry="300"/><rect fill="%234a4a6a" x="760" y="200" width="400" height="300" rx="10"/><rect fill="%23ff6b9d" x="860" y="250" width="50" height="200"/><rect fill="%23ff6b9d" x="1010" y="250" width="50" height="200"/><circle fill="%23ffd700" cx="960" cy="100" r="100" opacity="0.9"/><circle fill="%23ff4444" cx="300" cy="800" r="30"/><circle fill="%23ff4444" cx="500" cy="820" r="30"/><circle fill="%23ff4444" cx="700" cy="800" r="30"/><circle fill="%23ff4444" cx="1200" cy="800" r="30"/><circle fill="%23ff4444" cx="1400" cy="820" r="30"/><circle fill="%23ff4444" cx="1600" cy="800" r="30"/></svg>');
}

.scene-roof {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><rect fill="%230d0d1a" width="1920" height="1080"/><rect fill="%231a1a3d" x="0" y="600" width="1920" height="480"/><circle fill="%23112244" cx="1600" cy="150" r="120" opacity="0.8"/><circle fill="%23112244" cx="1700" cy="180" r="100" opacity="0.6"/><circle fill="%23112244" cx="1500" cy="160" r="80" opacity="0.7"/><circle fill="%23ffdd88" cx="300" cy="100" r="40" opacity="0.9"/><circle fill="%23ffdd88" cx="500" cy="150" r="35" opacity="0.8"/><circle fill="%23ffdd88" cx="800" cy="120" r="45" opacity="0.85"/><rect fill="%233d3d5c" x="100" y="750" width="200" height="330" rx="5"/><rect fill="%233d3d5c" x="400" y="700" width="180" height="380" rx="5"/><rect fill="%233d3d5c" x="700" y="720" width="220" height="360" rx="5"/><rect fill="%233d3d5c" x="1000" y="680" width="190" height="400" rx="5"/><rect fill="%233d3d5c" x="1300" y="740" width="200" height="340" rx="5"/><rect fill="%233d3d5c" x="1600" y="710" width="210" height="370" rx="5"/><line x1="0" y1="650" x2="1920" y2="650" stroke="%23444488" stroke-width="2"/></svg>');
}

.scene-store {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><rect fill="%231a1a2e" width="1920" height="1080"/><rect fill="%232d2d44" x="0" y="600" width="1920" height="480"/><rect fill="%233d3d5c" x="300" y="400" width="400" height="600"/><rect fill="%23ff6b9d" x="350" y="450" width="300" height="100" rx="5"/><text x="400" y="510" fill="%23ffffff" font-size="28">便利店</text><rect fill="%23ffd700" x="400" y="580" width="100" height="150" rx="5"/><circle fill="%23ffffff" cx="800" cy="500" r="150" opacity="0.3"/><rect fill="%233d3d5c" x="1200" y="500" width="300" height="500" rx="5"/><rect fill="%234a4a6a" x="1250" y="550" width="200" height="400"/></svg>');
}

.scene-night {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 1080"><rect fill="%23050510" width="1920" height="1080"/><rect fill="%231a1a3d" x="0" y="700" width="1920" height="380"/><circle fill="%23112244" cx="1600" cy="150" r="120" opacity="0.8"/><circle fill="%23112244" cx="1700" cy="180" r="100" opacity="0.6"/><circle fill="%23112244" cx="1500" cy="160" r="80" opacity="0.7"/><circle fill="%23ffdd88" cx="200" cy="100" r="30" opacity="0.9"/><circle fill="%23ffdd88" cx="400" cy="150" r="25" opacity="0.8"/><circle fill="%23ffdd88" cx="600" cy="120" r="35" opacity="0.85"/><circle fill="%23ffdd88" cx="800" cy="140" r="28" opacity="0.82"/><rect fill="%232d2d44" x="100" y="750" width="200" height="330" rx="5"/><rect fill="%232d2d44" x="400" y="700" width="180" height="380" rx="5"/><rect fill="%232d2d44" x="700" y="720" width="220" height="360" rx="5"/><rect fill="%232d2d44" x="1000" y="680" width="190" height="400" rx="5"/><rect fill="%232d2d44" x="1300" y="740" width="200" height="340" rx="5"/><rect fill="%232d2d44" x="1600" y="710" width="210" height="370" rx="5"/></svg>');
}

/* 角色头像 */
.avatar-duyuan {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.avatar-chengze {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .game-subtitle {
        font-size: 1rem;
    }
    
    .avatar {
        width: 120px;
        height: 120px;
    }
    
    .dialogue-box {
        padding: 1rem;
        margin-top: -50px;
    }
    
    .speaker-name {
        font-size: 1rem;
    }
    
    .dialogue-text {
        font-size: 0.95rem;
    }
    
    .character-status {
        flex-direction: column;
        gap: 1rem;
    }
    
    .choices-container {
        width: 90%;
    }
    
    .choice-btn {
        font-size: 0.9rem;
        padding: 0.8rem 1.5rem;
    }
}