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

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

.storybook-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    text-align: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="3" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s infinite linear;
    pointer-events: none;
}

@keyframes float {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* 主要内容区域 */
.story-main {
    padding: 2rem;
    min-height: 600px;
    position: relative;
}

.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: 2rem;
    align-items: center;
    min-height: 500px;
}

/* 图片容器 */
.image-container {
    text-align: center;
    position: relative;
}

.story-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.story-image:hover {
    transform: scale(1.02);
}

/* 文本容器 */
.text-container {
    padding: 1rem;
}

.text-container h2 {
    color: #2d3436;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    border-left: 4px solid #74b9ff;
    padding-left: 1rem;
}

.story-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #636e72;
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* 音频控制 */
.audio-controls {
    margin-top: 1rem;
}

.play-btn {
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

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

.play-btn.playing {
    background: linear-gradient(135deg, #e17055, #d63031);
    animation: pulse 1.5s infinite;
}

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

/* 导航栏 */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(116, 185, 255, 0.1);
    border-top: 1px solid rgba(116, 185, 255, 0.2);
}

.nav-btn {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 185, 255, 0.4);
}

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

.page-indicator {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3436;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 进度条 */
.progress-container {
    height: 4px;
    background: rgba(116, 185, 255, 0.2);
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #74b9ff, #0984e3);
    transition: width 0.3s ease;
    width: 16.67%; /* 1/6 for first scene */
}

/* 页脚 */
.footer {
    background: linear-gradient(135deg, #636e72, #2d3436);
    color: white;
    padding: 2rem;
    text-align: center;
}

.story-message {
    margin-bottom: 1.5rem;
}

.story-message h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ffeaa7;
}

.story-message p {
    font-size: 1rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.8;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .storybook-container {
        margin: 0;
        border-radius: 0;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .scene-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .story-main {
        padding: 1rem;
    }
    
    .navigation {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .page-indicator {
        order: -1;
        width: 100%;
        text-align: center;
    }
    
    .text-container h2 {
        font-size: 1.5rem;
    }
    
    .story-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 1rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .story-main {
        padding: 0.5rem;
    }
    
    .text-container {
        padding: 0.5rem;
    }
    
    .footer {
        padding: 1.5rem 1rem;
    }
}

/* 可访问性增强 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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