/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: linear-gradient(135deg, #e8f5e8 0%, #b8e6b8 100%);
    min-height: 100vh;
    color: #2d4a2d;
    line-height: 1.6;
}

.storybook-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 头部样式 */
.story-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(45deg, #4CAF50, #81C784);
    border-radius: 15px;
    margin-bottom: 30px;
    color: white;
}

.story-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 故事场景样式 */
.story-main {
    position: relative;
    min-height: 600px;
}

.story-scene {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.story-scene.active {
    display: block;
}

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

.scene-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
    padding: 20px;
}

.scene-image {
    text-align: center;
}

.scene-image img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.scene-image img:hover {
    transform: scale(1.05);
}

.scene-text {
    padding: 20px;
}

.scene-text h2 {
    color: #2E7D32;
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 3px solid #4CAF50;
    padding-bottom: 10px;
}

.scene-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #424242;
    margin-bottom: 25px;
    text-align: justify;
}

/* 音频控制样式 */
.audio-controls {
    margin-top: 20px;
}

.play-audio {
    background: linear-gradient(45deg, #FF9800, #FFB74D);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.play-audio:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

.play-audio:active {
    transform: translateY(0);
}

.play-audio.playing {
    background: linear-gradient(45deg, #4CAF50, #81C784);
    animation: pulse 1.5s infinite;
}

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

/* 导航样式 */
.story-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 20px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 15px;
    margin-top: 30px;
}

.nav-btn {
    background: linear-gradient(45deg, #2E7D32, #4CAF50);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.scene-indicators {
    display: flex;
    gap: 10px;
}

.indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: #4CAF50;
    transform: scale(1.3);
}

.indicator:hover {
    background: #81C784;
}

/* 页脚样式 */
.story-footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 30px;
    background: linear-gradient(45deg, #E8F5E8, #C8E6C9);
    border-radius: 15px;
    color: #2E7D32;
}

.story-footer p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.credits {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .storybook-container {
        margin: 10px;
        padding: 15px;
    }
    
    .story-header h1 {
        font-size: 2rem;
    }
    
    .scene-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .scene-text h2 {
        font-size: 1.5rem;
    }
    
    .scene-text p {
        font-size: 1rem;
    }
    
    .story-navigation {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .story-header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .scene-text {
        padding: 15px;
    }
    
    .scene-text h2 {
        font-size: 1.3rem;
    }
    
    .scene-text p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .play-audio {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }
    
    .storybook-container {
        box-shadow: none;
        background: white;
    }
    
    .story-navigation,
    .audio-controls {
        display: none;
    }
    
    .story-scene {
        display: block !important;
        page-break-after: always;
    }
    
    .story-scene:last-child {
        page-break-after: avoid;
    }
}

/* 可访问性增强 */
.nav-btn:focus,
.play-audio:focus,
.indicator:focus {
    outline: 3px solid #FF9800;
    outline-offset: 2px;
}

/* 动画效果 */
.scene-image img {
    animation: float 6s ease-in-out infinite;
}

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

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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