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

:root {
    --page-width: 100%;
    --page-height: 100vh;
    --flip-duration: 0.8s;
    --snow-gradient: linear-gradient(180deg, #e8f4fc 0%, #b8d4e8 50%, #87ceeb 100%);
    --warm-gradient: linear-gradient(180deg, #ff9a56 0%, #ff6b35 50%, #d32f2f 100%);
    --night-gradient: linear-gradient(180deg, #1a237e 0%, #3949ab 50%, #5c6bc0 100%);
    --spring-gradient: linear-gradient(180deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%);
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.book-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 2000px;
    padding: 20px;
    box-sizing: border-box;
}

.book {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: auto;
    aspect-ratio: 3 / 4;
    transform-style: preserve-3d;
}

.pages {
    position: relative;
    width: 100%;
    height: 100%;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    cursor: pointer;
    overflow: hidden;
}

.page.flipped {
    display: none;
}

.page-cover {
    background: url('../images/page1.jpg');
    background-size: cover;
    background-position: center center;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    text-align: center;
    color: white;
    padding-top: 25%;
}

.page-cover .page-content {
    padding: 40px;
}

.cover-title {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: bold;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.5),
        -1px -1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    letter-spacing: 8px;
    text-stroke: 1px rgba(0, 0, 0, 0.5);
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.5);
}

.cover-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
    opacity: 0.9;
    margin-bottom: 40px;
    text-shadow: 
        0 0 8px rgba(255, 255, 255, 0.6),
        1px 1px 3px rgba(0, 0, 0, 0.4);
}

.start-hint, .restart-hint {
    font-size: clamp(0.8rem, 2vw, 1rem);
    text-shadow: 
        0 0 6px rgba(255, 255, 255, 0.8),
        1px 1px 2px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
    animation: pulse 2s infinite;
}

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

.page-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 12px;
    position: relative;
}

.illustration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 0;
}

/* 每个页面的图片和背景色 */
.snow-scene1 {
    background: url('../images/page1.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.snow-scene2 {
    background: url('../images/page2.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.snow-scene3 {
    background: url('../images/page3.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.snow-scene4 {
    background: url('../images/page4.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.snow-scene5 {
    background: url('../images/page5.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.snow-scene6 {
    background: url('../images/page6.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.snow-scene7 {
    background: url('../images/page7.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.snow-scene8 {
    background: url('../images/page8.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.snow-scene9 {
    background: url('../images/page9.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.snow-scene10 {
    background: url('../images/page10.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.snow-scene11 {
    background: url('../images/page11.jpg');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
}

.story-text {
    position: relative;
    z-index: 1;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    margin-top: auto;
}

.story-text h2 {
    font-size: clamp(0.95rem, 2.8vw, 1.2rem);
    color: #4a90d9;
    margin-bottom: 6px;
}

.story-text p {
    font-size: clamp(0.8rem, 2.3vw, 1rem);
    color: #333;
    line-height: 1.6;
    text-indent: 2em;
}

/* 翻页提示 */
.page-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.75rem;
    color: rgba(0,0,0,0.4);
    opacity: 0.7;
}

.quiz-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.quiz-bg {
    background: url('../images/zhi.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
}

.quiz-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: -1;
}

.quiz-question {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.question-text {
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: #333;
    line-height: 1.6;
    text-align: left;
    padding: 0 10px;
    font-family: 'STKaiti', 'KaiTi', '楷体', 'SimKai', serif;
}

.question-label {
    font-size: clamp(1.5rem, 5vw, 1.8rem);
    font-weight: bold;
    color: #000000;
    font-family: 'SimHei', 'Heiti SC', '黑体', sans-serif;
}

.question-stem {
    font-weight: bold;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: center;
}

.option-btn {
    padding: 14px 20px;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: clamp(0.95rem, 2.8vw, 1.1rem);
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 50%;
    text-align: center;
    font-family: 'STKaiti', 'KaiTi', '楷体', 'SimKai', serif;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f5f5ff;
}

.option-btn.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.option-btn.correct {
    border-color: #4caf50;
    background: #4caf50;
    color: white;
}

.option-btn.wrong {
    border-color: #f44336;
    background: #f44336;
    color: white;
}

.quiz-result {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.quiz-result > p {
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    margin: 0;
    font-weight: bold;
    color: #4a90d9;
}

.quiz-result .result-correct {
    color: #4caf50;
}

.quiz-result .result-wrong {
    color: #f44336;
}

.result-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.reading-quote {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    color: #8b5a2b;
    font-style: italic;
    margin: 0;
    font-weight: bold;
    font-family: 'STKaiti', 'KaiTi', '楷体', 'SimKai', serif;
    text-shadow: 2px 2px 4px rgba(139, 90, 43, 0.15);
    letter-spacing: 2px;
    line-height: 1.8;
}

.copyright {
    font-size: clamp(0.85rem, 2.5vw, 1rem);
    color: #a08060;
    margin: 0;
}

.copyright-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed #a08060;
}

.copyright-link:hover {
    color: #8b5a2b;
    border-bottom: 1px solid #8b5a2b;
}

.btn-retry {
    padding: 12px 35px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: clamp(0.9rem, 2.7vw, 1.1rem);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-retry:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.page-end {
    background: url('../images/page11.jpg');
    background-size: cover;
    background-position: center center;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    color: white;
    text-align: center;
    padding-bottom: 30px;
}

.end-title {
    font-size: clamp(1.6rem, 5.5vw, 2.8rem);
    font-weight: bold;
    margin-bottom: 18px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.end-message {
    font-size: clamp(1rem, 3.2vw, 1.5rem);
    margin-bottom: 25px;
    opacity: 0.9;
}

/* 响应式布局 */

/* 移动端竖屏 - 全屏显示，保持原有样式 */
@media (max-width: 500px) and (orientation: portrait) {
    .book-container {
        padding: 0;
        width: 100%;
        height: 100vh;
    }

    .book {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        aspect-ratio: unset;
    }

    .page {
        border-radius: 8px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    }

    .illustration {
        background-size: cover;
    }

    .story-text {
        padding: 12px 15px;
    }

    .story-text p {
        font-size: 1.15rem;
        line-height: 1.7;
    }

    .page-cover .page-content {
        justify-content: center;
        align-items: center;
        height: 100%;
        padding-top: 0;
    }

    .cover-title {
        font-size: 3rem;
        margin-bottom: 15px;
    }

    .cover-subtitle {
        font-size: 1.3rem;
        margin-bottom: 30px;
    }

    .start-hint {
        font-size: 1.1rem;
    }
}

/* 平板竖屏 - 全屏显示，保持原有样式 */
@media (min-width: 501px) and (max-width: 900px) and (orientation: portrait) {
    .book-container {
        padding: 0;
        width: 100%;
        height: 100vh;
    }

    .book {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        aspect-ratio: unset;
    }

    .page {
        border-radius: 8px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    }

    .illustration {
        background-size: cover;
    }
}

/* 平板横屏 + PC横屏 */
@media (orientation: landscape) {
    .book-container {
        padding: 30px;
    }

    .book {
        max-width: min(400px, 50vh);
        height: auto;
        aspect-ratio: 3 / 4;
    }

    .page-content {
        padding: 12px;
    }
}

/* 大屏幕PC */
@media (min-width: 1200px) {
    .book {
        max-width: 480px;
    }

    .page:hover {
        box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    }
}

/* 横屏且高度很小的情况 */
@media (orientation: landscape) and (max-height: 600px) {
    .book {
        max-width: min(340px, 55vh);
    }
}

/* 触屏设备优化 */
@media (hover: none) and (pointer: coarse) {
    .option-btn:active {
        transform: scale(0.98);
    }
}

/* 超大屏幕 */
@media (min-width: 1600px) {
    .book {
        max-width: 520px;
    }
}






/* 手指滑动提示 */
.swipe-hint {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: rgba(0,0,0,0.3);
    opacity: 0.8;
}

/* 页码指示器 */
.page-indicator {
    position: absolute;
    top: 15px;
    right: 20px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #4a90d9;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    z-index: 100;
}
