/* 小莉的马拉松梦想 - 故事绘本样式 */

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

body {
    font-family: 'Yuanti SC', 'Yuanti', 'STYuanti', 'Microsoft YaHei', sans-serif;
    background-color: #f9f3e9;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* 标题样式 */
.title {
    text-align: center;
    margin: 20px 0;
    color: #e74c3c;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 2s ease infinite;
}

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

/* 故事内容区域 */
.storybook {
    width: 100%;
    max-width: 900px;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    margin-bottom: 30px;
}

/* 页面样式 */
.page {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    min-height: 600px;
}

.page.active {
    display: flex;
}

/* 图片样式 */
.story-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

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

/* 文本样式 */
.story-text {
    font-size: 1.2rem;
    text-align: justify;
    margin: 20px 0;
    line-height: 1.8;
}

/* 导航按钮 */
.navigation {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 900px;
    margin-top: 20px;
}

.nav-button {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.nav-button:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.nav-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-button.prev {
    background-color: #e67e22;
}

.nav-button.prev:hover {
    background-color: #d35400;
}

.nav-button.next {
    background-color: #2ecc71;
}

.nav-button.next:hover {
    background-color: #27ae60;
}

.nav-button i {
    margin: 0 8px;
}

/* 音频控制 */
.audio-control {
    display: flex;
    align-items: center;
    margin: 15px 0;
    background-color: #f1c40f;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.audio-control:hover {
    background-color: #f39c12;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.audio-button {
    background-color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-right: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.audio-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.audio-text {
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* 页码指示器 */
.page-indicator {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.page-dot {
    width: 12px;
    height: 12px;
    background-color: #bdc3c7;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-dot.active {
    background-color: #3498db;
    transform: scale(1.2);
}

/* 自动播放控制 */
.auto-play-control {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.auto-play-checkbox {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.auto-play-label {
    font-size: 1rem;
    color: #555;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .page {
        padding: 20px;
    }
    
    .story-text {
        font-size: 1rem;
    }
    
    .nav-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .page {
        padding: 15px;
    }
    
    .story-text {
        font-size: 0.9rem;
    }
    
    .nav-button {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
    
    .audio-control {
        padding: 8px 15px;
    }
    
    .audio-button {
        width: 35px;
        height: 35px;
    }
}

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

.page.active {
    animation: fadeIn 0.5s ease forwards;
}

/* 页面切换动画 */
.page-transition {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

.page-transition-icon {
    font-size: 3rem;
    color: #3498db;
    animation: spin 1s linear infinite;
}

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

/* 封面和结束页特殊样式 */
.cover-page, .end-page {
    text-align: center;
    justify-content: center;
}

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

.cover-subtitle {
    font-size: 1.5rem;
    color: #7f8c8d;
    margin-bottom: 30px;
}

.start-button {
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.start-button:hover {
    background-color: #27ae60;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.end-message {
    font-size: 1.8rem;
    color: #e74c3c;
    margin: 20px 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.restart-button {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.restart-button:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* 兔子装饰 */
.rabbit-decoration {
    position: absolute;
    width: 80px;
    height: 80px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50,20c-16.5,0-30,13.5-30,30s13.5,30,30,30s30-13.5,30-30S66.5,20,50,20z M35,40c2.8,0,5,2.2,5,5s-2.2,5-5,5s-5-2.2-5-5S32.2,40,35,40z M65,40c2.8,0,5,2.2,5,5s-2.2,5-5,5s-5-2.2-5-5S62.2,40,65,40z M50,70c-8.3,0-15-6.7-15-15h30C65,63.3,58.3,70,50,70z" fill="%23e74c3c"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: -1;
}

.rabbit-1 {
    top: 10%;
    left: 5%;
    animation: float 8s ease-in-out infinite;
}

.rabbit-2 {
    bottom: 10%;
    right: 5%;
    animation: float 10s ease-in-out infinite reverse;
}

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