* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SimSun', '宋体', serif;
    background: #000;
    min-height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: none;
    overflow: hidden;
    touch-action: none;
    /* 禁用浏览器默认的触摸行为 */
    /* 修复：避免 body 上的 3D 透视导致微信内 position:fixed 点击失效 */
}

.book {
    width: 100vw;
    height: 100vh;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 0.8s ease-in-out;
    border: none;
}

.page-content {
    padding: 0;
    text-align: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 优化图片显示与渲染性能 */
.page-image {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    object-position: center center;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
    border: none;
    image-rendering: auto;
    content-visibility: auto;
    /* 仅在可视区域附近渲染，降低初始开销 */
    contain-intrinsic-size: 100vh 100vw;
    /* 预留布局尺寸，避免 CLS */
    transition: transform 0.3s ease;
    transform-origin: center center;
    touch-action: none;
    /* 禁用浏览器默认的触摸行为 */
}

/* 图片点击效果已移除 */

.page h1,
.page h2 {
    display: none;
}

.page p {
    display: none;
}

.page ul {
    text-align: left;
    margin-left: 30px;
    list-style-type: none;
}

.page li {
    margin-bottom: 8px;
    color: #6d4c41;
    font-size: 0.95em;
    position: relative;
    padding-left: 20px;
}

.page li:before {
    content: "•";
    color: #8d6e63;
    position: absolute;
    left: 0;
    font-size: 1.2em;
}

/* 页面背景样式已移除 */

.navigation {
    display: none;
}

/* 导航按钮样式已移除 */

/* 缩略图条 */
.thumb-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    overflow-x: auto;
    white-space: nowrap;
    z-index: 15;
    backdrop-filter: blur(8px);
}

.thumb-bar .thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease;
    opacity: 0.7;
}

.thumb-bar .thumb:hover {
    transform: translateY(-2px) scale(1.05);
    opacity: 1;
}

.thumb-bar .thumb.active {
    border-color: #ff0000;
    opacity: 1;
    transform: scale(1.1);
}

/* 进度条 */
.progress-container {
    position: fixed;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    width: 60vw;
    max-width: 600px;
    z-index: 10;
}

.progress-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: none;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.8);
    transition: width 0.3s ease;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: #fff;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button:focus-visible {
    outline: 2px solid #5d4037;
}

.page-indicator {
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* 可访问性与交互优化 */
.book:focus-within {
    outline: 2px dashed rgba(93, 64, 55, 0.35);
    outline-offset: 6px;
}

/* 加载覆盖层样式 */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 999;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.loading-text {
    color: #fff;
    font-size: 14px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 微信分享引导遮罩与卡片 */
.share-guide {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.share-tip-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px 18px;
    max-width: 86vw;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    text-align: left;
}

.share-tip-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.share-tip-desc {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.5;
}

.share-tip-url {
    font-size: 12px;
    color: #888;
    word-break: break-all;
    background: #f6f6f6;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.share-tip-close {
    padding: 8px 12px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    background: #4caf50;
    color: #fff;
    cursor: pointer;
}

/* 分享引导指示气泡（移动端优化） */
.share-tip-pointer {
    position: fixed;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1001;
}

.share-tip-pointer::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 10px;
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.78) transparent transparent transparent;
}

.share-tip-card .share-tip-preview .share-tip-thumb {
    box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
}

.share-tip-card .share-tip-meta-title {
    max-width: 58vw;
}

.share-tip-card .share-tip-meta-desc {
    max-width: 58vw;
}

/* 3D 透视容器 */
.scene {
    perspective: 1000px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .book {
        width: 100vw;
        height: 100vh;
    }

    .page-content {
        padding: 0;
    }

    .page-image {
        width: 100vw;
        height: 100vh;
        margin: 0;
        contain-intrinsic-size: 100vh 100vw;
    }

    .page h1,
    .page h2 {
        font-size: 1.3em;
    }

    /* 移动端导航样式已移除 */

    .thumb-bar {
        bottom: 15px;
        padding: 6px 10px;
        gap: 6px;
    }

    .thumb-bar .thumb {
        width: 50px;
        height: 38px;
    }

    .progress-container {
        bottom: 70px;
        width: 80vw;
    }

    button {
        padding: 8px 16px;
        font-size: 12px;
    }
}

@media (min-width: 769px) {
    .share-tip-pointer {
        display: none;
    }
}