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

body {
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    background-color: #f0f7ff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 故事书容器 */
.storybook {
    max-width: 1000px;
    width: 90%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: auto;
}

/* 标题页样式 */
.title-page {
    text-align: center;
    margin-bottom: 30px;
}

.title-page h1 {
    color: #e74c3c;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 控制按钮样式 */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

button {
    padding: 10px 20px;
    font-size: 1.1em;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #3498db;
    color: white;
}

button:hover {
    transform: scale(1.05);
    background-color: #2980b9;
}

#playBtn {
    background-color: #2ecc71;
}

#playBtn:hover {
    background-color: #27ae60;
}

/* 页面样式 */
.pages {
    position: relative;
}

.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

/* 图片样式 */
.page img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 文字样式 */
.page p {
    font-size: 1.2em;
    line-height: 1.8;
    color: #333;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    margin-top: 20px;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .storybook {
        padding: 15px;
    }

    .title-page h1 {
        font-size: 2em;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    button {
        width: 100%;
        max-width: 200px;
    }

    .page p {
        font-size: 1em;
        padding: 15px;
    }
}

/* 朗读状态样式 */
.playing {
    background-color: #e8f6ff !important;
}

/* 无障碍支持 */
button:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .controls {
        display: none;
    }

    .page {
        display: block;
        page-break-after: always;
    }
}