/**
 * comic-extra.css - 额外样式
 * 迭代17-30: 阅读器、分页、返回顶部、加载动画等
 */

/* ============ 导航栏未读徽章 ============ */
.nav-item {
    position: relative;
}

.nav-badge {
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.4);
    animation: pulse-nav-badge 2s infinite;
}

@keyframes pulse-nav-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* 手机端导航栏两行布局 */
@media (max-width: 640px) {
    .header-inner {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 6px 0;
        align-items: center;
        position: relative;
    }

    /* 第一行：网站名水平居中 */
    .header-inner > .site-name {
        grid-column: 1;
        grid-row: 1;
        font-size: 26px;
        margin: 0;
        text-align: center;
        justify-self: center;
    }

    /* 第一行右：功能按钮绝对定位到右边 */
    .header-inner > .nav-actions {
        position: absolute;
        right: 0;
        top: 0;
        display: flex;
        gap: 6px;
    }

    /* 第二行：栏目导航 */
    .header-inner > .nav {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        justify-content: flex-start;
    }

    .nav-item {
        padding: 5px 10px;
        font-size: 13px;
    }

    .nav-offline-btn,
    .nav-icon {
        width: 32px;
        height: 32px;
    }

    .nav-offline-btn svg,
    .nav-icon svg {
        width: 16px;
        height: 16px;
    }
}

/* ============ 迭代17: 阅读页头部 (紧凑版) ============ */
.reader-header {
    background-color: rgba(255,255,255,0.95);
    padding: 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.reader-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 5px;
}

.reader-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    background-color: transparent;
    transition: var(--transition);
}

.reader-nav-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.reader-nav-btn svg {
    width: 14px;
    height: 14px;
}

.reader-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 5px;
}

/* ============ 迭代18: 阅读器图片样式 ============ */
.reader-content {
    background-color: #000;
    min-height: 100vh;
}

.reader-images {
    max-width: var(--max-width);
    margin: 0 auto;
}

.reader-image {
    width: 100%;
    display: block;
    margin: 0;
    padding: 0;
}

.reader-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 图片加载占位 */
.reader-image.loading {
    min-height: 300px;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reader-image.loading::after {
    content: '加载中...';
    color: #666;
    font-size: 14px;
}

/* ============ 迭代19: 上下章按钮 (紧凑版) ============ */
.reader-footer {
    background-color: rgba(255,255,255,0.95);
    padding: 8px 5px;
    border-top: 1px solid var(--border);
}

.reader-chapter-nav {
    display: flex;
    gap: 8px;
    max-width: var(--max-width);
    margin: 0 auto;
}

.chapter-nav-btn {
    flex: 1;
    max-width: 49%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background-color: var(--bg);
    color: var(--text);
    transition: var(--transition);
}

.chapter-nav-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.chapter-nav-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============ 迭代20-21: 返回顶部按钮 ============ */
/* 右侧垂直居中 */
.back-to-top-right {
    position: fixed;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0, 212, 138, 0.02);
    border: 1px solid rgba(0, 212, 138, 0.15);
    color: var(--primary);
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top-right.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top-right:hover {
    background-color: rgba(0, 212, 138, 0.1);
    border-color: rgba(0, 212, 138, 0.3);
}

/* 顶部水平居中 */
.back-to-top-center {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: 20px;
    background-color: rgba(0, 212, 138, 0.02);
    border: 1px solid rgba(0, 212, 138, 0.15);
    color: var(--primary);
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top-center.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top-center:hover {
    background-color: rgba(0, 212, 138, 0.1);
    border-color: rgba(0, 212, 138, 0.3);
}

/* ============ 迭代23: 分页组件 ============ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 20px 0;
}

.pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.pagination-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-item.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.pagination-ellipsis {
    color: var(--text-muted);
    padding: 0 5px;
}

/* ============ 迭代24: 书架页面 ============ */
.bookshelf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 15px;
}

.bookshelf-title {
    font-size: 18px;
    font-weight: 600;
}

.bookshelf-actions {
    display: flex;
    gap: 10px;
}

.bookshelf-btn {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    background-color: var(--bg);
    color: var(--text-muted);
    transition: var(--transition);
}

.bookshelf-btn:hover {
    color: var(--primary);
}

.bookshelf-btn.active {
    background-color: var(--primary);
    color: #fff;
}

.bookshelf-empty {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
}

.bookshelf-empty-icon {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.bookshelf-empty-text {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ============ 迭代25: 分类页面 ============ */
.category-filter {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 15px;
}

.filter-group {
    margin-bottom: 12px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    background-color: var(--bg);
    color: var(--text);
    transition: var(--transition);
}

.filter-option:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.filter-option.active {
    background-color: var(--primary);
    color: #fff;
}

/* ============ 搜索高亮样式 ============ */
mark {
    background: linear-gradient(120deg, rgba(0, 212, 138, 0.3) 0%, rgba(0, 212, 138, 0.5) 100%);
    color: var(--primary-dark);
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

.book-title mark,
.book-meta mark {
    background: linear-gradient(120deg, rgba(0, 212, 138, 0.25) 0%, rgba(0, 212, 138, 0.4) 100%);
}

/* ============ 搜索结果页优化样式 ============ */
.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    margin-bottom: 10px;
}

/* 标签聚合区 */
.search-tags-section {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    padding: 12px 15px;
    margin-bottom: 15px;
}

.search-tags-header {
    margin-bottom: 10px;
}

.search-tags-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.search-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--bg) 0%, #f0f0f0 100%);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.search-tag-item:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(0, 212, 138, 0.15) 100%);
    border-color: var(--primary);
    color: var(--primary);
}

.search-tag-item .tag-name {
    font-weight: 500;
}

.search-tag-item .tag-count {
    background-color: var(--primary);
    color: #fff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* 分类栏目区分 */
.search-category-section {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 15px;
}

.search-category-section .section-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.search-category-section .section-title {
    font-size: 16px;
}

/* 迷你标签 */
.mini-tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    background-color: var(--bg);
    color: var(--text-muted);
    border-radius: 4px;
    margin-right: 4px;
    margin-top: 4px;
}

/* 手机端适配 */
@media (max-width: 640px) {
    .search-tags-section {
        padding: 10px 12px;
    }

    .search-tag-item {
        padding: 5px 10px;
        font-size: 12px;
    }

    .search-category-section {
        padding: 12px;
    }
}

/* ============ 迭代26: 搜索框样式 ============ */
.search-box {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 2px solid var(--border);
    border-radius: 25px;
    padding: 10px 18px;
    margin: 15px 0;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 212, 138, 0.15);
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    font-size: 16px;
    color: var(--text);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn {
    padding: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    transition: var(--transition);
    margin-left: 8px;
}

.search-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 212, 138, 0.4);
}

/* 导航操作按钮组 */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ============ 迭代27: 加载动画 ============ */
/* Spinner */
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, var(--bg) 25%, #e8e8e8 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-cover {
    width: 100%;
    padding-top: 133.33%;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 16px;
    border-radius: 4px;
    margin-top: 8px;
}

.skeleton-text.short {
    width: 60%;
}

/* ============ 迭代28: 空状态提示 ============ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.empty-text {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.empty-action {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background-color: var(--primary);
    color: #fff;
    font-size: 14px;
}

/* ============ 迭代29: 图片懒加载 ============ */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* ============ 迭代30: 其他优化 ============ */
/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

.footer a {
    color: var(--primary);
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 32px;
    border-radius: var(--radius-md);
    background-color: rgba(0, 180, 120, 0.95);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 更新标记 */
.update-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    background-color: #ff6b6b;
    color: #fff;
    margin-left: 5px;
}

/* 评分星星 */
.rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #ffa502;
}

.rating-value {
    margin-left: 5px;
    color: var(--text);
    font-size: 14px;
}

/* 手机端适配 */
@media (max-width: 640px) {
    .reader-nav-btn {
        font-size: 12px;
        padding: 3px 6px;
    }

    .reader-nav-btn svg {
        width: 12px;
        height: 12px;
    }

    .reader-title {
        font-size: 13px;
    }

    .chapter-nav-btn {
        font-size: 12px;
        padding: 6px 8px;
    }

    .back-to-top-right {
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .pagination-item {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }

    /* 移动端书架删除按钮始终显示 */
    .book-card .remove-btn {
        opacity: 0.8;
    }
}

/* ============ 简介展开/收起 ============ */
.desc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
}

.desc-toggle:hover {
    opacity: 0.8;
}

.desc-toggle svg {
    transition: transform 0.3s ease;
}

/* ============ 章节列表折叠 ============ */
.chapter-list.collapsed {
    max-height: 400px;
    overflow: hidden;
    position: relative;
}

.chapter-list.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--bg-card));
    pointer-events: none;
}

.chapter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px;
    margin-top: 8px;
    font-size: 14px;
    color: var(--primary);
    background-color: var(--bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.chapter-toggle:hover {
    background-color: var(--primary-light);
}

.chapter-toggle svg {
    transition: transform 0.3s ease;
}

/* ============ 阅读进度条 ============ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ============ 图片加载失败 ============ */
.img-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background-color: #1a1a1a;
    color: #666;
    font-size: 14px;
}

.img-error-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* ============ 阅读量显示 ============ */
.view-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.view-count svg {
    width: 14px;
    height: 14px;
}

/* ============ 分享按钮 ============ */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-muted);
    background-color: var(--bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

/* ============ 搜索页横排分类筛选 ============ */
.search-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 15px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.search-category-filter .filter-item {
    display: inline-block;
    padding: 6px 16px;
    font-size: 14px;
    color: var(--text);
    background-color: var(--bg);
    border-radius: 20px;
    white-space: nowrap;
    transition: var(--transition);
    border: 1px solid transparent;
}

.search-category-filter .filter-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.search-category-filter .filter-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-color: var(--primary);
    font-weight: 500;
}

/* 手机端分类筛选滚动 */
@media (max-width: 640px) {
    .search-category-filter {
        flex-wrap: nowrap;
        padding: 10px 12px;
        gap: 6px;
    }

    .search-category-filter .filter-item {
        padding: 5px 12px;
        font-size: 13px;
    }
}

/* ============ 章节排序按钮 ============ */
.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 13px;
    color: var(--text-muted);
    background-color: var(--bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.sort-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.sort-btn.active {
    color: var(--primary);
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.sort-btn svg {
    transition: transform 0.3s ease;
}

.sort-btn.active svg {
    transform: rotate(180deg);
}

/* ============ 彩色标签样式 ============ */
.color-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 12px;
    margin-right: 6px;
    margin-bottom: 6px;
    transition: var(--transition);
    font-weight: 500;
}

.color-tag-0 {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #fff;
}

.color-tag-1 {
    background: linear-gradient(135deg, #4ecdc4 0%, #44b3ab 100%);
    color: #fff;
}

.color-tag-2 {
    background: linear-gradient(135deg, #45b7d1 0%, #3ca7c0 100%);
    color: #fff;
}

.color-tag-3 {
    background: linear-gradient(135deg, #96ceb4 0%, #7fb89e 100%);
    color: #fff;
}

.color-tag-4 {
    background: linear-gradient(135deg, #dda0dd 0%, #c78ec7 100%);
    color: #fff;
}

.color-tag-5 {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #856404;
}

.color-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============ 导航分类高亮样式 ============ */
.nav-item.nav-active {
    color: var(--primary);
    font-weight: 600;
    position: relative;
}

.nav-item.nav-active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
}

/* ============ 反爬虫样式 ============ */
/* 真字容器 */
._p {
    display: inline;
    position: relative;
}

/* 假字隐藏 */
._f {
    display: inline-block;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    position: absolute;
    left: -9999px;
    font-size: 0;
    line-height: 0;
}

/* 用伪元素显示真字 */
._p::before {
    content: attr(data-r);
}

/* 防止选中假字 */
._f::selection {
    background: transparent;
}

._f::-moz-selection {
    background: transparent;
}

/* ============ 搜索历史下拉框 ============ */
.search-box-wrapper {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.dropdown-header .clear-btn {
    font-size: 12px;
    color: var(--text-light);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.dropdown-header .clear-btn:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.history-list {
    padding: 0 10px 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.history-item:hover {
    background-color: var(--bg);
}

.history-item span {
    font-size: 14px;
    color: var(--text);
}

.history-item .delete-btn {
    padding: 4px;
    color: var(--text-light);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.history-item:hover .delete-btn {
    opacity: 1;
}

.history-item .delete-btn:hover {
    color: #ff6b6b;
}

.hot-search {
    border-top: 1px solid var(--border);
}

.hot-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 15px 15px;
}

.hot-item {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text);
    background-color: var(--bg);
    border-radius: 20px;
    transition: var(--transition);
}

.hot-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* ============ 迭代8: 个性化推荐样式 ============ */
.personalized-section {
    margin-bottom: 20px;
}

.personalized-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.personalized-section .section-title {
    display: flex;
    align-items: center;
}

.personalized-section .section-title svg {
    color: #ff6b6b;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-muted);
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.refresh-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn svg {
    transition: transform 0.3s ease;
}

.refresh-btn:hover svg {
    transform: rotate(180deg);
}

/* 推荐标签样式 */
.book-cover .tag.recommend {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

/* 个性化推荐网格动画 */
#personalizedGrid {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* 空状态提示 */
.personalized-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.personalized-empty p {
    margin: 0;
}

/* 手机端适配 */
@media (max-width: 640px) {
    .refresh-btn span {
        display: none;
    }

    .refresh-btn {
        padding: 8px;
        border-radius: 50%;
    }
}

/* ============ 迭代11: 阅读进度同步提示条 ============ */
.reading-progress-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--primary-light), rgba(0, 212, 138, 0.15));
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.reading-progress-bar.show {
    opacity: 1;
    transform: translateY(0);
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

.progress-info svg {
    color: var(--primary);
    flex-shrink: 0;
}

.progress-info strong {
    color: var(--primary);
}

.continue-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background-color: var(--primary);
    border-radius: 20px;
    white-space: nowrap;
    transition: var(--transition);
}

.continue-btn:hover {
    background-color: var(--primary-dark);
    color: #fff;
}

.close-progress-bar {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.close-progress-bar:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

/* 夜间模式适配 */
[data-theme="dark"] .reading-progress-bar {
    background: linear-gradient(135deg, rgba(0, 212, 138, 0.1), rgba(0, 212, 138, 0.05));
}

[data-theme="dark"] .close-progress-bar:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 手机端适配 */
@media (max-width: 640px) {
    .reading-progress-bar {
        flex-wrap: wrap;
    }

    .progress-info {
        width: 100%;
        margin-bottom: 8px;
    }

    .continue-btn {
        flex: 1;
        text-align: center;
    }
}

/* ============ 迭代13: 评分系统样式 ============ */
.rating-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    margin-top: 12px;
    border-top: 1px solid var(--border);
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-score {
    font-size: 28px;
    font-weight: 700;
    color: #ffa502;
}

.rating-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.rating-stars .star {
    font-size: 14px;
    color: #ddd;
}

.rating-stars .star.filled {
    color: #ffa502;
}

.rating-stars .star.half {
    background: linear-gradient(90deg, #ffa502 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rating-count {
    font-size: 12px;
    color: var(--text-muted);
}

.rate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    color: #ffa502;
    background-color: rgba(255, 165, 2, 0.1);
    border: 1px solid #ffa502;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.rate-btn:hover {
    background-color: #ffa502;
    color: #fff;
}

.rate-btn.rated {
    background-color: #ffa502;
    color: #fff;
}

.rate-btn svg {
    fill: currentColor;
    stroke: none;
}

/* 评分弹窗 */
.rating-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.rating-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.rating-modal {
    width: 90%;
    max-width: 320px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.rating-modal-overlay.show .rating-modal {
    transform: scale(1);
}

.rating-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.rating-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.rating-modal-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
}

.rating-modal-close:hover {
    background-color: var(--bg);
}

.rating-modal-body {
    padding: 30px 20px;
    text-align: center;
}

.rating-modal-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.modal-star {
    font-size: 36px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-star:hover,
.modal-star.hover {
    color: #ffd700;
    transform: scale(1.1);
}

.modal-star.active {
    color: #ffa502;
}

.rating-modal-text {
    font-size: 14px;
    color: var(--text-muted);
}

.rating-modal-footer {
    padding: 15px;
    border-top: 1px solid var(--border);
}

.rating-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background-color: #ffa502;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.rating-submit-btn:hover:not(:disabled) {
    background-color: #e69500;
}

.rating-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* ============ 迭代14: 相关漫画推荐优化 ============ */

/* 相关推荐区块 */
.related-recommend .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 换一批按钮 */
.refresh-recommend-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--primary);
    background: rgba(0, 212, 138, 0.08);
    border: 1px solid rgba(0, 212, 138, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.refresh-recommend-btn:hover {
    background: rgba(0, 212, 138, 0.15);
}

.refresh-recommend-btn.rotating svg {
    animation: rotate360 0.5s ease;
}

@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 相关推荐网格过渡 */
.related-grid {
    transition: opacity 0.3s ease;
}

/* 推荐理由标签 */
.recommend-reason {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.recommend-reason:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

/* 不同推荐理由的颜色 */
.recommend-reason[data-reason="同作者"] {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.recommend-reason[data-reason="同类型"] {
    background: linear-gradient(135deg, #00d48a, #00b894);
}

.recommend-reason[data-reason="看过"] {
    background: linear-gradient(135deg, #ffa502, #ff7f50);
}

.recommend-reason[data-reason="热门"] {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

/* 看过的人也在看区块 */
.also-like-section {
    margin-top: 20px;
}

.also-like-section .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.also-like-section .section-title svg {
    color: var(--primary);
}

.also-like-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.also-like-list::-webkit-scrollbar {
    display: none;
}

.also-like-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    padding: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
}

.also-like-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.also-like-item img {
    width: 50px;
    height: 66px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.also-like-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.also-like-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.also-like-chapter {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .refresh-recommend-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .refresh-recommend-btn span {
        display: none;
    }

    .also-like-item {
        min-width: 180px;
        padding: 8px;
    }

    .also-like-item img {
        width: 45px;
        height: 60px;
    }

    .also-like-title {
        font-size: 13px;
    }
}

/* ============ 迭代15: 高级筛选 ============ */

/* 高级筛选容器 */
.advanced-filter {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

/* 筛选头部 */
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 212, 138, 0.03);
    border-bottom: 1px solid var(--border);
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
}

.filter-title svg {
    color: var(--primary);
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.filter-reset-btn,
.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.filter-reset-btn:hover,
.filter-toggle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.filter-toggle-btn svg {
    transition: transform 0.3s ease;
}

/* 筛选主体 */
.filter-body {
    padding: 16px;
    max-height: 500px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-body.collapsed {
    max-height: 0;
    padding: 0 16px;
}

/* 筛选组 */
.advanced-filter .filter-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}

.advanced-filter .filter-group:last-child {
    border-bottom: none;
}

.advanced-filter .filter-label {
    min-width: 60px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding-top: 6px;
}

.filter-hint {
    font-size: 11px;
    font-weight: normal;
    color: var(--primary);
    margin-left: 4px;
}

.advanced-filter .filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.advanced-filter .filter-option {
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.advanced-filter .filter-option:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.advanced-filter .filter-option.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

/* 标签多选样式 */
.tag-filter-options .tag-option.active:not([data-tag=""]) {
    background: linear-gradient(135deg, #00d48a, #00b894);
}

/* 已选筛选条件 */
.selected-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(0, 212, 138, 0.05);
    border-top: 1px solid var(--border);
}

.selected-label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--primary);
    background: rgba(0, 212, 138, 0.1);
    border: 1px solid rgba(0, 212, 138, 0.3);
    border-radius: 12px;
}

.selected-tag button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 14px;
    color: var(--primary);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.selected-tag button:hover {
    background: rgba(0, 212, 138, 0.2);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .filter-header {
        padding: 10px 12px;
    }

    .filter-title {
        font-size: 14px;
    }

    .filter-reset-btn span,
    .filter-toggle-btn span {
        display: none;
    }

    .filter-reset-btn,
    .filter-toggle-btn {
        padding: 6px 8px;
    }

    .filter-body {
        padding: 12px;
    }

    .advanced-filter .filter-group {
        flex-direction: column;
        gap: 8px;
    }

    .advanced-filter .filter-label {
        min-width: auto;
        padding-top: 0;
    }

    .advanced-filter .filter-option {
        padding: 5px 12px;
        font-size: 12px;
    }

    .selected-filters {
        flex-wrap: wrap;
        padding: 10px 12px;
    }
}

/* ============ 迭代16: 搜索增强 ============ */

/* 增强搜索框 */
.search-box-enhanced {
    position: relative;
    margin-bottom: 24px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(248,250,252,0.95));
    border: 1px solid rgba(0, 212, 138, 0.2);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary, #00d48a);
    box-shadow: 0 4px 24px rgba(0, 212, 138, 0.15), 0 0 0 3px rgba(0, 212, 138, 0.08);
    transform: translateY(-1px);
}

.search-icon {
    color: var(--primary, #00d48a);
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.search-input-wrapper:focus-within .search-icon {
    opacity: 1;
}

.search-input-enhanced {
    flex: 1;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--text, #333);
    background: transparent;
    border: none;
    outline: none;
}

.search-input-enhanced::placeholder {
    color: #aaa;
}

.search-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.search-clear-btn:hover {
    color: var(--text);
    background: var(--bg);
}

.search-submit-btn {
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary, #00d48a), #00b876);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 212, 138, 0.3);
}

.search-submit-btn:hover {
    background: linear-gradient(135deg, #00e896, #00c882);
    box-shadow: 0 6px 16px rgba(0, 212, 138, 0.4);
    transform: translateY(-1px);
}

.search-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 212, 138, 0.3);
}

/* 搜索建议下拉 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    overflow: hidden;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-item:hover {
    background: rgba(0, 212, 138, 0.05);
}

.suggestion-item svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.suggestion-item.from-history svg {
    color: var(--primary);
}

.suggestion-item mark {
    color: var(--primary);
    background: transparent;
    font-weight: 500;
}

/* 搜索首页区块 */
.search-home {
    margin-bottom: 30px;
}

.section-header-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.section-label svg {
    color: var(--primary);
}

.clear-history-btn,
.refresh-guess-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.clear-history-btn:hover,
.refresh-guess-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* 搜索历史区块 */
.search-history-section,
.hot-search-section,
.guess-search-section {
    margin-bottom: 24px;
}

.history-tags,
.hot-tags,
.guess-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    transition: var(--transition);
}

.history-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.history-tag button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 14px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.history-tag button:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* 热门搜索标签 */
.hot-tag {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    transition: var(--transition);
}

.hot-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.hot-tag.rank-1 {
    color: #fff;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border-color: transparent;
}

.hot-tag.rank-2 {
    color: #fff;
    background: linear-gradient(135deg, #ffa502, #ff7f50);
    border-color: transparent;
}

.hot-tag.rank-3 {
    color: #fff;
    background: linear-gradient(135deg, #00d48a, #00b894);
    border-color: transparent;
}

/* 猜你想搜标签 */
.guess-tag {
    display: inline-block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--primary);
    background: rgba(0, 212, 138, 0.08);
    border: 1px solid rgba(0, 212, 138, 0.2);
    border-radius: 16px;
    text-decoration: none;
    transition: var(--transition);
}

.guess-tag:hover {
    background: rgba(0, 212, 138, 0.15);
    border-color: var(--primary);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .search-input-wrapper {
        padding: 2px 2px 2px 12px;
    }

    .search-input-enhanced {
        padding: 8px 10px;
        font-size: 14px;
    }

    .search-submit-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .suggestion-item {
        padding: 10px 14px;
    }

    .history-tag,
    .hot-tag,
    .guess-tag {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ============ 迭代17: 快捷键帮助 ============ */

/* 快捷键帮助弹窗 */
.keyboard-help-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.keyboard-help-modal.show {
    opacity: 1;
    visibility: visible;
}

.keyboard-help-content {
    width: 90%;
    max-width: 420px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.keyboard-help-modal.show .keyboard-help-content {
    transform: scale(1) translateY(0);
}

.keyboard-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.keyboard-help-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.keyboard-help-header h3 svg {
    color: var(--primary);
}

.keyboard-help-close {
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.keyboard-help-close:hover {
    color: var(--text);
    background: var(--bg);
}

.keyboard-help-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.shortcut-group {
    margin-bottom: 20px;
}

.shortcut-group:last-child {
    margin-bottom: 0;
}

.shortcut-group h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.shortcut-item kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 2px 0 var(--border);
}

.shortcut-item span {
    font-size: 13px;
    color: var(--text-muted);
}

.keyboard-help-footer {
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
    background: rgba(0, 212, 138, 0.03);
}

.keyboard-help-footer span {
    font-size: 12px;
    color: var(--text-muted);
}

.keyboard-help-footer kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin: 0 4px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(0, 212, 138, 0.1);
    border: 1px solid rgba(0, 212, 138, 0.3);
    border-radius: 4px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .keyboard-help-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }

    .keyboard-help-body {
        padding: 16px;
    }

    .shortcut-item {
        padding: 6px 10px;
    }

    .shortcut-item kbd {
        min-width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .shortcut-item span {
        font-size: 12px;
    }
}

/* ============ 迭代18: 阅读统计 ============ */

/* 阅读统计面板 */
.reading-stats-panel {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transition: bottom 0.3s ease;
    max-height: 70vh;
    overflow-y: auto;
}

.reading-stats-panel.show {
    bottom: 0;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.stats-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.stats-header h3 svg {
    color: var(--primary);
}

.stats-close {
    width: 32px;
    height: 32px;
    font-size: 24px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.stats-close:hover {
    color: var(--text);
    background: var(--bg);
}

.stats-body {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
}

.stats-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(0, 212, 138, 0.1);
    border-radius: 12px;
    color: var(--primary);
}

.stats-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stats-label {
    font-size: 12px;
    color: var(--text-muted);
}

.stats-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.stats-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* 周统计图表 */
.stats-chart {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
}

.chart-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.chart-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100px;
    gap: 8px;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.chart-bar {
    width: 100%;
    max-width: 30px;
    background: linear-gradient(180deg, rgba(0, 212, 138, 0.3), rgba(0, 212, 138, 0.1));
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: height 0.3s ease;
    min-height: 5px;
}

.chart-bar.today {
    background: linear-gradient(180deg, var(--primary), rgba(0, 212, 138, 0.5));
}

.bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

.bar-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* 移动端适配 */
@media (max-width: 480px) {
    .stats-body {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 12px;
    }

    .stats-item {
        padding: 12px;
    }

    .stats-icon {
        width: 40px;
        height: 40px;
    }

    .stats-value {
        font-size: 16px;
    }

    .chart-bars {
        height: 80px;
    }
}

/* ============ 迭代19: 无障碍优化 ============ */

/* 跳过链接 - 供屏幕阅读器和键盘用户使用 */
.skip-links {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    width: auto;
    height: auto;
    pointer-events: none;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 0;
    padding: 12px 20px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0 0 var(--radius) 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: top 0.2s ease;
    z-index: 10001;
    pointer-events: auto;
}

.skip-link:focus {
    top: 0;
    outline: none;
}

/* 增强焦点样式 - 更明显的焦点指示器 */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* 按钮和链接焦点样式 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* 卡片焦点样式 */
.book-card a:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 4px;
    border-radius: var(--radius);
}

/* 章节链接焦点样式 */
.chapter-item:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    background-color: var(--primary-light);
}

/* 筛选选项焦点样式 */
.filter-option:focus-visible,
.tag-option:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* 导航链接焦点样式 */
.nav-item:focus-visible,
.nav-icon:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* 屏幕阅读器专用文本 - 视觉隐藏但可被读取 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 仅在焦点时显示 */
.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary: #008855;
        --text: #000;
        --text-muted: #333;
        --border: #666;
    }

    .book-card {
        border: 2px solid var(--border);
    }

    .tag {
        border: 1px solid currentColor;
    }

    .chapter-item {
        border: 1px solid var(--border);
    }

    a:focus-visible,
    button:focus-visible {
        outline-width: 4px;
    }
}

/* 减少动画 - 尊重用户偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .book-card:hover {
        transform: none;
    }

    .back-to-top-right,
    .back-to-top-center {
        transition: none;
    }

    .keyboard-help-modal,
    .reading-stats-panel,
    .search-dropdown {
        transition: none;
    }
}

/* 无障碍设置面板 */
.a11y-settings {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 999;
}

.a11y-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.a11y-toggle-btn:hover,
.a11y-toggle-btn:focus-visible {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 212, 138, 0.2);
}

.a11y-panel {
    position: absolute;
    bottom: 54px;
    right: 0;
    width: 280px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.a11y-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.a11y-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.a11y-panel-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.a11y-panel-header h4 svg {
    color: var(--primary);
}

.a11y-panel-body {
    padding: 12px 16px;
}

.a11y-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}

.a11y-option:last-child {
    border-bottom: none;
}

.a11y-option-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.a11y-option-label span {
    font-size: 13px;
    color: var(--text);
}

.a11y-option-label small {
    font-size: 11px;
    color: var(--text-muted);
}

/* 开关按钮样式 */
.a11y-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.a11y-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.a11y-switch.active {
    background: var(--primary);
}

.a11y-switch.active::after {
    left: 22px;
}

/* 字体大小调节 */
.a11y-font-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y-font-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    transition: var(--transition);
}

.a11y-font-btn:hover,
.a11y-font-btn:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
}

.a11y-font-value {
    min-width: 40px;
    text-align: center;
    font-size: 13px;
    color: var(--text);
}

/* 大字体模式 - 增大 20% */
body.large-font {
    font-size: 1.2em !important;
}

body.large-font .book-title {
    font-size: 1.2em !important;
}

body.large-font .book-meta {
    font-size: 1.1em !important;
}

body.large-font .chapter-item {
    font-size: 1.1em !important;
    padding: 14px 16px;
}

body.large-font .comic-title {
    font-size: 1.2em !important;
}

body.large-font .comic-desc {
    font-size: 1.1em !important;
}

body.large-font .section-title {
    font-size: 1.15em !important;
}

body.large-font .nav-item {
    font-size: 1.1em !important;
}

body.large-font .search-input {
    font-size: 1.1em !important;
}

/* 高对比度模式（手动开启） */
body.high-contrast {
    --primary: #008855;
    --text: #000;
    --text-muted: #333;
    --text-light: #555;
    --bg: #fff;
    --bg-card: #fff;
    --border: #000;
}

body.high-contrast .book-card {
    border: 2px solid #000;
}

body.high-contrast .tag {
    border: 1px solid currentColor;
}

body.high-contrast a {
    text-decoration: underline;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .a11y-settings {
        bottom: 70px;
        right: 15px;
    }

    .a11y-toggle-btn {
        width: 40px;
        height: 40px;
    }

    .a11y-panel {
        width: 260px;
        right: -10px;
    }
}

/* ============ 迭代20: PWA支持 ============ */

/* PWA 安装提示 */
.pwa-install-prompt {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 400px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    transition: bottom 0.3s ease;
}

.pwa-install-prompt.show {
    bottom: 20px;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    position: relative;
}

.pwa-install-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), #00b894);
    border-radius: 12px;
    color: #fff;
    flex-shrink: 0;
}

.pwa-install-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.pwa-install-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.pwa-install-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.pwa-install-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #00b894);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 212, 138, 0.3);
}

.pwa-install-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    font-size: 18px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.pwa-install-close:hover {
    color: var(--text);
    background: var(--bg);
}

/* PWA 更新通知 */
.pwa-update-notification {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: top 0.3s ease;
}

.pwa-update-notification.show {
    top: 20px;
}

.pwa-update-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}

.pwa-update-content svg {
    color: var(--primary);
    flex-shrink: 0;
}

.pwa-update-content span {
    font-size: 14px;
    color: var(--text);
}

.pwa-update-content button {
    padding: 6px 14px;
    font-size: 13px;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.pwa-update-content button:hover {
    background: var(--primary-dark);
}

.pwa-update-content button.close {
    padding: 4px 8px;
    color: var(--text-muted);
    background: transparent;
}

.pwa-update-content button.close:hover {
    color: var(--text);
    background: var(--bg);
}

/* PWA 独立模式样式调整 */
body.pwa-standalone {
    /* 独立模式下隐藏某些元素 */
}

body.pwa-standalone .header {
    padding-top: env(safe-area-inset-top);
}

body.pwa-standalone .footer {
    padding-bottom: env(safe-area-inset-bottom);
}

/* iOS 安全区域适配 */
@supports (padding: env(safe-area-inset-top)) {
    body.pwa-standalone .header {
        padding-top: calc(env(safe-area-inset-top) + 8px);
    }

    body.pwa-standalone .pwa-install-prompt {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }

    body.pwa-standalone .back-to-top-right {
        bottom: calc(30px + env(safe-area-inset-bottom));
    }

    body.pwa-standalone .a11y-settings {
        bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .pwa-install-prompt {
        width: calc(100% - 30px);
        max-width: none;
    }

    .pwa-install-content {
        padding: 14px;
        gap: 10px;
    }

    .pwa-install-icon {
        width: 42px;
        height: 42px;
    }

    .pwa-install-icon svg {
        width: 20px;
        height: 20px;
    }

    .pwa-install-title {
        font-size: 14px;
    }

    .pwa-install-desc {
        font-size: 11px;
    }

    .pwa-install-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .pwa-update-notification {
        width: calc(100% - 30px);
        max-width: 360px;
    }

    .pwa-update-content {
        padding: 10px 14px;
        gap: 8px;
    }

    .pwa-update-content span {
        font-size: 13px;
    }

    .pwa-update-content button {
        padding: 5px 12px;
        font-size: 12px;
    }

    /* 手机端筛选页紧凑化 */
    .advanced-filter {
        margin-bottom: 8px;
    }

    .filter-header {
        padding: 6px 10px;
    }

    .filter-title {
        font-size: 12px;
        gap: 3px;
    }

    .filter-title svg {
        width: 12px;
        height: 12px;
    }

    .filter-body {
        padding: 6px 10px;
    }

    .advanced-filter .filter-group {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 3px 0;
        margin-bottom: 0;
        border-bottom: none;
        gap: 4px;
    }

    .advanced-filter .filter-label {
        display: none;
    }

    .advanced-filter .filter-options {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 4px;
        flex: 1;
    }

    .advanced-filter .filter-option {
        display: inline-block;
        vertical-align: middle;
    }

    .filter-hint {
        display: none;
    }

    .filter-option {
        padding: 3px 8px;
        font-size: 11px;
        border-radius: 12px;
    }

    .filter-reset-btn,
    .filter-toggle-btn {
        padding: 3px 6px;
        font-size: 11px;
    }

    .filter-reset-btn svg,
    .filter-toggle-btn svg {
        width: 10px;
        height: 10px;
    }

    .selected-filters {
        padding: 4px 10px;
    }

    .selected-label {
        font-size: 11px;
    }

    .selected-tag {
        padding: 2px 6px;
        font-size: 10px;
    }

    /* 筛选页漫画列表紧凑化 */
    .category-page .section {
        margin-bottom: 10px;
    }

    .category-page .section-header {
        padding: 8px 0;
    }

    .category-page .book-grid {
        gap: 6px;
    }

    .category-page .book-info {
        padding: 6px;
    }

    .category-page .book-title {
        font-size: 13px;
    }

    .category-page .book-meta {
        font-size: 11px;
        margin-top: 2px;
    }

    /* 手机端首页封面优化 - 3列布局让封面更大 */
    body:not(.category-page) .section .book-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    body:not(.category-page) .section .book-card {
        border-radius: 8px;
    }

    body:not(.category-page) .section .book-cover {
        border-radius: 8px 8px 0 0;
    }

    body:not(.category-page) .section .book-info {
        padding: 6px;
    }

    body:not(.category-page) .section .book-title {
        font-size: 13px;
        line-height: 1.3;
        -webkit-line-clamp: 1;
    }

    body:not(.category-page) .section .book-meta {
        font-size: 11px;
        margin-top: 2px;
    }

    body:not(.category-page) .section .book-cover .tag {
        padding: 2px 6px;
        font-size: 10px;
        top: 4px;
        left: 4px;
    }
}


/* ============ 书架卡片操作按钮 ============ */

/* 卡片操作区域 */
.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

/* 移动分组按钮 */
.move-group-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.move-group-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.move-group-btn svg {
    flex-shrink: 0;
}

.move-group-btn .group-label {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 移除按钮 */
.card-actions .remove-btn {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.card-actions .remove-btn:hover {
    color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

/* 移动分组弹窗样式 */
.move-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.move-group-item:last-child {
    border-bottom: none;
}

.move-group-item:hover {
    background: var(--primary-light);
}

.move-group-item.current {
    background: var(--primary-light);
    color: var(--primary);
}

.move-group-item .current-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
}

.move-group-item.add-new {
    color: var(--primary);
    gap: 8px;
    justify-content: flex-start;
}

.move-group-item.add-new:hover {
    background: var(--primary-light);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .card-actions {
        padding: 5px 6px;
    }

    .move-group-btn {
        padding: 3px 6px;
        font-size: 10px;
        gap: 3px;
    }

    .move-group-btn svg {
        width: 12px;
        height: 12px;
    }

    .move-group-btn .group-label {
        max-width: 50px;
    }

    .card-actions .remove-btn {
        width: 24px;
        height: 24px;
    }

    .card-actions .remove-btn svg {
        width: 12px;
        height: 12px;
    }
}

/* ============ 离线下载功能样式 ============ */

/* 下载进度面板 */
.offline-download-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    transform: translateY(120%);
    transition: transform 0.3s ease;
}

.offline-download-panel.show {
    transform: translateY(0);
}

.offline-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

.offline-panel-title {
    font-weight: 600;
    font-size: 14px;
}

.offline-panel-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
}

.offline-panel-close:hover {
    background: var(--bg);
}

.offline-panel-body {
    padding: 15px;
}

.offline-status {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offline-progress-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.offline-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 3px;
    width: 0;
    transition: width 0.3s ease;
}

.offline-progress-text {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.offline-overall {
    font-size: 12px;
    color: var(--primary);
    text-align: center;
    margin-top: 8px;
}

.offline-panel-footer {
    padding: 10px 15px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 新增：进度容器 */
.offline-progress-container {
    margin-bottom: 8px;
}

/* 新增：进度信息行 */
.offline-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.offline-progress-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* 新增：下载速度 */
.offline-speed {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
}

/* 新增：预计剩余时间 */
.offline-eta {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    margin-top: 4px;
}

/* 新增：通用按钮样式 */
.offline-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
}

/* 新增：暂停按钮 */
.offline-pause-btn {
    color: var(--primary);
    background: var(--primary-light);
}

.offline-pause-btn:hover {
    background: rgba(0, 212, 138, 0.2);
}

/* 取消按钮 */
.offline-cancel-btn {
    padding: 8px 16px;
    font-size: 13px;
    color: #ff6b6b;
    background: rgba(255,107,107,0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.offline-cancel-btn:hover {
    background: rgba(255,107,107,0.2);
}

/* 新增：最小化按钮 */
.offline-panel-minimize {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    background: none;
}

.offline-panel-minimize:hover {
    background: var(--bg);
}

/* 新增：最小化状态 */
.offline-download-panel.minimized .offline-panel-body,
.offline-download-panel.minimized .offline-panel-footer {
    display: none;
}

.offline-download-panel.minimized {
    width: auto;
    min-width: 150px;
}

.offline-download-panel.minimized .offline-panel-header {
    border-bottom: none;
}

/* 离线管理弹窗 */
.offline-manager-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.offline-manager-modal.show {
    display: block;
}

.offline-manager-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.offline-manager-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.offline-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.offline-manager-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.offline-manager-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
}

.offline-manager-close:hover {
    background: var(--bg);
}

.offline-manager-body {
    padding: 15px;
    max-height: 60vh;
    overflow-y: auto;
}

.offline-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
}

.offline-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.offline-empty-hint {
    font-size: 12px;
    margin-top: 10px;
    opacity: 0.7;
}

.offline-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.offline-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.offline-item-cover {
    width: 50px;
    height: 67px;
    object-fit: cover;
    border-radius: 4px;
}

.offline-item-info {
    flex: 1;
    min-width: 0;
}

.offline-item-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offline-item-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.offline-item-status.completed {
    color: var(--primary);
}

.offline-item-status.downloading {
    color: #ffa502;
}

.offline-item-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.offline-item-delete:hover {
    background: #ff6b6b;
    color: #fff;
}

/* 导航栏离线按钮 */
.nav-offline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg);
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
}

.nav-offline-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-offline-btn svg {
    width: 18px;
    height: 18px;
}

/* 离线下载按钮样式 */
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: auto;
    flex: 0 0 auto;
    padding: 12px 16px;
}

.btn-download svg {
    flex-shrink: 0;
}

.btn-download.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

@media (max-width: 640px) {
    .btn-download {
        padding: 10px 12px;
    }

    .btn-download svg {
        width: 14px;
        height: 14px;
    }
}

/* ============ 收藏分组功能 ============ */

/* 分组选择弹窗 */
.group-selector-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.group-selector-modal.show {
    display: block;
}

.group-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.group-selector-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.group-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.group-selector-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.group-selector-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.group-selector-close:hover {
    background: var(--border);
    color: var(--text);
}

.group-selector-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

/* 分组列表 */
.group-list {
    padding: 0 16px;
}

.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.group-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.group-item.current {
    background: var(--primary-light);
    border-color: var(--primary);
}

.group-name {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.group-current-badge {
    font-size: 12px;
    color: var(--primary);
    background: rgba(0, 212, 138, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
}

/* 新建分组 */
.group-add-new {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.group-add-new input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.group-add-new input:focus {
    border-color: var(--primary);
}

.group-add-new input::placeholder {
    color: var(--text-muted);
}

.group-add-new button {
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.group-add-new button:hover {
    background: var(--primary-dark);
}

/* 收藏按钮分组指示器 */
.btn-group-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 6px;
}

.btn-group-indicator svg {
    width: 12px;
    height: 12px;
}

/* 长按提示 */
.bookmark-hint {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* 桌面端样式调整 */
@media (min-width: 769px) {
    .group-selector-content {
        position: absolute;
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 400px;
        max-width: 90vw;
        border-radius: var(--radius-lg);
        animation: zoomIn 0.2s ease;
    }

    @keyframes zoomIn {
        from {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.9);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }

    .group-item {
        padding: 12px 14px;
    }
}

/* ============ 存储管理面板样式 ============ */
.storage-manager-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
}

.storage-manager-modal.show {
    display: block;
}

.storage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.storage-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.storage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

.storage-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.storage-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

.storage-body {
    padding: 16px;
}

.storage-info {
    margin-bottom: 20px;
}

.storage-usage {
    margin-bottom: 12px;
}

.usage-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.usage-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-text {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.storage-detail {
    display: flex;
    gap: 16px;
}

.detail-item {
    flex: 1;
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 13px;
}

.storage-section {
    margin-bottom: 20px;
}

.storage-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.storage-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-size: 14px;
}

.offline-comic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.offline-comic-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg);
    border-radius: 8px;
}

.offline-comic-item img {
    width: 45px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.offline-comic-item .comic-info {
    flex: 1;
    min-width: 0;
}

.offline-comic-item .comic-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offline-comic-item .comic-chapters {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.offline-comic-item .delete-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.offline-comic-item .delete-btn:hover {
    background: rgba(255, 77, 79, 0.1);
    color: #ff4d4f;
}

.clear-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.clear-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.clear-btn svg {
    flex-shrink: 0;
}

/* ============ 分享面板样式 ============ */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
}

.share-modal.show {
    display: block;
}

.share-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.share-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    animation: slideUp 0.3s ease;
}

.share-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.share-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.share-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

.share-body {
    padding: 20px;
    text-align: center;
}

.share-qrcode {
    display: inline-block;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
}

.share-qrcode canvas,
.share-qrcode img {
    display: block;
}

.share-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.share-url {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.share-url input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
}

.share-text {
    display: flex;
    gap: 8px;
}

.share-text textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    resize: none;
    height: 60px;
}

.copy-btn {
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.copy-btn:hover {
    opacity: 0.9;
}

/* ============ 举报面板样式 ============ */
.report-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
}

.report-modal.show {
    display: block;
}

.report-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.report-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    animation: slideUp 0.3s ease;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.report-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.report-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

.report-body {
    padding: 20px;
}

.report-comic-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text);
}

.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.report-reason {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.report-reason:hover {
    background: var(--primary-light);
}

.report-reason input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.report-reason span {
    font-size: 14px;
}

.report-detail textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    resize: none;
    height: 80px;
    margin-bottom: 16px;
}

.report-detail textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.report-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.report-submit-btn:hover {
    opacity: 0.9;
}

/* 桌面端弹窗居中 */
@media (min-width: 769px) {
    .storage-content,
    .share-content,
    .report-content {
        position: absolute;
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 450px;
        max-width: 90vw;
        border-radius: 12px;
        animation: zoomIn 0.2s ease;
    }
}

/* ============ 漫画详情页额外操作按钮 ============ */
.comic-extra-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.extra-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
}

.extra-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.extra-btn svg {
    opacity: 0.7;
}

.extra-btn:hover svg {
    opacity: 1;
}

/* ============ 用户反馈面板样式 ============ */
.feedback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
}

.feedback-modal.show {
    display: block;
}

.feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.feedback-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    animation: slideUp 0.3s ease;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.feedback-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.feedback-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

.feedback-body {
    padding: 20px;
}

.feedback-type {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.feedback-type-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-type-item:hover {
    background: var(--primary-light);
}

.feedback-type-item input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.feedback-type-item span {
    font-size: 13px;
}

.feedback-input {
    position: relative;
    margin-bottom: 12px;
}

.feedback-input textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    resize: none;
    height: 120px;
    box-sizing: border-box;
}

.feedback-input textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.feedback-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.feedback-contact {
    margin-bottom: 16px;
}

.feedback-contact input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
}

.feedback-contact input:focus {
    outline: none;
    border-color: var(--primary);
}

.feedback-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.feedback-submit-btn:hover {
    opacity: 0.9;
}

.feedback-tip {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
    margin-bottom: 0;
}

/* 桌面端反馈弹窗居中 */
@media (min-width: 769px) {
    .feedback-content {
        position: absolute;
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 450px;
        max-width: 90vw;
        border-radius: 12px;
        animation: zoomIn 0.2s ease;
    }
}

/* ============ 迭代3: 主题切换按钮样式 ============ */
.theme-toggle-btn {
    position: fixed;
    left: 15px;
    bottom: 100px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 998;
    transition: all 0.2s;
    color: var(--text-muted);
}

.theme-toggle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

/* 护眼模式（sepia）主题变量 */
[data-theme="sepia"] {
    --bg: #f4ecd8;
    --bg-card: #faf6eb;
    --text: #5b4636;
    --text-muted: #8b7355;
    --text-light: #a08060;
    --border: #e0d5c0;
    --primary: #8b6914;
    --primary-light: rgba(139, 105, 20, 0.1);
    --primary-dark: #6b5010;
}

[data-theme="sepia"] body {
    background-color: var(--bg);
}

[data-theme="sepia"] .header {
    background-color: var(--bg-card);
}

[data-theme="sepia"] .book-card {
    background-color: var(--bg-card);
}

[data-theme="sepia"] img {
    filter: sepia(20%) brightness(0.95);
}

/* 夜间模式主题变量 */
[data-theme="dark"] {
    --bg: #1a1a1a;
    --bg-card: #252525;
    --text: #e0e0e0;
    --text-muted: #999;
    --text-light: #777;
    --border: #333;
    --primary: #00d48a;
    --primary-light: rgba(0, 212, 138, 0.15);
    --primary-dark: #00b876;
}

[data-theme="dark"] body {
    background-color: var(--bg);
}

[data-theme="dark"] .header {
    background-color: var(--bg-card);
}

[data-theme="dark"] .book-card {
    background-color: var(--bg-card);
}

[data-theme="dark"] img {
    filter: brightness(0.9);
}

[data-theme="dark"] .theme-toggle-btn {
    background: var(--bg-card);
    border-color: var(--border);
}

@media (max-width: 768px) {
    .theme-toggle-btn {
        left: 10px;
        bottom: 70px;
        width: 40px;
        height: 40px;
    }
}

/* ============ 迭代5: 漫画详情页优化 ============ */
/* 阅读进度统计 */
.reading-stats {
    background: linear-gradient(135deg, rgba(0, 212, 138, 0.1), rgba(0, 180, 120, 0.05));
    border: 1px solid rgba(0, 212, 138, 0.2);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 15px;
}

.stats-progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.stats-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #00e68a);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.stats-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-light);
}

.stats-text strong {
    color: var(--primary);
    font-weight: 600;
}

.stats-percent {
    font-weight: 600;
    color: var(--primary);
}

/* 封面放大提示 */
.comic-cover {
    cursor: pointer;
    position: relative;
}

.cover-zoom-hint {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 1;
    transition: background 0.2s;
}

.comic-cover:hover .cover-zoom-hint {
    background: var(--primary);
}

/* 章节跳转按钮 */
.jump-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-light);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.jump-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

/* 章节跳转弹窗 */
.chapter-jump-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.chapter-jump-overlay.show {
    opacity: 1;
    visibility: visible;
}

.chapter-jump-modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.chapter-jump-overlay.show .chapter-jump-modal {
    transform: scale(1);
}

.chapter-jump-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.chapter-jump-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chapter-jump-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
}

.chapter-jump-close:hover {
    background: var(--bg);
    color: var(--text);
}

.chapter-jump-body {
    padding: 20px;
}

.chapter-jump-input-wrap {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.chapter-jump-input-wrap input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.chapter-jump-input-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.chapter-jump-go {
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.chapter-jump-go:hover {
    background: var(--primary-dark);
}

.chapter-jump-quick {
    display: flex;
    gap: 10px;
}

.chapter-jump-quick button {
    flex: 1;
    padding: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.chapter-jump-quick button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* 封面预览弹窗 */
.cover-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    cursor: zoom-out;
}

.cover-preview-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cover-preview-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.cover-preview-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.cover-preview-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.cover-preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 夜间模式适配 */
[data-theme="dark"] .reading-stats {
    background: linear-gradient(135deg, rgba(0, 212, 138, 0.15), rgba(0, 180, 120, 0.08));
}

[data-theme="dark"] .chapter-jump-modal {
    background: var(--bg-card);
}

[data-theme="dark"] .chapter-jump-input-wrap input {
    background: var(--bg);
    color: var(--text);
}

/* ============ 迭代7: 图片加载体验优化 ============ */
/* 图片骨架屏 */
.image-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    position: relative;
    overflow: hidden;
}

.skeleton-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.skeleton-icon {
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 10px;
}

.skeleton-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
}

/* 懒加载图片 */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* 图片加载失败 */
.image-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: linear-gradient(135deg, #2a2020 0%, #1a1515 100%);
    color: rgba(255, 255, 255, 0.5);
    gap: 10px;
}

.image-error svg {
    color: #ff6b6b;
}

.image-error span {
    font-size: 14px;
}

.image-error button {
    padding: 8px 20px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.image-error button:hover {
    background: var(--primary-dark);
}

/* 加载进度指示器 */
.image-load-indicator {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    z-index: 100;
}

.image-load-indicator svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 日间模式骨架屏 */
[data-theme="light"] .image-skeleton,
:root:not([data-theme]) .image-skeleton {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

[data-theme="light"] .skeleton-shimmer,
:root:not([data-theme]) .skeleton-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
}

[data-theme="light"] .skeleton-icon,
:root:not([data-theme]) .skeleton-icon {
    color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .skeleton-text,
:root:not([data-theme]) .skeleton-text {
    color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .image-error,
:root:not([data-theme]) .image-error {
    background: linear-gradient(135deg, #fff0f0 0%, #ffe5e5 100%);
    color: rgba(0, 0, 0, 0.5);
}

/* ============ 迭代11: 搜索页增强样式 ============ */

/* 搜索结果统计 */
.search-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.search-result-count {
    font-size: 14px;
    color: #888;
}

.search-result-count strong {
    color: #ff6b6b;
    font-weight: 600;
}


/* ============ 迭代15: 全新列表视图布局 ============ */

/* 默认隐藏列表视图内容 */
.list-view-content {
    display: none;
}

/* 网格视图：显示网格内容，隐藏列表内容 */
.book-grid .grid-view-content {
    display: block;
}
.book-grid .list-view-content {
    display: none !important;
}

/* 双列视图（PC端3列，手机端2列）：显示网格内容，隐藏列表内容 */
.book-twocol-view .grid-view-content {
    display: block;
}
.book-twocol-view .list-view-content {
    display: none !important;
}
.book-twocol-view {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
}
.book-twocol-view .book-card {
    width: 100% !important;
}
.book-twocol-view .book-cover {
    aspect-ratio: 3/4;
}
.book-twocol-view .book-title {
    font-size: 14px;
    -webkit-line-clamp: 1;
}
.book-twocol-view .book-meta {
    font-size: 12px;
}
.book-twocol-view .book-tags {
    display: none;
}

/* 手机端视图列数调整 */
@media (max-width: 640px) {
    /* 手机端: grid=3列, twocol=2列, list=1列 */
    .book-twocol-view {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* 列表视图：隐藏网格内容，显示列表内容 */
.book-list .grid-view-content {
    display: none !important;
}
.book-list .list-view-content {
    display: flex !important;
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card, #fff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
    position: relative;
}

.book-list .list-view-content:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* 列表视图容器 */
.book-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.book-list .book-card {
    width: 100% !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* 列表视图封面 - PC端160px宽度，高度自适应 */
.list-cover-wrap {
    flex-shrink: 0;
}

.list-cover-link {
    width: 160px;
    border-radius: 8px;
    overflow: hidden;
    display: block;
}

/* PC端隐藏封面内按钮 */
.list-cover-btn {
    display: none;
}

.list-cover-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s;
}

.list-cover-link:hover .list-cover-img {
    transform: scale(1.05);
}

/* 列表视图信息区 */
.list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
}

/* 标题 */
.list-title-link {
    text-decoration: none;
    color: inherit;
}

.list-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text, #222);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

.list-title-link:hover .list-title {
    color: var(--primary, #00d48a);
}

/* 元信息行 */
.list-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted, #888);
    flex-wrap: wrap;
}

.list-author {
    color: var(--text-muted, #888);
}

.list-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

.list-status.ongoing {
    background: rgba(0, 212, 138, 0.12);
    color: #00b876;
}

.list-status.completed {
    background: rgba(255, 107, 107, 0.12);
    color: #e55a5a;
}

.list-chapters {
    color: var(--text-light, #aaa);
}

/* 简介 */
.list-desc {
    font-size: 13px;
    color: var(--text-light, #999);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 底部区域 */
.list-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* 标签 */
.list-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.list-tag {
    font-size: 11px;
    padding: 3px 8px;
    background: var(--bg, #f5f5f5);
    border-radius: 4px;
    color: var(--text-muted, #888);
}

/* 最新章节 */
.list-latest {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.latest-label {
    font-size: 10px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
}

.latest-link {
    font-size: 13px;
    color: #ff6b6b;
    text-decoration: none;
}

.latest-link:hover {
    color: #ff8e8e;
    text-decoration: underline;
}

/* 操作按钮区 - 横向排列 */
.list-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
    position: absolute;
    top: 16px;
    right: 16px;
}

.list-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.list-btn svg {
    flex-shrink: 0;
}

.list-btn-read {
    background: linear-gradient(135deg, var(--primary, #00d48a), var(--primary-dark, #00b876));
    color: #fff;
}

.list-btn-read:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 138, 0.4);
}

.list-btn-fav {
    background: var(--bg, #f5f5f5);
    color: var(--text-muted, #888);
    border: 1px solid var(--border, #e8e8e8);
}

.list-btn-fav:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.list-btn-fav.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

/* 夜间模式 */
[data-theme="dark"] .book-list .list-view-content {
    background: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .book-list .list-view-content:hover {
    background: #363636;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

[data-theme="dark"] .list-title {
    color: #e0e0e0;
}

[data-theme="dark"] .list-desc {
    color: #888;
}

[data-theme="dark"] .list-tag {
    background: #404040;
    color: #aaa;
}

[data-theme="dark"] .list-btn-fav {
    background: #404040;
    border-color: #555;
    color: #aaa;
}

/* 响应式 - 平板 */
@media (max-width: 768px) {
    .book-list .list-view-content {
        padding: 14px;
        gap: 14px;
    }

    .list-cover-link {
        width: 120px;
        height: 160px;
    }

    .list-title {
        font-size: 15px;
    }

    .list-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .list-actions {
        top: 14px;
        right: 14px;
    }
}

/* 响应式 - 手机端列表视图优化 */
@media (max-width: 640px) {
    .book-list .list-view-content {
        padding: 12px;
        gap: 14px;
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    /* 封面区域 - 竖图友好，固定宽度120px */
    .book-list .list-cover-link {
        flex-shrink: 0;
        width: 120px;
        height: auto;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }

    .book-list .list-cover-img {
        width: 100%;
        height: auto;
        aspect-ratio: 3/4;
        object-fit: cover;
        display: block;
    }

    /* 信息区 - 紧凑布局 */
    .book-list .list-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding-top: 2px;
    }

    .book-list .list-title {
        font-size: 15px;
        font-weight: 600;
        line-height: 1.3;
        margin: 0;
        padding-right: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .book-list .list-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px 10px;
        font-size: 12px;
        color: var(--text-secondary, #666);
    }

    .book-list .list-author {
        color: var(--text-secondary, #666);
    }

    .book-list .list-status {
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 11px;
    }

    .book-list .list-status.ongoing {
        background: rgba(0, 212, 138, 0.1);
        color: var(--primary, #00d48a);
    }

    .book-list .list-status.completed {
        background: rgba(255, 107, 107, 0.1);
        color: #ff6b6b;
    }

    .book-list .list-chapters {
        color: var(--text-muted, #999);
    }

    /* 简介 - 最多3行 */
    .book-list .list-desc {
        font-size: 12px;
        line-height: 1.5;
        color: var(--text-secondary, #888);
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin: 2px 0;
    }

    /* 底部 - 开始阅读按钮 */
    .book-list .list-bottom {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        margin-top: auto;
        padding-top: 8px;
    }

    /* 隐藏最新章节 */
    .book-list .list-latest {
        display: none;
    }

    /* 标签样式 */
    .book-list .list-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .book-list .list-tag {
        padding: 2px 6px;
        background: var(--bg-secondary, #f5f5f5);
        border-radius: 4px;
        font-size: 10px;
        color: var(--text-secondary, #666);
    }

    /* 开始阅读按钮 */
    .book-list .list-read-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 8px;
        background: linear-gradient(135deg, var(--primary, #00d48a), var(--primary-dark, #00b876));
        color: #fff;
        border: none;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 500;
        text-decoration: none;
        box-shadow: 0 2px 8px rgba(0, 212, 138, 0.3);
        transition: all 0.2s;
    }

    .book-list .list-read-btn:active {
        transform: scale(0.96);
        box-shadow: 0 1px 4px rgba(0, 212, 138, 0.2);
    }

    .book-list .list-read-btn svg {
        width: 14px;
        height: 14px;
    }

    /* 隐藏原来的按钮区和封面按钮 */
    .list-actions,
    .list-cover-btn,
    .list-cover-wrap {
        display: none;
    }
}

/* ============ 迭代16: 搜索工具栏优化 ============ */

/* 搜索工具栏容器 */
.search-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-card, #fff);
    border-radius: var(--radius, 12px);
    box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.06));
}

/* 分类筛选区 */
.search-toolbar .search-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    padding: 0;
    margin: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

/* 操作区：排序+视图切换 */
.search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* 排序下拉框 */
.search-sort {
    position: relative;
}

.search-sort select {
    appearance: none;
    -webkit-appearance: none;
    padding: 8px 32px 8px 12px;
    background: var(--bg, #f5f5f5);
    border: 1px solid var(--border, #e8e8e8);
    border-radius: 8px;
    color: var(--text, #222);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    min-width: 100px;
}

.search-sort::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted, #888);
    pointer-events: none;
}

.search-sort select:hover,
.search-sort select:focus {
    border-color: var(--primary, #00d48a);
    background: var(--bg-card, #fff);
}

/* 视图切换按钮组 */
.search-view-toggle {
    display: flex;
    gap: 2px;
    padding: 4px;
    background: var(--bg, #f5f5f5);
    border-radius: 8px;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted, #888);
    cursor: pointer;
    transition: all 0.2s;
}

.view-btn:hover {
    color: var(--text, #222);
    background: var(--bg-card, #fff);
}

.view-btn.active {
    color: #fff;
    background: var(--primary, #00d48a);
    box-shadow: 0 2px 6px rgba(0, 212, 138, 0.3);
}

.view-btn svg {
    width: 18px;
    height: 18px;
}

/* 夜间模式适配 */
[data-theme="dark"] .search-toolbar {
    background: var(--bg-card, #2d2d2d);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="dark"] .search-sort select {
    background: #404040;
    border-color: #555;
    color: #e0e0e0;
}

[data-theme="dark"] .search-sort select:hover,
[data-theme="dark"] .search-sort select:focus {
    border-color: var(--primary, #00d48a);
    background: #4a4a4a;
}

[data-theme="dark"] .search-sort::after {
    border-top-color: #aaa;
}

[data-theme="dark"] .search-view-toggle {
    background: #404040;
}

[data-theme="dark"] .view-btn {
    color: #aaa;
}

[data-theme="dark"] .view-btn:hover {
    color: #fff;
    background: #555;
}

[data-theme="dark"] .view-btn.active {
    background: var(--primary, #00d48a);
    color: #fff;
}

/* 响应式 - 手机端 */
@media (max-width: 640px) {
    .search-toolbar {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .search-toolbar .search-category-filter {
        width: 100%;
        flex: none;
        order: 2;
    }
    
    .search-actions {
        width: 100%;
        justify-content: space-between;
        order: 1;
    }
    
    .search-sort select {
        padding: 6px 28px 6px 10px;
        font-size: 12px;
        min-width: 90px;
    }
    
    .view-btn {
        width: 32px;
        height: 32px;
    }
    
    .view-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ============ 迭代16: 列表工具栏（排序+视图切换） ============ */

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    margin-bottom: 12px;
}

.list-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-info {
    font-size: 13px;
    color: var(--text-muted, #888);
}

.list-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 响应式 */
@media (max-width: 640px) {
    .list-toolbar {
        padding: 8px 0;
    }

    .result-info {
        font-size: 12px;
    }
}

/* ============ 网络状态栏样式 ============ */
.network-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.network-status-bar.show {
    transform: translateY(0);
}

.network-status-bar.online {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.network-status-bar.offline {
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
    color: #fff;
}

.network-status-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.network-icon {
    display: none;
}

.network-status-bar.online .online-icon {
    display: block;
}

.network-status-bar.offline .offline-icon {
    display: block;
}

/* ============ 迭代3: 浮动网络状态图标 ============ */
.network-floating-icon {
    position: fixed;
    top: 30%;
    right: 0;
    width: 44px;
    height: 44px;
    border-radius: 22px 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    touch-action: none;
    user-select: none;
}

.network-floating-icon.online {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.network-floating-icon.offline {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
    animation: pulse-offline 2s infinite;
}

@keyframes pulse-offline {
    0%, 100% { box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3); }
    50% { box-shadow: 0 2px 20px rgba(255, 107, 107, 0.6); }
}

.network-floating-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.network-floating-icon:active {
    transform: scale(0.95);
}

.network-floating-icon.dragging {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: none;
}

/* 浮动图标内的SVG */
.network-floating-icon svg {
    display: none;
}

.network-floating-icon.online .floating-online-icon {
    display: block;
}

.network-floating-icon.offline .floating-offline-icon {
    display: block;
}

/* 吸附到边缘时的半隐藏效果 */
.network-floating-icon.snapped-left {
    border-radius: 0 22px 22px 0;
    left: 0 !important;
    right: auto !important;
}

.network-floating-icon.snapped-right {
    border-radius: 22px 0 0 22px;
    right: 0 !important;
    left: auto !important;
}

/* ============ 迭代5: 网络状态弹窗 ============ */
.network-status-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.network-status-popup.show {
    opacity: 1;
    visibility: visible;
}

.network-status-popup .popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.network-status-popup .popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 280px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.network-status-popup.show .popup-content {
    transform: translate(-50%, -50%) scale(1);
}

.network-status-popup .popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.network-status-popup .popup-content.online .popup-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-bottom: none;
}

.network-status-popup .popup-content.offline .popup-header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
    border-bottom: none;
}

.network-status-popup .popup-title {
    font-size: 16px;
    font-weight: 600;
}

.network-status-popup .popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: inherit;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
    padding: 0;
}

.network-status-popup .popup-close:hover {
    opacity: 1;
}

.network-status-popup .popup-body {
    padding: 15px;
}

.network-status-popup .status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.network-status-popup .status-item:last-child {
    border-bottom: none;
}

.network-status-popup .status-label {
    color: var(--text-muted);
    font-size: 14px;
}

.network-status-popup .status-value {
    font-size: 14px;
    font-weight: 500;
}

.network-status-popup .status-value.online {
    color: var(--primary);
}

.network-status-popup .status-value.offline {
    color: #ff6b6b;
}

.network-status-popup .popup-actions {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--border);
}

.network-status-popup .popup-btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--primary);
    color: #fff;
}

.network-status-popup .popup-btn:hover {
    background: var(--primary-dark);
}

.network-status-popup .popup-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.network-status-popup .popup-btn.secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.network-status-popup .popup-btn.secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ============ SWR缓存更新提示条 ============ */
.cache-update-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #4a90d9, #357abd);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10003;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.cache-update-bar.show {
    transform: translateY(0);
}

.cache-update-bar .update-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.cache-update-bar .update-btn {
    background: #fff;
    color: #4a90d9;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cache-update-bar .update-btn:hover {
    background: #f0f0f0;
}

.cache-update-bar .update-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    padding: 0 4px;
    line-height: 1;
}

.cache-update-bar .update-close:hover {
    opacity: 1;
}

/* ============ 章节缓存标记样式 ============ */
.chapter-item.cached,
.chapter-link.cached,
[data-chapter-id].cached {
    position: relative;
}

.cache-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    color: var(--primary);
    vertical-align: middle;
}

.cache-icon svg {
    width: 14px;
    height: 14px;
}

/* 章节列表中的缓存标记 */
.chapter-grid .chapter-item.cached::after,
.chapter-list .chapter-link.cached::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

/* 离线模式下的特殊样式 */
body.offline-mode .chapter-item:not(.cached),
body.offline-mode .chapter-link:not(.cached) {
    opacity: 0.5;
    cursor: not-allowed;
}

body.offline-mode .chapter-item.cached,
body.offline-mode .chapter-link.cached {
    opacity: 1;
    cursor: pointer;
}

/* 离线模式提示 */
.offline-mode-tip {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.offline-mode-tip svg {
    flex-shrink: 0;
}

/* ============ 离线管理中心样式 ============ */
.offline-center-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
}

.offline-center-modal.show {
    display: block;
}

.offline-center-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.offline-center-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.offline-center-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.offline-center-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.offline-center-header h3 svg {
    color: var(--primary);
}

.offline-center-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.offline-center-close:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.offline-center-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 存储概览 */
.offline-overview {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 20px;
}

.overview-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.stat-item .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.storage-progress {
    margin-top: 10px;
}

.storage-progress .progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.storage-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.storage-progress .progress-fill.warning {
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
}

.storage-progress .progress-text {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* 离线漫画区块 */
.offline-comics-section {
    margin-bottom: 20px;
}

.offline-comics-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.offline-comics-section .section-header h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.batch-delete-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: none;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.batch-delete-btn:hover {
    background: #ff6b6b;
    color: #fff;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state span {
    font-size: 13px;
    opacity: 0.7;
}

/* 离线漫画网格 */
.offline-comic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.offline-comic-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.offline-comic-card:hover {
    box-shadow: var(--shadow-hover);
}

.offline-comic-card .comic-cover {
    position: relative;
    cursor: pointer;
}

.offline-comic-card .comic-cover img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.offline-comic-card .comic-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
}

.offline-comic-card .comic-progress .progress-fill {
    height: 100%;
    background: var(--primary);
}

.offline-comic-card .comic-info {
    padding: 8px;
}

.offline-comic-card .comic-title {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offline-comic-card .comic-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.offline-comic-card .comic-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border-top: 1px solid var(--border);
}

.offline-comic-card .action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.offline-comic-card .view-btn {
    background: var(--primary-light);
    color: var(--primary);
}

.offline-comic-card .view-btn:hover {
    background: var(--primary);
    color: #fff;
}

.offline-comic-card .delete-btn {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.offline-comic-card .delete-btn:hover {
    background: #ff6b6b;
    color: #fff;
}

/* 快捷操作 */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-action-btn {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.quick-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.quick-action-btn svg {
    flex-shrink: 0;
}

/* ============ 漫画详情弹窗样式 ============ */
.comic-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: none;
}

.comic-detail-modal.show {
    display: block;
}

.detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.detail-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.detail-header .back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: var(--transition);
}

.detail-header .back-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.detail-header h3 {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-header .delete-all-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6b6b;
    transition: var(--transition);
}

.detail-header .delete-all-btn:hover {
    background: #ff6b6b;
    color: #fff;
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* 漫画摘要 */
.comic-summary {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.summary-cover {
    width: 80px;
    height: 107px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.summary-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.summary-stat {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.summary-stat .stat-label {
    color: var(--text-muted);
}

.summary-stat .stat-value {
    font-weight: 500;
    color: var(--primary);
}

.goto-comic-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition);
    margin-top: 5px;
}

.goto-comic-btn:hover {
    background: var(--primary-dark);
    color: #fff;
}

/* 章节列表区块 */
.chapter-list-section .chapter-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.chapter-list-section .chapter-list-header h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.chapter-list-section .chapter-count {
    font-size: 12px;
    color: var(--text-muted);
}

.empty-chapters {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 已缓存章节列表 */
.cached-chapter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.cached-chapter-item {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cached-chapter-item .chapter-link {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.cached-chapter-item .chapter-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.cached-chapter-item .chapter-name {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cached-chapter-item .chapter-images {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 10px;
}

.delete-chapter-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.delete-chapter-btn:hover {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

/* 响应式 */
@media (max-width: 640px) {
    .offline-center-content {
        width: 95%;
        max-height: 90vh;
    }

    .offline-comic-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .overview-stats {
        gap: 10px;
    }

    .stat-item .stat-value {
        font-size: 20px;
    }

    .quick-actions {
        flex-direction: column;
    }

    .quick-action-btn {
        min-width: auto;
    }
}

/* ============ 迭代7-8: 批量下载和队列管理样式 ============ */

/* 批量选择弹窗 */
.batch-select-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.batch-select-modal.show {
    display: block;
}

.batch-select-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.batch-select-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--bg-card);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.batch-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.batch-select-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
}

.batch-select-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.batch-select-close:hover {
    background: var(--bg);
    color: var(--text);
}

.batch-select-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.batch-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.batch-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.batch-btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.batch-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.batch-btn-secondary {
    background: var(--bg);
}

.batch-selected-count {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-muted);
}

.batch-selected-count span {
    color: var(--primary);
    font-weight: 600;
}

.batch-select-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
}

.batch-chapter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.batch-chapter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.batch-chapter-item:hover {
    border-color: var(--primary-light);
    background: var(--primary-light);
}

.batch-chapter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.batch-chapter-item input[type="checkbox"]:checked + .batch-chapter-title {
    color: var(--primary);
}

.batch-chapter-title {
    flex: 1;
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-select-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border);
}

/* 队列管理弹窗 */
.queue-manager-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.queue-manager-modal.show {
    display: block;
}

.queue-manager-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.queue-manager-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    background: var(--bg-card);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.queue-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.queue-manager-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
}

.queue-manager-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.queue-manager-close:hover {
    background: var(--bg);
    color: var(--text);
}

.queue-manager-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
}

.queue-current {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
}

.queue-current-label {
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 4px;
}

.queue-current-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.queue-current-progress {
    font-size: 13px;
    color: var(--text-muted);
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.queue-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 14px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 8px;
}

.queue-item-index {
    width: 24px;
    height: 24px;
    background: var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
}

.queue-item-title {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-count {
    font-size: 12px;
    color: var(--text-muted);
}

.queue-item-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.queue-item-remove:hover {
    background: #ff6b6b20;
    color: #ff6b6b;
}

.queue-manager-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border);
}

.queue-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.queue-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.queue-btn-danger {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.queue-btn-danger:hover {
    background: #ff6b6b;
    color: #fff;
}

/* 下载面板队列信息 */
#offlineQueueInfo {
    display: none;
    font-size: 12px;
    color: var(--primary);
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--primary-light);
    border-radius: 4px;
    text-align: center;
}

/* 响应式 - 批量选择 */
@media (max-width: 640px) {
    .batch-select-content {
        width: 95%;
        max-height: 85vh;
    }

    .batch-chapter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .batch-select-toolbar {
        padding: 10px 15px;
    }

    .batch-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    .batch-selected-count {
        width: 100%;
        margin-top: 8px;
        margin-left: 0;
        text-align: right;
    }

    .queue-manager-content {
        width: 95%;
    }
}

@media (max-width: 380px) {
    .batch-chapter-grid {
        grid-template-columns: 1fr;
    }
}

/* 队列按钮样式 */
.offline-queue-btn {
    padding: 8px !important;
    min-width: auto !important;
}

.offline-queue-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ============ 迭代1: 缓存管理Tab和统计样式 ============ */

/* 离线管理Tab切换 */
.offline-manager-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 15px;
}

.offline-tab {
    flex: 1;
    padding: 10px 15px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.offline-tab:hover {
    color: var(--primary);
}

.offline-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

.offline-tab-content {
    min-height: 200px;
}

/* 缓存统计容器 */
.cache-stats-container {
    padding: 10px 0;
}

.cache-stats-loading,
.cache-stats-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.cache-stats-error {
    color: #e74c3c;
}

/* 缓存统计摘要 */
.cache-stats-summary {
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    margin-bottom: 15px;
}

.cache-stats-total {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cache-stats-label {
    color: var(--text-muted);
    font-size: 14px;
}

.cache-stats-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.cache-stats-size {
    font-size: 13px;
    color: var(--text-muted);
}

/* 缓存统计列表 */
.cache-stats-list {
    margin-bottom: 15px;
}

.cache-stats-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.cache-stats-item:last-child {
    border-bottom: none;
}

.cache-stats-name {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

.cache-stats-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-right: 15px;
}

.cache-stats-item .cache-stats-size {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 70px;
    text-align: right;
}

/* 缓存清理按钮 */
.cache-stats-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.cache-clear-btn {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cache-clear-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cache-clear-btn.cache-clear-all {
    background: #fff3f3;
    border-color: #ffcccc;
    color: #e74c3c;
}

.cache-clear-btn.cache-clear-all:hover {
    background: #ffe5e5;
    border-color: #e74c3c;
}

/* 缓存统计备注 */
.cache-stats-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-light);
    text-align: center;
}

/* 响应式 - 缓存统计 */
@media (max-width: 640px) {
    .cache-stats-actions {
        flex-direction: column;
    }

    .cache-stats-item {
        flex-wrap: wrap;
    }

    .cache-stats-name {
        width: 100%;
        margin-bottom: 4px;
    }

    .cache-stats-count {
        margin-right: auto;
    }
}

/* ============ 迭代5: SW更新横幅 ============ */
.sw-update-banner {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 10000;
    transition: bottom 0.3s ease;
    max-width: calc(100% - 32px);
    width: auto;
}

.sw-update-banner.show {
    bottom: 80px;
}

.sw-update-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.sw-update-content svg {
    flex-shrink: 0;
}

.sw-update-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.sw-update-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sw-update-later {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.sw-update-later:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sw-update-now {
    background: #fff;
    color: #667eea;
}

.sw-update-now:hover {
    background: #f0f0f0;
    transform: scale(1.02);
}

/* 响应式 - SW更新横幅 */
@media (max-width: 480px) {
    .sw-update-banner {
        flex-direction: column;
        text-align: center;
        bottom: -150px;
    }

    .sw-update-banner.show {
        bottom: 70px;
    }

    .sw-update-content {
        flex-direction: column;
    }

    .sw-update-content span {
        font-size: 13px;
    }
}

/* ============ 迭代4: 可重试错误提示样式 ============ */
.retryable-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    transition: bottom 0.3s ease;
}

.retryable-toast.show {
    bottom: 100px;
}

.retryable-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
    color: #fff;
    font-size: 14px;
}

.retryable-toast-message {
    flex: 1;
    max-width: 280px;
}

.retryable-toast-btn {
    padding: 8px 16px;
    background: #fff;
    color: #ff6b6b;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retryable-toast-btn:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.retryable-toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.retryable-toast-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 响应式 - 可重试错误提示 */
@media (max-width: 480px) {
    .retryable-toast.show {
        bottom: 80px;
    }

    .retryable-toast-content {
        flex-wrap: wrap;
        justify-content: center;
        padding: 12px 14px;
        gap: 8px;
    }

    .retryable-toast-message {
        width: 100%;
        text-align: center;
        font-size: 13px;
    }
}
