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

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* 主容器 */
.storybook-container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.title-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.book-icon {
    font-size: 2.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.main-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 5px 0 0 0;
    font-weight: 300;
}

.navigation-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.story-page {
    display: flex;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    width: 100%;
    min-height: 600px;
    transition: all 0.5s ease;
}

.story-page.flipping {
    transform: scale(0.98);
    opacity: 0.9;
}

/* 图片区域 */
.image-section {
    flex: 1;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    position: relative;
}

.image-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 500px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.image-container:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.image-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
}

.page-number {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

/* 文字区域 */
.text-section {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.text-container {
    max-width: 500px;
}

.story-text {
    margin-bottom: 40px;
}

.story-text p {
    font-size: 1.3rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #444;
    text-align: justify;
    animation: fadeInUp 0.6s ease;
}

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

/* 音频控制区域 */
.audio-controls {
    border-top: 2px solid #f0f0f0;
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.play-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.play-btn.playing {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.play-icon {
    font-size: 1.2rem;
}

.audio-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audio-status {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* 底部区域 */
.footer {
    background: rgba(255, 255, 255, 0.9);
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.page-dots {
    display: flex;
    gap: 12px;
}

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

.dot.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(1.3);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.dot:hover:not(.active) {
    background: #bbb;
    transform: scale(1.1);
}

.footer-info {
    color: #666;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .story-page {
        flex-direction: column;
        min-height: auto;
    }
    
    .image-section {
        padding: 20px;
    }
    
    .image-container {
        height: 400px;
    }
    
    .text-section {
        padding: 30px;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .navigation-controls {
        order: -1;
        width: 100%;
        justify-content: center;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .story-text p {
        font-size: 1.1rem;
    }
    
    .footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }
    
    .text-section {
        padding: 20px;
    }
    
    .image-container {
        height: 300px;
    }
    
    .story-text p {
        font-size: 1rem;
    }
    
    .nav-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .main-title {
        font-size: 1.5rem;
    }
}

/* 加载动画 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 平滑过渡效果 */
.fade-transition {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fade-out {
    opacity: 0;
    transform: translateY(10px);
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}