/* 雨天追兔子儿童故事书样式 */

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

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 50%, #FFB6C1 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.storybook-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: fadeIn 1s ease-in;
}

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

.story-header {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    color: white;
    text-align: center;
    padding: 30px 20px;
    position: relative;
    overflow: hidden;
}

.story-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.3)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.2)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.4)"/></svg>');
    animation: float 20s infinite linear;
}

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

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

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

.story-main {
    position: relative;
    min-height: 600px;
}

.story-page {
    display: none;
    padding: 40px;
    animation: slideIn 0.5s ease-in-out;
}

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

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

.illustration-container {
    text-align: center;
    margin-bottom: 30px;
}

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

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

.story-content {
    max-width: 800px;
    margin: 0 auto;
}

.story-content h2 {
    color: #2C3E50;
    font-size: 2em;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.story-content h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    margin: 10px auto;
    border-radius: 2px;
}

.story-content p {
    font-size: 1.3em;
    color: #34495E;
    margin-bottom: 15px;
    text-align: justify;
    padding: 0 10px;
}

.story-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: #F8F9FA;
    border-top: 1px solid #E9ECEF;
}

.nav-btn {
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

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

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

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

.audio-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: #F1F2F6;
}

.audio-btn {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.audio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.audio-btn.active {
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
}

.story-footer {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    text-align: center;
    padding: 25px;
    font-size: 1.2em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .story-page {
        padding: 20px;
    }
    
    .story-header h1 {
        font-size: 2em;
    }
    
    .story-content h2 {
        font-size: 1.6em;
    }
    
    .story-content p {
        font-size: 1.1em;
    }
    
    .story-controls {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nav-btn, .audio-btn {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    .audio-controls {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .story-header h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .story-content p {
        font-size: 1em;
        padding: 0 5px;
    }
    
    .story-controls {
        flex-direction: column;
        gap: 15px;
    }
}

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

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

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