/* 海洋冒险故事书样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', '微软雅黑', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #87ceeb 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.storybook-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
}

/* 标题页样式 */
.title-page {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.title-page.active {
    display: flex;
}

.title-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
    position: relative;
}

.main-title {
    font-size: 3.5rem;
    color: #1e3c72;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.subtitle {
    font-size: 1.5rem;
    color: #2a5298;
    margin-bottom: 15px;
}

.age-info {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 30px;
}

.start-button {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

/* 海洋动画背景 */
.ocean-animation {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: linear-gradient(to right, rgba(135, 206, 235, 0.8), rgba(30, 144, 255, 0.8));
    border-radius: 50%;
    animation: wave 3s ease-in-out infinite;
}

.wave1 {
    animation-delay: 0s;
    opacity: 0.7;
}

.wave2 {
    animation-delay: 1s;
    opacity: 0.5;
    height: 80px;
}

.wave3 {
    animation-delay: 2s;
    opacity: 0.3;
    height: 60px;
}

@keyframes wave {
    0%, 100% {
        transform: translateX(-50%) translateY(0px);
    }
    50% {
        transform: translateX(-50%) translateY(-20px);
    }
}

/* 故事页面样式 */
.story-page {
    display: none;
    padding: 20px;
    min-height: calc(100vh - 80px);
}

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

.page-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
    min-height: 600px;
}

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

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

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

.text-container {
    padding: 20px;
}

.scene-title {
    font-size: 2.2rem;
    color: #1e3c72;
    margin-bottom: 20px;
    text-align: center;
}

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

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

.play-button {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(76, 175, 80, 0.6);
}

.play-button.playing {
    background: linear-gradient(45deg, #ff9800, #f57c00);
}

.play-icon {
    margin-right: 8px;
}

/* 导航样式 */
.navigation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.nav-button {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.nav-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

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

.page-indicator {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1e3c72;
    padding: 0 15px;
}

/* 结束页样式 */
.end-content {
    text-align: center;
    grid-template-columns: 1fr;
    justify-content: center;
}

.end-title {
    font-size: 3rem;
    color: #1e3c72;
    margin-bottom: 30px;
}

.end-message {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 40px;
}

.restart-button {
    background: linear-gradient(45deg, #9C27B0, #7B1FA2);
    color: white;
    border: none;
    padding: 15px 35px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
}

.restart-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(156, 39, 176, 0.6);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .page-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .scene-title {
        font-size: 1.8rem;
    }
    
    .story-text {
        font-size: 1rem;
    }
    
    .navigation {
        bottom: 10px;
        padding: 10px 15px;
        gap: 10px;
    }
    
    .nav-button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .title-content {
        padding: 40px 20px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
    }
    
    .page-content {
        padding: 15px;
        margin: 10px;
    }
    
    .story-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .navigation {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    
    .nav-button {
        width: 100px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

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

/* 平滑过渡效果 */
.story-page {
    transition: opacity 0.5s ease-in-out;
}

.story-page.active {
    animation: fadeIn 0.5s ease-in-out;
}

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