/* 世界建筑旅行绘本 - 儿童友好样式 */

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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 主容器 */
.storybook-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 标题区域 */
.header {
    text-align: center;
    margin-bottom: 30px;
    animation: bounceIn 1s ease-out;
}

.main-title {
    font-size: 3rem;
    color: #FF6B6B;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    margin-bottom: 10px;
    font-weight: bold;
}

.subtitle {
    font-size: 1.5rem;
    color: #4ECDC4;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

/* 故事页面容器 */
.story-page {
    background: white;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
    margin: 20px 0;
    display: none;
    animation: slideIn 0.8s ease-out;
    border: 5px solid #FFD93D;
}

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

/* 图片区域 */
.image-container {
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

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

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

/* 文本区域 */
.text-container {
    background: linear-gradient(135deg, #FFF8DC 0%, #F0F8FF 100%);
    padding: 25px;
    border-radius: 15px;
    border: 3px solid #FFB6C1;
    margin-bottom: 25px;
}

.story-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #2C3E50;
    text-align: justify;
}

/* 控制按钮区域 */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.control-btn {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-family: inherit;
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

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

.control-btn:disabled {
    background: #BDC3C7;
    cursor: not-allowed;
    transform: none;
}

/* 音频播放按钮 */
.audio-btn {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
}

.audio-btn.playing {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
}

/* 导航按钮 */
.nav-btn {
    background: linear-gradient(135deg, #9B59B6 0%, #8E44AD 100%);
}

/* 进度指示器 */
.progress-indicator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

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

.progress-dot.active {
    background: #FF6B6B;
    transform: scale(1.3);
}

.progress-dot.completed {
    background: #2ECC71;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .story-page {
        padding: 20px;
        margin: 10px 0;
    }
    
    .story-text {
        font-size: 1.1rem;
    }
    
    .control-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .controls {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .storybook-container {
        padding: 10px;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .story-page {
        padding: 15px;
    }
    
    .text-container {
        padding: 20px;
    }
    
    .story-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .control-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}

/* 动画效果 */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 可爱的装饰元素 */
.decoration {
    position: absolute;
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
    pointer-events: none;
}

.decoration:nth-child(1) {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.decoration:nth-child(2) {
    top: 20%;
    right: 5%;
    animation-delay: 1s;
}

.decoration:nth-child(3) {
    bottom: 20%;
    left: 10%;
    animation-delay: 2s;
}

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

/* 加载动画 */
.loading {
    text-align: center;
    padding: 50px;
    font-size: 1.5rem;
    color: #FF6B6B;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(0,0,0,0);
        text-shadow: .25em 0 0 rgba(0,0,0,0),
                     .5em 0 0 rgba(0,0,0,0);
    }
    40% {
        color: #FF6B6B;
        text-shadow: .25em 0 0 rgba(0,0,0,0),
                     .5em 0 0 rgba(0,0,0,0);
    }
    60% {
        text-shadow: .25em 0 0 #FF6B6B,
                     .5em 0 0 rgba(0,0,0,0);
    }
    80%, 100% {
        text-shadow: .25em 0 0 #FF6B6B,
                     .5em 0 0 #FF6B6B;
    }
}