/* ========== 索引页面专属样式（覆盖外部库冲突） ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ----- 全局链接去下划线 ----- */
a,
a:hover,
a:focus,
a:active,
a:visited {
    text-decoration: none !important;
}

/* ----- 页面主体（固定高度，禁止滚动） ----- */
html, body {
    height: 100%;
    overflow: hidden !important;
}
body {
    font-family: "华文楷体", "STKaiti", "KaiTi", "Poppins", serif;
    background: transparent !important;
    color: #1e1e1e;
    padding: 30px 20px;
    min-height: 100vh;
}

/* ----- 背景视频层 ----- */
#bg-video-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: #1a2a3a;
}
#bg-video-layer .fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1a2a3a, #2c3e50, #1a2a3a);
    z-index: 0;
}
#bg-video-layer iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw;
    min-height: 100vh;
    min-width: 177.78vh;
    border: none;
    pointer-events: none;
    z-index: 1;
}
#bg-video-layer .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2;
    pointer-events: none;
}

/* ----- 主容器（占满视口，flex 布局） ----- */
.master-container {
    position: relative;
    z-index: 1;
    max-width: 1300px;          /* 适配5列，比原来略宽 */
    height: 100vh;
    margin: 0 auto;
    padding: 30px 35px;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    display: flex;
    flex-direction: column;
}

/* ----- 标题区域 ----- */
.header {
    text-align: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}
.header h1 {
    font-size: 2.5em;
    letter-spacing: 4px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.header p {
    color: rgba(255,255,255,0.8);
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
    margin-top: 8px;
}

/* ----- 统计栏 ----- */
.stats {
    background: rgba(255,255,255,0.25) !important;
    backdrop-filter: blur(6px);
    padding: 12px 20px;
    border-radius: 16px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.stats span { font-size: 1.1em; }

/* ----- 分页导航 ----- */
.pagination {
    text-align: center;
    margin: 10px 0 15px 0;
    font-size: 1.05em;
    flex-shrink: 0;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 14px;
    margin: 0 3px;
    border-radius: 6px;
    background: rgba(255,255,255,0.3) !important;
    backdrop-filter: blur(4px);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.15s;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.pagination a:hover {
    background: rgba(255,255,255,0.5) !important;
    border-color: #fff;
}
.pagination .current {
    background: rgba(255,215,0,0.5) !important;
    border-color: #FFD700;
    color: #fff !important;
    font-weight: bold;
}
.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination .ellipsis {
    border: none;
    background: none !important;
    padding: 6px 4px;
}

/* ----- 书籍卡片网格（固定5列，可滚动） ----- */
.book-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);   /* 改为5列 */
    gap: 18px;                             /* 适当增加间距，更宽松 */
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    min-height: 0;
    align-content: start;
}

/* 自定义滚动条样式 */
.book-list::-webkit-scrollbar {
    width: 6px;
}
.book-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
.book-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}
.book-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* ----- 书籍卡片（半透明毛玻璃，高度自适应） ----- */
.book-item {
    background: rgba(255, 255, 255, 0.85) !important;
    padding: 16px 18px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: all 0.25s;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: auto;
}
.book-item:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    transform: translateY(-4px);
    background: rgba(255,255,255,0.95) !important;
}
.book-item h3 {
    font-size: 1.1em;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.book-item a { color: #2c5f2d !important; }
.book-item a:hover { color: #1a3d1a !important; }
.book-item p {
    margin: 4px 0;
    color: #555;
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.book-item .intro {
    color: #333;
    font-size: 0.85em;
    margin: 6px 0 4px 0;
    line-height: 1.5;
    border-left: 3px solid #2c5f2d;
    padding-left: 8px;
    background: rgba(250,250,250,0.7);
    border-radius: 4px;
    /* 完整显示简介，不截断，允许换行 */
    display: block;
    white-space: normal;
    overflow: visible;
    word-wrap: break-word;
}

/* ----- 页脚 ----- */
.footer {
    margin-top: 20px;
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.9em;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 15px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.footer a {
    color: rgba(255,255,255,0.8) !important;
}
.footer a:hover {
    color: #ffffff !important;
}

/* ----- 修复 Bootstrap 栅格在 stats 中的样式 ----- */
.stats .col-md-4 {
    text-align: center;
    padding: 0 10px;
}

/* ===== 响应式调整列数 ===== */
@media (max-width: 1200px) {
    .book-list {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 992px) {
    .book-list {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .master-container {
        padding: 15px 20px;
        height: 100vh;
    }
    .header h1 { font-size: 1.8em; }
    .book-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .book-item { padding: 12px 14px; }
    .stats { padding: 10px 15px; }
}
@media (max-width: 480px) {
    .book-list {
        grid-template-columns: 1fr;
    }
}