/* ========== 榜单页面公共样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
body {
    background-color: #f5f7fb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #1e293b;
    padding-bottom: 70px;
}
/* 固定头部容器（包含返回、标题、选项卡） */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    right: 0;
    background: #fff;
    z-index: 100;
    border-bottom: 1px solid #edf2f7;
}
/* 第一行：返回箭头 + 标题 + 占位 */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
}
.header-top .back {
    font-size: 20px;
    color: #1e293b;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.header-top .title {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}
.header-top .right-placeholder {
    width: 24px;
    visibility: hidden;
}
/* 选项卡区域（搜索图标紧贴右侧） */
.tab-bar {
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0 8px 16px;  /* 右侧无内边距，让搜索图标贴边 */
}
.tab-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    scrollbar-width: thin;
}
.tab-scroll a {
    display: inline-block;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #5b6e8c;
    text-decoration: none;
    border-radius: 30px;
    background: #f1f5f9;
    transition: all 0.2s;
}
.tab-scroll a.active {
    background: linear-gradient(135deg, #1cbbb4, #11998e);
    color: white;
    box-shadow: 0 2px 6px rgba(28,187,180,0.3);
}
/* 搜索图标样式（紧贴右侧，无额外边距） */
.search-icon-wrap {
    flex-shrink: 0;
    padding: 0 16px 0 8px;  /* 右侧留出安全边距，但整体靠右 */
}
.search-icon-wrap .search-icon {
    font-size: 22px;
    color: #5b6e8c;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.search-icon-wrap .search-icon:active {
    opacity: 0.6;
}
/* 占位高度 = 头部总高度（第一行 + 选项卡） */
.header-placeholder {
    height: 104px; /* 第一行约56px + 选项卡约48px */
}
/* 书籍列表 */
.book-list {
    padding: 16px;
    list-style: none;
    margin-bottom: 0;
}
.book-item {
    display: flex;
    background: #fff;
    border-radius: 20px;
    margin-bottom: 16px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid #edf2f7;
    transition: transform 0.1s;
    cursor: pointer;
}
.book-item:active {
    transform: scale(0.98);
}
.book-cover {
    width: 90px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.book-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.book-desc {
    font-size: 12px;
    color: #6c7a91;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}
.book-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tag {
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 10px;
    color: #5b6e8c;
}
/* 分页样式 */
.pagination {
    text-align: center;
    margin-top: -15px;
    padding: 0 16px 20px;
}
.pagination ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.pagination ul li a,
.pagination ul li span {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    font-size: 13px;
    color: #1cbbb4;
    text-decoration: none;
}
.pagination ul li.active a,
.pagination ul li.active span {
    background: linear-gradient(135deg, #1cbbb4, #11998e);
    color: white;
    border-color: transparent;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 14px;
}
img {
    pointer-events: none;
}