

/* 面包屑导航 */
.breadcrumb {
    padding: 15px 0;
    color: #191818;
    font-size: 16px;
}

.breadcrumb a {
    color: #191818;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
    color: #1B66E7;
}

/* PDF查看器样式 */
.main-content {
    position: relative;
    padding: 20px 0; /* 移除左右内边距 */
    overflow: hidden; /* 防止溢出 */
    text-align: center; /* 居中内容 */
}

.nav-btn{
    width: 27px;
    height: 47px;
    cursor: pointer;
    background: none;
    border: none;
    position: absolute;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 10; /* 确保按钮在页面上方 */
}
.nav-btn-prev{
    left: 10px; /* 调整左边距 */
    background: url("img/prev-arrow.png") no-repeat center;
}
.nav-btn-next{
    right: 10px; /* 调整右边距 */
    background: url("img/next-arrow.png") no-repeat center;
}
#page-info {
    font-size: 14px;
    color: #666;
}

#zoomLevel {
    min-width: 60px;
    text-align: center;
    font-size: 14px;
    color: #666;
}

#pdf-viewer {
    width: 100%;
    min-height: 800px;
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    overflow: auto;
}

#pdf-viewer canvas {
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.book-container {
    margin: 20px auto;
    border-radius: 8px;
    perspective: 2000px;
    width: 1187px; /* 匹配book宽度 */
    overflow: visible; /* 修改为visible以显示投影 */
    padding: 40px 0; /* 添加上下内边距，为投影留出空间 */
}

#book {
    width: 1187px; /* 固定宽度 */
    height: 838px; /* 修改高度为838px */
    transform-style: preserve-3d;
    margin: 0 auto; /* 居中显示 */
    box-shadow:0 6px 6px rgba(0,0,0,0.04);  /* 主投影 */
    position: relative; /* 添加相对定位以确保投影效果正确 */
}

.page {
    box-shadow:
        /* 页面边缘阴影 */
        0 0 10px rgba(0,0,0,0.1),
        /* 内部阴影效果 */
        inset 0 0 3px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: #fff;
}

/* 左页渐变 */
.page.odd::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(to right,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.02) 50%,
        rgba(0,0,0,0.05) 100%
    );
    pointer-events: none;
}

/* 右页渐变 */
.page.even::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(to left,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.02) 50%,
        rgba(0,0,0,0.05) 100%
    );
    pointer-events: none;
}

/* 翻页时的渐变效果 */
.page.turning {
    background: linear-gradient(to right,
        rgba(0,0,0,0.05) 0%,
        rgba(0,0,0,0.01) 20%,
        rgba(0,0,0,0) 50%,
        rgba(0,0,0,0.01) 80%,
        rgba(0,0,0,0.05) 100%
    );
}

.page canvas {
    max-width: 100%;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast; /* 提高图像清晰度 */
    image-rendering: crisp-edges;
    position: relative;
}
.hard {
    background: #566573;
    color: white;
    text-align: center;
    padding: 20px;
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.5),
        0 0 20px rgba(0,0,0,0.2);
}

.nav-btn:disabled {
    cursor: not-allowed;
}

#page-info {
    font-size: 14px;
    color: #666;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#zoomLevel {
    min-width: 60px;
    text-align: center;
}

.hard[data-page-number="cover"] {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.hard[data-page-number="insidecover"] {
    background: #34495e;
}

/* 错误消息样式 */
.error-message {
    padding: 20px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    text-align: center;
    font-size: 18px;
    margin: 20px;
}

.page.hard {
    background: linear-gradient(to right,
        rgba(0,0,0,0.02) 0%,
        rgba(0,0,0,0.005) 50%,
        rgba(0,0,0,0.02) 100%
    );
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

@media screen and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
    }

    main {
        background-size: cover;
    }

    /* 头部适配 */
    header .container {
        padding: 10px 20px;
    }

    .logo img {
        height: 35px;
    }

    header .search input {
        width: 200px;
    }
}

@media screen and (max-width: 768px) {
    /* 头部样式 */
    header .container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 15px;
    }

    .search {
        width: 100%;
    }

    header .search input {
        width: 100%;
        max-width: none;
    }

    /* 面包屑导航 */
    .breadcrumb {
        padding: 10px 15px;
        font-size: 14px;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* PDF查看器适配 */
    .main-content {
        padding: 10px;
    }

    .book-container {
        width: 100%;
        padding: 20px 0;
        margin: 0;
    }

    #book {
        width: 100%;
        height: auto;
        transform: none !important;
    }

    .page {
        width: 100% !important;
        height: auto !important;
        margin: 0 auto;
    }

    .page canvas {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
    }

    /* 导航按钮优化 */
    .nav-btn {
        width: 35px;
        height: 35px;
        background-size: contain;
        opacity: 0.8;
    }

    .nav-btn-prev {
        left: 5px;
    }

    .nav-btn-next {
        right: 5px;
    }

    /* 缩放控制 */
    .zoom-controls {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(255, 255, 255, 0.9);
        padding: 10px;
        border-radius: 20px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 100;
    }
}

@media screen and (max-width: 480px) {
    /* 容器调整 */
    .container {
        padding: 0 10px;
    }

    /* 头部进一步优化 */
    header .container {
        padding: 10px;
    }

    .logo img {
        height: 30px;
    }

    /* 搜索框优化 */
    header .search input {
        height: 32px;
        font-size: 14px;
        padding: 0 15px;
        background: rgba(255, 255, 255, 0.9);
    }

    .search button {
        width: 28px;
        height: 28px;
        background-size: 16px;
    }

    /* PDF查看器进一步优化 */
    .book-container {
        padding: 10px 0;
    }

    .nav-btn {
        width: 30px;
        height: 30px;
    }

    /* 错误信息样式 */
    .error-message {
        font-size: 14px;
        padding: 12px;
        margin: 10px;
    }

    /* 缩放控制进一步优化 */
    .zoom-controls {
        padding: 8px;
        bottom: 15px;
    }

    #zoomLevel {
        font-size: 12px;
        min-width: 50px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .nav-btn {
        padding: 15px;
        background-color: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
    }

    .search button {
        padding: 16px;
    }

    .breadcrumb a {
        padding: 5px 0;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .zoom-controls {
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
    }

    .nav-btn {
        background-color: rgba(0, 0, 0, 0.6);
    }
}
