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

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

.storybook-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* 标题页样式 */
.title-page {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

.main-title {
    font-size: 3rem;
    color: #FF6B6B;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 2s infinite;
}

.title-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
    font-size: 4rem;
}

.rabbit {
    animation: hop 3s infinite;
}

.white-rabbit {
    animation-delay: 0s;
}

.black-rabbit {
    animation-delay: 1.5s;
}

.heart {
    color: #FF69B4;
    animation: pulse 2s infinite;
}

.subtitle {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 40px;
}

.start-button {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    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(0, 0, 0, 0.2);
}

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

/* 故事页面样式 */
.story-page {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease-in;
}

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

.scene-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

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

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

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

.scene-text h2 {
    color: #FF6B6B;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.scene-text p {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 15px;
    text-align: justify;
}

/* 结束页样式 */
.end-page {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

.end-content h2 {
    font-size: 3rem;
    color: #4ECDC4;
    margin-bottom: 30px;
}

.end-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
    font-size: 4rem;
}

.rainbow {
    animation: rainbow 3s infinite;
}

.moral {
    font-size: 1.8rem;
    color: #666;
    margin-bottom: 40px;
    font-style: italic;
}

.restart-button {
    background: linear-gradient(45deg, #4ECDC4, #45B7D1);
    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(0, 0, 0, 0.2);
}

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

/* 控制面板样式 */
.controls {
    display: none;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.controls.active {
    display: flex;
}

.control-btn {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-container {
    width: 200px;
    height: 8px;
    background: #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    width: 0%;
    transition: width 0.3s ease;
}

/* 页面指示器 */
.page-indicator {
    display: none;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

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

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

.dot.active {
    background: #FF6B6B;
    transform: scale(1.2);
}

.dot:hover {
    background: #4ECDC4;
}

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

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

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

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .storybook-container {
        padding: 10px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .title-illustration {
        font-size: 3rem;
    }
    
    .scene-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .scene-text h2 {
        font-size: 2rem;
    }
    
    .scene-text p {
        font-size: 1.1rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .audio-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-container {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.5rem;
    }
    
    .title-illustration {
        font-size: 2.5rem;
    }
    
    .scene-text h2 {
        font-size: 1.5rem;
    }
    
    .scene-text p {
        font-size: 1rem;
    }
    
    .control-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }
    
    .controls,
    .page-indicator {
        display: none !important;
    }
    
    .story-page {
        display: block !important;
        page-break-after: always;
        background: white;
        box-shadow: none;
    }
    
    .scene-content {
        grid-template-columns: 1fr;
    }
}