/* 全局样式 */
:root {
    --primary-color: #ff85a2;
    --secondary-color: #7b68ee;
    --accent-color: #ffd700;
    --text-color: #333;
    --background-color: #f9f4ff;
    --container-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="3" fill="%23ffccee" opacity="0.3"/><circle cx="60" cy="60" r="3" fill="%23aaddff" opacity="0.3"/><circle cx="80" cy="20" r="3" fill="%23ffaacc" opacity="0.3"/><circle cx="20" cy="80" r="3" fill="%23aaffee" opacity="0.3"/></svg>');
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 标题样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

h1 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px var(--shadow-color);
}

.rainbow {
    height: 10px;
    background: linear-gradient(to right, 
        #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8b00ff);
    border-radius: 5px;
    margin: 0 auto;
    width: 80%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 故事容器样式 */
.story-container {
    background-color: var(--container-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    overflow: hidden;
    margin-bottom: 30px;
    position: relative;
}

.scene-content {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* 插图样式 */
.illustration-container {
    text-align: center;
    margin-bottom: 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
}

#scene-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

#scene-image:hover {
    transform: scale(1.02);
}

/* 文本样式 */
.text-container {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow-color);
}

h2 {
    font-family: 'Ma Shan Zheng', cursive;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

#scene-text {
    font-size: 1.2rem;
    line-height: 1.8;
    white-space: pre-line;
}

/* 控制按钮样式 */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-top: 1px solid #eee;
}

.nav-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.nav-btn:hover:not(:disabled) {
    background-color: #6a5acd;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.nav-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 音频控制样式 */
.audio-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
}

.play-btn:hover {
    background-color: #ffcc00;
    transform: scale(1.05);
}

.play-icon, .pause-icon {
    font-size: 1.5rem;
    color: white;
}

.audio-text {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: bold;
    margin-bottom: 8px;
}

/* 自动播放选项样式 */
.autoplay-container {
    display: flex;
    align-items: center;
    margin-top: 5px;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#autoplay-checkbox {
    margin-right: 5px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

label[for="autoplay-checkbox"] {
    font-size: 0.85rem;
    color: var(--text-color);
    cursor: pointer;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .scene-content {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .illustration-container {
        flex: 1;
        margin-right: 20px;
        margin-bottom: 0;
    }
    
    .text-container {
        flex: 1;
    }
}

@media (max-width: 767px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    #scene-text {
        font-size: 1rem;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .play-btn {
        width: 50px;
        height: 50px;
    }
    
    .autoplay-container {
        padding: 3px 8px;
    }
    
    label[for="autoplay-checkbox"] {
        font-size: 0.75rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* 彩虹光晕效果 */
.rainbow-glow {
    position: relative;
}

.rainbow-glow::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, 
        rgba(255, 0, 0, 0.2), 
        rgba(255, 165, 0, 0.2), 
        rgba(255, 255, 0, 0.2), 
        rgba(0, 128, 0, 0.2), 
        rgba(0, 0, 255, 0.2), 
        rgba(75, 0, 130, 0.2), 
        rgba(238, 130, 238, 0.2));
    border-radius: 20px;
    z-index: -1;
    filter: blur(10px);
    animation: rainbow-rotate 10s linear infinite;
}

@keyframes rainbow-rotate {
    0% { filter: blur(10px) hue-rotate(0deg); }
    100% { filter: blur(10px) hue-rotate(360deg); }
}