
.main-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 20px 40px;
}

/* ==================== 筛选面板 ==================== */
.filter-panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px 20px 10px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}
.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.filter-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.filter-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--purple-600), var(--red-500));
    border-radius: 2px;
    flex-shrink: 0;
}
.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}
.filter-count {
    font-size: 12.5px;
    color: var(--gray-500);
    white-space: nowrap;
}
.filter-count strong {
    color: var(--purple-600);
    font-size: 15px;
    font-weight: 700;
}
.filter-reset-btn,
.filter-toggle-btn {
    padding: 6px 15px;
    border-radius: 18px;
    border: 2px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-600);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.3px;
    user-select: none;
}
.filter-reset-btn:hover,
.filter-toggle-btn:hover {
    background: var(--purple-50);
    border-color: var(--purple-400);
    color: var(--purple-600);
}
.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 4px;
}
.filter-toggle-btn .arrow-icon {
    display: inline-block;
    transition: transform 0.4s ease;
    font-size: 10px;
}
.filter-toggle-btn.collapsed .arrow-icon {
    transform: rotate(180deg);
}

/* 筛选行容器 - 带收起动画 */
.filter-rows-wrapper {
    overflow: hidden;
    max-height: 700px;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.35s ease;
    opacity: 1;
}
.filter-rows-wrapper.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    opacity: 0;
}

/* 每行筛选 */
.filter-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--gray-200);
    flex-wrap: wrap;
}
.filter-row:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}
.filter-label {
    flex-shrink: 0;
    width: 54px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
    padding-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.2px;
}
.filter-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-cat {
    background: var(--purple-500);
}
.dot-tag {
    background: var(--red-500);
}
.dot-type {
    background: #f59e0b;
}
.dot-quality {
    background: #10b981;
}
.dot-region {
    background: #3b82f6;
}
.dot-copy {
    background: #ec4899;
}
.dot-progress {
    background: #6366f1;
}
.filter-values {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}
.filter-tag {
    padding: 5px 13px;
    border-radius: 18px;
    border: 2px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.filter-tag:hover {
    border-color: var(--purple-300);
    color: var(--purple-600);
    background: var(--purple-50);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(147, 51, 234, 0.08);
}
.filter-tag.active {
    background: var(--purple-600);
    color: #fff;
    border-color: var(--purple-600);
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(147, 51, 234, 0.28);
}
.filter-tag.active:hover {
    background: var(--purple-700);
    border-color: var(--purple-700);
    color: #fff;
    transform: translateY(-1px);
}

/* ==================== 漫画网格 6列×5行 ==================== */
.comic-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 13px;
    margin-bottom: 20px;
}
.comic-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    padding: 0;
}
.comic-card:hover {
    border-color: var(--purple-200);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
/* 封面 - 占满宽度，无内边距 */
.comic-card .cover {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--gray-100);
    position: relative;
    flex-shrink: 0;
}
.comic-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.comic-card:hover .cover img {
    transform: scale(1.06);
}
.comic-card .cover .badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--red-500);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.5px;
}
.comic-card .cover .badge.hot {
    background: #f59e0b;
    left: auto;
    right: 6px;
    top: 6px;
}
/* 信息区 - 2行描述 */
.comic-card .info {
    padding: 9px 10px 11px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.comic-card .info .title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
}
/* 描述第1行 */
.comic-card .info .desc-line1 {
    font-size: 11px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.comic-card .info .desc-line1 .author-name {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.comic-card .info .desc-line1 .type-tag {
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 9px;
    flex-shrink: 0;
    font-weight: 500;
}
/* 描述第2行 */
.comic-card .info .desc-line2 {
    font-size: 10.5px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.comic-card .info .desc-line2 .quality-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dot-hd {
    background: #10b981;
}
.dot-uhd {
    background: #3b82f6;
}
.dot-raw {
    background: #f59e0b;
}
.comic-card .info .desc-line2 .progress-chip {
    background: rgba(239, 68, 68, 0.08);
    color: var(--red-500);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}
.comic-card .info .desc-line2 .progress-chip.ongoing {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

/* ==================== 分页 ==================== */
#Pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}
#Pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

#Pagination a:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

#Pagination a.on,
#Pagination a.on:hover {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
    cursor: default;
    transform: none;
    box-shadow: none;
}

#Pagination a.prev,
#Pagination a.next,
#Pagination a.first,
#Pagination a.end {
    background-color: #f8fafc;
    font-weight: 500;
}

#Pagination a.disabled,
#Pagination a[disabled] {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}


/* 响应式：移动端调小间距和内边距 */
@media (max-width: 640px) {
    #Pagination {
        gap: 6px;
    }
    #Pagination a {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
        border-radius: 6px;
    }
}
/* ==================== 底部 ==================== */
.footer {
    background: var(--gray-800);
    color: var(--gray-300);
    padding: 28px 20px 24px;
    text-align: center;
    font-size: 13px;
    line-height: 2;
    margin-top: 20px;
}
.footer a {
    color: var(--purple-400);
    text-decoration: none;
    transition: var(--transition);
}
.footer a:hover {
    color: #fff;
    text-decoration: underline;
}
.footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.footer .footer-divider {
    color: var(--gray-600);
}
.footer .copyright {
    color: var(--gray-500);
    font-size: 11.5px;
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--purple-700);
    color: #fff;
    padding: 11px 26px;
    border-radius: 22px;
    font-weight: 600;
    font-size: 13.5px;
    z-index: 9999;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.5s forwards;
    pointer-events: none;
    letter-spacing: 0.3px;
}
@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-28px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-16px);
    }
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 55px 20px;
    color: var(--gray-400);
    font-size: 14px;
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 1100px) {
    .comic-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 11px;
    }
    .filter-row {
        flex-direction: column;
        gap: 5px;
    }
    .filter-label {
        width: auto;
        padding-top: 0;
    }
}
@media (max-width: 700px) {
    .comic-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 9px;
    }
    .navbar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .filter-panel {
        padding: 12px 14px 8px;
    }
    .filter-tag {
        padding: 4px 10px;
        font-size: 11.5px;
        border-radius: 15px;
    }
    .filter-label {
        font-size: 12px;
    }
    .filter-title {
        font-size: 14px;
    }
}
@media (max-width: 440px) {
    .comic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }
    .comic-card .info {
        padding: 6px 7px 8px;
    }
    .comic-card .info .title {
        font-size: 11.5px;
    }
    .comic-card .info .desc-line1 {
        font-size: 10px;
        gap: 4px;
    }
    .comic-card .info .desc-line2 {
        font-size: 9.5px;
        gap: 4px;
    }
    .page-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    .filter-actions {
        gap: 6px;
    }
    .filter-reset-btn,
    .filter-toggle-btn {
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 14px;
    }
}
/* 筛选行容器 - 带收起动画 */
.filter-rows-wrapper {
    overflow: hidden;
    max-height: 800px;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s ease,
                margin 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    margin-bottom: 6px;
}

.filter-rows-wrapper.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* 收起按钮箭头旋转 */
.filter-toggle-btn .arrow-icon {
    display: inline-block;
    transition: transform 0.4s ease;
    font-size: 10px;
    margin-right: 2px;
}
.filter-toggle-btn.collapsed .arrow-icon {
    transform: rotate(180deg);
}

/* 按钮通用样式 */
.filter-toggle-btn,
.filter-reset-btn {
    padding: 7px 16px;
    border-radius: 18px;
    border: 2px solid #d1d5db;
    background: #fff;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.22s ease;
    white-space: nowrap;
}
.filter-toggle-btn:hover,
.filter-reset-btn:hover {
    background: #faf5ff;
    border-color: #c084fc;
    color: #9333ea;
}