:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --background-color: #f0f0f0;
    --text-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --page-color: #fff;
    --book-shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    perspective: 2000px;
}

.book-container {
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    position: relative;
    transform-style: preserve-3d;
}

.navigation {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 1000;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.nav-btn, .play-btn {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn {
    background-color: var(--secondary-color);
    color: white;
}

.play-btn {
    background-color: var(--primary-color);
    color: white;
}

.nav-btn:hover, .play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px var(--shadow-color);
}

.pages-container {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-style: preserve-3d;
    display: none;
}

.page.active {
    display: block;
}

.page-front, .page-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--shadow-color);
    overflow: hidden;
}

.page-back {
    transform: rotateY(180deg);
}

/* 封面样式 */
#cover .page-front {
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 20px;
}

.cover-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

#cover h1 {
    font-size: 3em;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
}

.cover-image {
    width: 80%;
    height: 60%;
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px var(--shadow-color);
}

.cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#cover h2 {
    font-size: 2em;
    color: var(--secondary-color);
    margin: 30px 0;
    text-align: center;
}

/* 内容页面样式 */
.content-page .page-front {
    display: flex;
    background: white;
}

.image-container {
    width: 50%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.text-container {
    width: 50%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}

.text-container h2 {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 30px;
    text-align: center;
}

.text-container p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: justify;
    color: var(--text-color);
}

.author {
    font-style: italic;
    color: #666;
    text-align: center;
    margin-top: 20px;
}

/* 翻页效果 */
.page.flipping {
    transform: rotateY(-180deg);
}

.page.flipped {
    transform: rotateY(-180deg);
}

/* 页面阴影效果 */
.page::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.1));
    z-index: 2;
    pointer-events: none;
    border-radius: 0 10px 10px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .book-container {
        width: 95%;
        height: 90vh;
    }

    .content-page .page-front {
        flex-direction: column;
    }

    .image-container, .text-container {
        width: 100%;
    }

    .image-container {
        height: 50%;
    }

    .text-container {
        height: 50%;
        padding: 20px;
    }

    #cover h1 {
        font-size: 2em;
    }

    #cover h2 {
        font-size: 1.4em;
    }

    .text-container h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .text-container p {
        font-size: 1em;
        line-height: 1.6;
    }

    .nav-btn, .play-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .cover-image {
        width: 90%;
        height: 50%;
    }
}

/* 翻页时的光影效果 */
.page.flipping::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0) 100%);
    z-index: 3;
    pointer-events: none;
    animation: pageTurn 0.8s ease-in-out;
}

@keyframes pageTurn {
    0% { transform: translateX(-100%) skewX(45deg); }
    100% { transform: translateX(100%) skewX(45deg); }
}