/* =============================================
   首页样式 - 现代简约风格
   两栏布局 + 右侧边栏
   ============================================= */

/* 首页背景 */
body {
    background: #fafafa;
}

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

/* =============================================
   主容器
   ============================================= */
.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* =============================================
   轮播图
   ============================================= */
.hero-section {
    margin-bottom: 20px;
}

/* 轮播图两栏布局 - 与主内容区域一致 */
.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: stretch;
}

.carousel-container {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.hero-sidebar {
    display: flex;
    flex-direction: column;
}

.hero-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 320px;
}

.hero-card .sidebar-card-header {
    flex-shrink: 0;
}

.hero-card .category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
    flex: 1;
    align-content: start;
}

.hero-card .category-item {
    padding: 8px 10px;
    font-size: 0.8rem;
}

.hero-card .category-icon {
    width: 26px;
    height: 26px;
}

.hero-card .category-icon svg {
    width: 14px;
    height: 14px;
}

.hero-card .category-name {
    font-size: 0.75rem;
}

.carousel {
    position: relative;
    height: 320px;
    overflow: hidden;
    border-radius: 16px;
}

.carousel-inner {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-item .carousel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
}

.carousel-item h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.carousel-item p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 15px;
}

.carousel-item .btn-read {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.carousel-item .btn-read:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carousel:hover .carousel-control {
    opacity: 1;
}

.carousel-control:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.carousel-prev { left: 20px; }
.carousel-next { right: 20px; }

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-indicator.active {
    background: #fff;
    width: 24px;
    border-radius: 4px;
}

/* =============================================
   两栏布局
   ============================================= */
.two-column-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
}

/* =============================================
   主内容区
   ============================================= */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

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

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    position: relative;
    padding-left: 12px;
}

.section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-more {
    font-size: 0.85rem;
    color: #999;
    transition: color 0.3s;
    text-decoration: none;
}

.section-more:hover {
    color: var(--primary-color);
}

/* 特色图书 */
.featured-book {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 24px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.featured-book .cover {
    width: 160px;
    height: 214px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.featured-book .cover:hover {
    transform: translateY(-4px);
}

.featured-book .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-book .info {
    display: flex;
    flex-direction: column;
}

.featured-book .title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    cursor: pointer;
    transition: color 0.3s;
}

.featured-book .title:hover {
    color: var(--primary-color);
}

.featured-book .author {
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 12px;
}

.featured-book .tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.featured-book .tag {
    padding: 4px 12px;
    background: rgba(212, 165, 165, 0.15);
    color: var(--primary-color);
    border-radius: 6px;
    font-size: 0.75rem;
}

.featured-book .desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.7;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 横向滚动 */
.book-scroll-container {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

.book-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.book-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.book-scroll-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.book-scroll-list {
    display: flex;
    gap: 16px;
    padding-bottom: 8px;
}

.book-scroll-item {
    flex-shrink: 0;
    width: 110px;
    cursor: pointer;
    transition: transform 0.3s;
}

.book-scroll-item:hover {
    transform: translateY(-4px);
}

.book-scroll-item .cover {
    width: 110px;
    height: 147px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 8px;
}

.book-scroll-item .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-scroll-item .title {
    font-size: 0.85rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 图书网格 */
.book-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 100%;
}

.book-grid-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: #f8f8f8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.book-grid-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.book-grid-item .cover {
    width: 75px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.book-grid-item .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-grid-item .cover .tag {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.65rem;
    border-radius: 4px;
}

.book-grid-item .cover .tag.vip { background: #ffa94d; }
.book-grid-item .cover .tag.complete { background: #51cf66; }

.book-grid-item .info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.book-grid-item .title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-grid-item .author {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 6px;
}

.book-grid-item .meta {
    font-size: 0.75rem;
    color: #bbb;
    display: flex;
    gap: 8px;
}

/* 经典完本 */
.complete-books {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.complete-book-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: #f8f8f8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.complete-book-item:hover {
    background: #f0f0f0;
}

/* 新上传轮播容器 */
.new-books-container {
    position: relative;
    overflow: hidden;
}

.new-books-page {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 淡入动画 */
.new-books-page.fade-in {
    animation: fadeInUp 0.5s ease forwards;
}

/* 淡出动画 */
.new-books-page.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 最新上传图书项 */
.new-book-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: #f8f8f8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-book-item:hover {
    background: #f0f0f0;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.new-book-item .cover {
    width: 75px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.new-book-item .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.new-book-item:hover .cover img {
    transform: scale(1.05);
}

.new-book-item .info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.new-book-item .title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.new-book-item .desc {
    font-size: 0.75rem;
    color: #888;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
    flex: 1;
}

.new-book-item .meta {
    font-size: 0.7rem;
    color: #bbb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.new-book-item .meta .author {
    color: #999;
}

.new-book-item .meta .time {
    color: #ccc;
}

.complete-book-item .cover {
    width: 65px;
    height: 87px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.complete-book-item .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.complete-book-item .title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.complete-book-item .desc {
    font-size: 0.75rem;
    color: #999;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    margin-bottom: 6px;
}

.complete-book-item .meta {
    font-size: 0.7rem;
    color: #bbb;
}

/* =============================================
   漫画专区
   ============================================= */
.comics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.comics-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: #f8f8f8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.comics-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.comics-item .cover {
    width: 60px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.comics-item .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comics-item .info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.comics-item .title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comics-item .author {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comics-item .intro {
    font-size: 0.7rem;
    color: #aaa;
    line-height: 1.4;
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =============================================
   右侧边栏
   ============================================= */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 320px;
    flex-shrink: 0;
}

.sidebar-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.sidebar-card-header {
    padding: 16px 18px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.sidebar-card-header a {
    font-size: 0.8rem;
    color: #999;
    text-decoration: none;
}

.sidebar-card-header a:hover {
    color: var(--primary-color);
}

/* 公告样式 */
.announcement-content {
    padding: 16px 18px;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.7;
}
}

/* 分类网格 */
.category-grid {
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f8f8f8;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.category-item:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.category-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.category-icon svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.category-name {
    font-size: 0.8rem;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 网站统计 */
.stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8f8f8;
    border-radius: 8px;
    transition: all 0.3s;
}

.stats-item:hover {
    background: #f0f0f0;
}

.stats-label {
    font-size: 0.85rem;
    color: #666;
}

.stats-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

[data-theme="dark"] .stats-item {
    background: #2d2d2d;
}

[data-theme="dark"] .stats-item:hover {
    background: #3d3d3d;
}

[data-theme="dark"] .stats-label {
    color: #999;
}

/* 排行榜 */
.sidebar-rank-list {
    list-style: none;
    padding: 12px 16px;
}

.sidebar-rank-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: color 0.3s;
}

.sidebar-rank-list li:last-child {
    border-bottom: none;
}

.sidebar-rank-list li:hover {
    color: var(--primary-color);
}

.sidebar-rank-list .rank-num {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    background: #f5f5f5;
    color: #999;
    flex-shrink: 0;
}

.sidebar-rank-list li:nth-child(1) .rank-num {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
}

.sidebar-rank-list li:nth-child(2) .rank-num {
    background: linear-gradient(135deg, #ffa94d, #ff922b);
    color: #fff;
}

.sidebar-rank-list li:nth-child(3) .rank-num {
    background: linear-gradient(135deg, #ffd43b, #fab005);
    color: #fff;
}

.sidebar-rank-list .rank-title {
    flex: 1;
    font-size: 0.85rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 公告 */
.announcement-content {
    padding: 16px 18px;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.7;
}

/* =============================================
   加载状态
   ============================================= */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* =============================================
   响应式设计
   ============================================= */

/* 全局防止内容溢出 */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

* {
    max-width: 100%;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 1200px) {
    .two-column-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .right-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        width: 100%;
    }

    .hero-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-sidebar {
        width: 100%;
    }

    .hero-card {
        height: auto;
    }
}

@media (max-width: 768px) {
    .main-wrapper {
        padding: 12px;
        max-width: 100%;
    }

    .carousel {
        height: 200px;
    }

    .hero-sidebar {
        flex-direction: column;
    }

    .hero-card {
        height: auto;
    }

    .hero-card .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .right-sidebar {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .carousel-item .carousel-content {
        padding: 16px;
    }

    .carousel-item h3 {
        font-size: 1rem;
        margin-bottom: 6px;
    }

    .carousel-item p {
        font-size: 0.8rem;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .carousel-item .btn-read {
        padding: 6px 16px;
        font-size: 0.8rem;
    }

    .carousel-control {
        width: 32px;
        height: 32px;
        opacity: 1;
    }

    .carousel-control svg {
        width: 16px;
        height: 16px;
    }

    .carousel-indicators {
        bottom: 10px;
    }

    .carousel-indicator {
        width: 6px;
        height: 6px;
    }

    .content-section {
        padding: 14px;
        margin-bottom: 16px;
    }

    .section-header {
        margin-bottom: 14px;
    }

    .section-title {
        font-size: 1rem;
    }

    .featured-book {
        grid-template-columns: 100px 1fr;
        gap: 12px;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .featured-book .cover {
        width: 100px;
        height: 134px;
    }

    .featured-book .title {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .featured-book .author {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .featured-book .tags {
        gap: 6px;
        margin-bottom: 8px;
    }

    .featured-book .tag {
        padding: 2px 8px;
        font-size: 0.7rem;
    }

    .featured-book .desc {
        font-size: 0.8rem;
        line-height: 1.6;
        -webkit-line-clamp: 2;
    }

    .book-scroll-container {
        margin: 0 -14px;
        padding: 0 14px;
        -webkit-overflow-scrolling: touch;
    }

    .book-scroll-list {
        gap: 12px;
    }

    .book-scroll-item {
        width: 85px;
    }

    .book-scroll-item .cover {
        width: 85px;
        height: 113px;
    }

    .book-scroll-item .title {
        font-size: 0.75rem;
    }

    .book-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .book-grid-item {
        padding: 12px;
        gap: 12px;
    }

    .book-grid-item .cover {
        width: 60px;
        height: 80px;
    }

    .book-grid-item .title {
        font-size: 0.9rem;
    }

    .book-grid-item .author {
        font-size: 0.75rem;
    }

    .book-grid-item .desc {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }

    .book-grid-item .meta {
        font-size: 0.7rem;
    }

    .complete-books {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .new-books-container {
        gap: 12px;
    }

    .new-books-page {
        grid-template-columns: 1fr;
    }

    .new-book-item, .complete-book-item {
        padding: 12px;
        gap: 12px;
    }

    .new-book-item .cover, .complete-book-item .cover {
        width: 55px;
        height: 73px;
    }

    .new-book-item .title, .complete-book-item .title {
        font-size: 0.85rem;
    }

    .new-book-item .desc, .complete-book-item .desc {
        font-size: 0.7rem;
        -webkit-line-clamp: 2;
    }

    .right-sidebar {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .sidebar-card {
        border-radius: 12px;
    }

    .sidebar-card-header {
        padding: 12px 14px;
    }

    .sidebar-card-header h3 {
        font-size: 0.9rem;
    }

    .category-grid {
        padding: 12px;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .category-item {
        padding: 8px 10px;
        gap: 8px;
    }

    .category-icon {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .category-name {
        font-size: 0.8rem;
    }

    .sidebar-rank-list {
        padding: 10px 14px;
    }

    .sidebar-rank-list li {
        padding: 8px 0;
        gap: 10px;
    }

    .sidebar-rank-list .rank-num {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
    }

    .sidebar-rank-list .book-title {
        font-size: 0.85rem;
    }

    .announcement-list {
        padding: 12px 14px;
    }

    .announcement-item {
        padding: 10px 0;
    }

    .announcement-title {
        font-size: 0.85rem;
    }

    .announcement-date {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .main-wrapper {
        padding: 8px;
    }

    .carousel {
        aspect-ratio: 4/3;
    }

    .carousel-item .carousel-content {
        padding: 12px;
    }

    .carousel-item h3 {
        font-size: 0.9rem;
    }

    .carousel-item p {
        display: none;
    }

    .carousel-item .btn-read {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    .carousel-control {
        width: 28px;
        height: 28px;
    }

    .content-section {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    .section-title {
        font-size: 0.95rem;
    }

    .featured-book {
        grid-template-columns: 80px 1fr;
        gap: 10px;
    }

    .featured-book .cover {
        width: 80px;
        height: 107px;
    }

    .featured-book .title {
        font-size: 0.9rem;
    }

    .featured-book .author {
        font-size: 0.75rem;
    }

    .featured-book .desc {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }

    .book-scroll-container {
        margin: 0 -12px;
        padding: 0 12px;
    }

    .book-scroll-item {
        width: 75px;
    }

    .book-scroll-item .cover {
        width: 75px;
        height: 100px;
    }

    .book-scroll-item .title {
        font-size: 0.7rem;
    }

    .book-grid-item {
        padding: 10px;
        gap: 10px;
    }

    .book-grid-item .cover {
        width: 50px;
        height: 67px;
    }

    .book-grid-item .title {
        font-size: 0.85rem;
    }

    .new-book-item, .complete-book-item {
        padding: 10px;
        gap: 10px;
    }

    .new-book-item .cover, .complete-book-item .cover {
        width: 50px;
        height: 67px;
    }

    .category-grid {
        padding: 10px;
        gap: 6px;
    }

    .category-item {
        padding: 6px 8px;
        gap: 6px;
    }

    .category-icon {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .category-name {
        font-size: 0.75rem;
    }

    .sidebar-card-header {
        padding: 10px 12px;
    }

    .sidebar-card-header h3 {
        font-size: 0.85rem;
    }

    .sidebar-rank-list {
        padding: 8px 12px;
    }

    .sidebar-rank-list li {
        padding: 6px 0;
        gap: 8px;
    }

    .sidebar-rank-list .rank-num {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }

    .sidebar-rank-list .book-title {
        font-size: 0.8rem;
    }
}

/* 深色模式 */
[data-theme="dark"] body {
    background: var(--bg-primary);
}

[data-theme="dark"] .carousel-control {
    background: rgba(40, 40, 40, 0.95);
}

[data-theme="dark"] .carousel-control:hover {
    background: rgba(50, 50, 50, 1);
}

[data-theme="dark"] .carousel-indicator {
    background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .carousel-indicator.active {
    background: #fff;
}

/* 深色模式适配 */
[data-theme="dark"] .sidebar-card {
    background: #1e1e2a;
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar-card-header {
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar-card-header h3 {
    color: #e8e8f0;
}

[data-theme="dark"] .category-item {
    background: #252530;
}

[data-theme="dark"] .category-item:hover {
    background: #2a2a38;
}

[data-theme="dark"] .category-name {
    color: #e8e8f0;
}

[data-theme="dark"] .sidebar-rank-list li {
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar-rank-list .rank-num {
    background: #252530;
    color: #888;
}

[data-theme="dark"] .sidebar-rank-list .rank-title {
    color: #e8e8f0;
}

[data-theme="dark"] .content-section {
    background: #1e1e2a;
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .section-header h2 {
    color: #e8e8f0;
}

[data-theme="dark"] .featured-book {
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .featured-book .title {
    color: #e8e8f0;
}

[data-theme="dark"] .featured-book .author {
    color: #888;
}

[data-theme="dark"] .featured-book .desc {
    color: #aaa;
}

[data-theme="dark"] .book-grid-item {
    background: #252530;
}

[data-theme="dark"] .book-grid-item:hover {
    background: #2a2a38;
}

[data-theme="dark"] .book-grid-item .title {
    color: #e8e8f0;
}

[data-theme="dark"] .book-grid-item .author {
    color: #888;
}

[data-theme="dark"] .book-grid-item .meta {
    color: #666;
}

[data-theme="dark"] .complete-book-item {
    background: #252530;
}

[data-theme="dark"] .complete-book-item:hover {
    background: #2a2a38;
}

[data-theme="dark"] .complete-book-item .title {
    color: #e8e8f0;
}

[data-theme="dark"] .complete-book-item .desc {
    color: #888;
}

[data-theme="dark"] .complete-book-item .meta {
    color: #666;
}

[data-theme="dark"] .book-scroll-item .title {
    color: #e8e8f0;
}

[data-theme="dark"] .announcement-content {
    color: #aaa;
}

[data-theme="dark"] .new-book-item {
    background: #252530;
}

[data-theme="dark"] .new-book-item:hover {
    background: #2a2a38;
}

[data-theme="dark"] .new-book-item .title {
    color: #e8e8f0;
}

[data-theme="dark"] .new-book-item .desc {
    color: #888;
}

[data-theme="dark"] .new-book-item .meta .author {
    color: #888;
}

[data-theme="dark"] .new-book-item .meta .time {
    color: #555;
}
