@charset 'UTF-8';

/* ============================================
   布局优化增强 - Layout Enhancements
   现代网格系统 + 响应式优化
   ============================================ */

/* ============================================
   首页布局 - 双栏网格系统
   ============================================ */
.home-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px;
    align-items: start;
}

/* 平板端优化 - 768px-1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .home-layout {
        padding: 24px;
    }
    
    .home-layout .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .home-layout .sidebar-section {
        margin-bottom: 0;
    }
}

@media (min-width: 1024px) {
    .home-layout {
        grid-template-columns: 1fr 320px;
        gap: 32px;
        padding: 32px 24px;
        align-items: stretch;
        min-height: calc(100vh - 200px);
    }
    
    /* 主内容区和侧边栏对齐 */
    .home-layout .main-content,
    .home-layout .sidebar {
        display: flex;
        flex-direction: column;
    }
    
    /* 主内容区填充 */
    .home-layout .main-content {
        justify-content: space-between;
    }
    
    /* 最近更新区域填充剩余空间 */
    .home-layout .main-content .book-list {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .home-layout .main-content .book-list .book-list-grid {
        flex: 1;
    }
    
    /* 侧边栏样式 */
    .home-layout .sidebar {
        gap: 24px;
        justify-content: space-between;
    }
    
    /* 侧边栏区块统一高度 */
    .home-layout .sidebar .sidebar-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    
    /* 文本列表填充空间 */
    .home-layout .sidebar .sidebar-section .text-list {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 0;
        gap: 4px;
    }
    
    /* 列表项均匀分布 */
    .home-layout .sidebar .sidebar-section .text-list li {
        flex: 1;
        display: flex;
        align-items: center;
        min-height: 0;
    }
    
    .home-layout .sidebar .sidebar-section .text-list li a {
        width: 100%;
        padding: 6px 12px;
    }
}

/* ============================================
   首页头部 - 视觉优化
   ============================================ */
.home-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--primary-50) 100%);
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.home-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.home-header p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* ============================================
   区块标题 - 统一风格
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 2px;
}

.section-header .more {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.section-header .more:hover {
    color: var(--primary);
    gap: 8px;
}

.section-header .more::after {
    content: '→';
    transition: transform 0.2s ease;
}

.section-header .more:hover::after {
    transform: translateX(4px);
}

/* ============================================
   热门书籍网格 - 响应式
   ============================================ */
.hot-books {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 480px) {
    .hot-books {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 640px) {
    .hot-books {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .hot-books {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1280px) {
    .hot-books {
        grid-template-columns: repeat(6, 1fr);
    }
}

.hot-books .book-card {
    text-align: center;
}

.hot-books .book-card .cover {
    display: block;
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    border: 1px solid var(--border-light);
    /* CLS优化：固定高度防止布局偏移 */
    min-height: 160px;
    background: var(--bg-secondary);
}

.hot-books .book-card:hover .cover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.hot-books .book-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hot-books .book-card .title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-books .book-card .author {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   书籍列表 - 优化布局
   ============================================ */
.book-list {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 28px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.book-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .book-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.book-list-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    /* CLS优化：固定最小高度防止布局偏移 */
    min-height: 152px;
}

.book-list-item:hover {
    background: var(--white);
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.book-list-item .cover {
    flex-shrink: 0;
    display: block;
    width: 90px;
    height: 120px;
    aspect-ratio: 3/4;
    border-radius: var(--radius);
    overflow: hidden;
    /* CLS优化：固定尺寸防止布局偏移 */
    background: var(--bg-secondary);
}

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

.book-list-item .info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-list-item .title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-list-item .meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.book-list-item .desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   侧边栏 - 排行榜样式
   ============================================ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.sidebar-section .section-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: none;
}

.sidebar-section .section-header h2 {
    font-size: 1.1rem;
}

.text-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.text-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    background: var(--bg);
}

.text-list li a::after {
    display: none;
}

.text-list li a:hover {
    background: var(--primary-50);
}

.text-list .rank-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.text-list li:nth-child(1) .rank-num {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    color: #92400e;
}

.text-list li:nth-child(2) .rank-num {
    background: linear-gradient(135deg, #c0c0c0 0%, #e5e7eb 100%);
    color: #4b5563;
}

.text-list li:nth-child(3) .rank-num {
    background: linear-gradient(135deg, #cd7f32 0%, #fbbf24 100%);
    color: #92400e;
}

.text-list .title {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-list .count {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============================================
   分类页面 - 网格布局
   ============================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.category-card:hover {
    border-color: var(--primary);
    background: var(--primary-50);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-card .icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.category-card:hover .icon {
    background: var(--primary);
    color: var(--white);
}

.category-card .name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.category-card .count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   分页组件 - 优化样式
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination a {
    background: var(--white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .current {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: 1px solid var(--primary);
}

.pagination .disabled {
    background: var(--bg);
    color: var(--text-light);
    border: 1px solid var(--border);
    cursor: not-allowed;
}

/* ============================================
   面包屑导航 - 优化
   ============================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.breadcrumb .separator {
    color: var(--text-light);
}

.breadcrumb .current {
    color: var(--text);
    font-weight: 500;
}

/* ============================================
   搜索页面 - 结果列表
   ============================================ */
.search-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--primary-50) 100%);
    border-bottom: 1px solid var(--border);
}

.search-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.search-header p {
    color: var(--text-muted);
}

.search-results {
    padding: 24px 16px;
}

.search-result-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    margin-bottom: 16px;
    transition: all var(--transition-fast);
}

.search-result-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateX(4px);
}

.search-result-item .cover {
    flex-shrink: 0;
    width: 80px;
    aspect-ratio: 3/4;
    border-radius: var(--radius);
    overflow: hidden;
}

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

.search-result-item .info {
    flex: 1;
}

.search-result-item .title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.search-result-item .title .highlight {
    color: var(--primary);
    background: var(--primary-50);
    padding: 0 4px;
    border-radius: 4px;
}

.search-result-item .meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.search-result-item .desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   空状态 - 优化
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* ============================================
   加载骨架屏
   ============================================ */
.skeleton-card {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

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

/* ============================================
   工具类
   ============================================ */
.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 内容区域统一间距 */
main {
    min-height: calc(100vh - 64px - 200px);
}

/* 响应式容器 - 与book-modern.css保持一致 */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 640px) {
    .container {
        padding: 0 24px;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 0 32px;
    }
}

/* ============================================
   Tag标签页面样式
   ============================================ */

/* 标签页面头部 */
.tags-page-header {
    text-align: center;
    padding: 48px 20px;
    background: linear-gradient(135deg, var(--bg) 0%, var(--primary-50) 100%);
    border-radius: var(--radius-xl);
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.tags-page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.tags-page-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* 区块标题 */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 2px;
}

/* 标签云 */
.tags-cloud-section {
    margin-bottom: 40px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg);
    border-radius: var(--radius-full);
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: all var(--transition);
    border: 1px solid var(--border);
}

.tag-item:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tag-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-weight: 600;
}

.tag-item:hover .tag-count {
    background: rgba(255,255,255,0.2);
    color: var(--white);
}

/* 标签大小 */
.tag-size-1 { font-size: 0.85rem; }
.tag-size-2 { font-size: 0.95rem; }
.tag-size-3 { font-size: 1.05rem; }
.tag-size-4 { font-size: 1.15rem; }
.tag-size-5 { font-size: 1.25rem; }

/* 按字母分类 */
.tags-by-letter-section {
    margin-bottom: 40px;
}

.letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    justify-content: center;
}

.letter-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.letter-link:hover {
    background: var(--primary);
    color: var(--white);
}

.tags-by-letter {
    display: grid;
    gap: 20px;
}

.letter-group {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
}

.letter-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.letter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-link {
    padding: 8px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.tag-link:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-light);
}

/* 精选专题 */
.featured-tags-section {
    margin-bottom: 40px;
}

.featured-tags {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
}

@media (min-width: 640px) {
    .featured-tags {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .featured-tags {
        grid-template-columns: repeat(3, 1fr);
    }
}

.featured-tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--transition);
}

.featured-tag:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.featured-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.featured-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.featured-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================
   暗黑模式适配
   ============================================ */

/* 首页头部暗黑模式 */
html.dark-mode .home-header {
    background: linear-gradient(135deg, var(--bg) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-bottom-color: var(--border);
}

/* 区块标题暗黑模式 */
html.dark-mode .section-header {
    border-bottom-color: var(--border);
}

/* 书籍列表暗黑模式 */
html.dark-mode .book-list {
    background: var(--white);
    border-color: var(--border);
}

html.dark-mode .book-list-item {
    background: var(--bg-secondary);
}

html.dark-mode .book-list-item:hover {
    background: var(--bg);
    border-color: var(--border);
}

/* 侧边栏暗黑模式 */
html.dark-mode .sidebar-section {
    background: var(--white);
    border-color: var(--border);
}

html.dark-mode .text-list li a {
    background: var(--bg-secondary);
}

html.dark-mode .text-list li a:hover {
    background: var(--primary-50);
}

/* 分类卡片暗黑模式 */
html.dark-mode .category-card {
    background: var(--white);
    border-color: var(--border);
}

html.dark-mode .category-card:hover {
    background: var(--primary-50);
    border-color: var(--primary);
}

/* 分页暗黑模式 */
html.dark-mode .pagination a {
    background: var(--white);
    border-color: var(--border);
    color: var(--text-secondary);
}

html.dark-mode .pagination a:hover {
    background: var(--primary-50);
    border-color: var(--primary);
}

/* 搜索结果暗黑模式 */
html.dark-mode .search-header {
    background: linear-gradient(135deg, var(--bg) 0%, rgba(59, 130, 246, 0.1) 100%);
}

html.dark-mode .search-result-item {
    background: var(--white);
    border-color: var(--border);
}

/* 空状态暗黑模式 */
html.dark-mode .empty-state .icon {
    opacity: 0.3;
}

/* 骨架屏暗黑模式 */
html.dark-mode .skeleton-card {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
}

/* Tag页面暗黑模式 */
html.dark-mode .tags-page-header {
    background: linear-gradient(135deg, var(--bg) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: var(--border);
}

html.dark-mode .tags-cloud {
    background: var(--white);
    border-color: var(--border);
}

html.dark-mode .tag-item {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text);
}

html.dark-mode .tag-item:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

html.dark-mode .letter-nav {
    background: var(--white);
    border-color: var(--border);
}

html.dark-mode .letter-link {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

html.dark-mode .letter-link:hover {
    background: var(--primary);
    color: var(--white);
}

html.dark-mode .letter-group {
    background: var(--white);
    border-color: var(--border);
}

html.dark-mode .tag-link {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

html.dark-mode .tag-link:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-light);
}

html.dark-mode .featured-tag {
    background: var(--white);
    border-color: var(--border);
}

html.dark-mode .featured-tag:hover {
    border-color: var(--primary);
}

/* ============================================
   作者页面样式
   ============================================ */

/* 作者页面容器 */
.author-page {
    padding: 24px 0;
}

/* 作者信息卡片 */
.author-profile-card {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 48px;
    background: linear-gradient(135deg, var(--white) 0%, var(--bg) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}

.author-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.avatar-text {
    font-size: 48px;
    font-weight: 700;
    color: var(--white);
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.author-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 16px;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-item strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-item em {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: normal;
}

.stat-divider {
    color: var(--border);
}

.author-intro {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
}

/* 作品列表区域 */
.author-works-section {
    margin-bottom: 32px;
}

.author-works-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

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

.sort-options a {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.sort-options a:hover,
.sort-options a.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* 作品网格 */
.author-works-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
}

@media (min-width: 640px) {
    .author-works-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .author-works-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 作品卡片 */
.author-work-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.author-work-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.work-cover {
    position: relative;
    width: 120px;
    height: 160px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

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

.work-status {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.work-status.completed {
    background: #10b981;
    color: white;
}

.work-status.ongoing {
    background: var(--primary);
    color: white;
}

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

.work-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.work-title a {
    color: var(--text);
    text-decoration: none;
}

.work-title a:hover {
    color: var(--primary);
}

.work-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.work-category {
    padding: 2px 8px;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.work-chapters {
    color: var(--text-muted);
}

.work-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.work-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.work-stat svg {
    opacity: 0.7;
}

.work-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.btn-read,
.btn-catalog {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}

.btn-read {
    background: var(--primary);
    color: var(--white);
}

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

.btn-catalog {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-catalog:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

/* 分页 */
.author-pagination {
    margin: 32px 0;
    justify-content: center;
}

/* 相关作者 */
.related-authors-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.related-authors {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.related-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--transition);
}

.related-author:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.related-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

.related-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

.related-author:hover .related-name {
    color: var(--primary);
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 20px;
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .author-profile-card {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
    }
    
    .author-avatar {
        width: 100px;
        height: 100px;
    }
    
    .avatar-text {
        font-size: 40px;
    }
    
    .author-name {
        font-size: 1.5rem;
    }
    
    .author-stats {
        justify-content: center;
    }
    
    .author-intro {
        margin: 0 auto;
    }
    
    .author-works-section .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sort-options {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .author-work-card {
        flex-direction: column;
    }
    
    .work-cover {
        width: 100%;
        height: 200px;
    }
    
    .work-actions {
        flex-direction: column;
    }
    
    .btn-read,
    .btn-catalog {
        text-align: center;
    }
}

/* ============================================
   作者页面暗黑模式适配
   ============================================ */

html.dark-mode .author-profile-card {
    background: linear-gradient(135deg, var(--white) 0%, var(--bg-secondary) 100%);
    border-color: var(--border);
}

html.dark-mode .author-work-card {
    background: var(--white);
    border-color: var(--border);
}

html.dark-mode .author-work-card:hover {
    border-color: var(--primary);
}

html.dark-mode .sort-options a {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-secondary);
}

html.dark-mode .sort-options a:hover,
html.dark-mode .sort-options a.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

html.dark-mode .work-category {
    background: var(--primary-100);
}

html.dark-mode .btn-catalog {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text);
}

html.dark-mode .btn-catalog:hover {
    background: var(--bg);
    border-color: var(--primary);
}

html.dark-mode .related-author {
    background: var(--white);
    border-color: var(--border);
}

html.dark-mode .related-author:hover {
    border-color: var(--primary);
}

html.dark-mode .empty-state {
    background: var(--white);
    border-color: var(--border);
}

/* ============================================
   PC端布局美观优化
   ============================================ */

/* 大屏幕优化 - 1440px+ */
@media (min-width: 1440px) {
    .home-layout {
        grid-template-columns: 1fr 360px;
        gap: 40px;
        padding: 40px 32px;
        max-width: 1400px;
        align-items: stretch;
    }
    
    .hot-books {
        grid-template-columns: repeat(6, 1fr);
        gap: 24px;
    }
    
    .book-list-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .book-list-item {
        padding: 20px;
    }
    
    .book-list-item .cover {
        width: 100px;
        height: 133px;
    }
}

/* 超大屏幕优化 - 1920px+ */
@media (min-width: 1920px) {
    .home-layout {
        max-width: 1600px;
        grid-template-columns: 1fr 400px;
        gap: 48px;
        align-items: stretch;
    }
    
    .hot-books {
        gap: 28px;
    }
    
    .book-card .cover {
        height: 200px;
    }
}

/* 首页头部美化 */
.home-header {
    position: relative;
    overflow: hidden;
}

.home-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-50) 0%, transparent 70%);
    opacity: 0.5;
    pointer-events: none;
}

.home-header h1 {
    position: relative;
    z-index: 1;
}

/* 区块标题美化 */
.section-header {
    position: relative;
}

.section-header h2 {
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.section-header .more {
    padding: 6px 14px;
    background: var(--bg);
    border-radius: var(--radius-full);
    font-weight: 500;
    transition: all var(--transition);
}

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

/* 书籍卡片美化 */
.book-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.book-card .cover {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.book-card .title {
    font-weight: 600;
    margin-top: 12px;
    font-size: 0.95rem;
}

.book-card .author a {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.book-card .author a:hover {
    color: var(--primary);
}

/* 书籍列表项美化 */
.book-list-item {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid transparent;
}

.book-list-item:hover {
    border-color: var(--primary-100);
    box-shadow: var(--shadow);
}

.book-list-item .cover {
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.book-list-item .info .title {
    font-weight: 600;
    font-size: 1rem;
}

.book-list-item .meta a {
    color: var(--primary);
    font-weight: 500;
}

.book-list-item .desc {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 侧边栏美化 */
.sidebar-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.sidebar-section .section-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.sidebar-section .section-header h2 {
    font-size: 1.1rem;
}

/* 文本列表美化 */
.text-list li a {
    padding: 10px 12px;
    border-radius: var(--radius);
    transition: background-color 0.2s ease;
    will-change: background-color;
}

.text-list li a:hover {
    background: var(--primary-50);
}

.text-list .rank-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
}

/* 导航栏美化 */
.main-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-menu a {
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: background-color 0.2s ease, color 0.2s ease;
    will-change: background-color, color;
}

.nav-menu a:hover {
    background: var(--primary-50);
    color: var(--primary);
}

/* 页脚美化 */
.footer {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg) 100%);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
}

.footer-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.footer-links a {
    color: var(--text-secondary);
    transition: color var(--transition);
}

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

/* ============================================
   移动端布局美观优化
   ============================================ */

/* 小屏幕手机优化 - 320px-374px */
@media (max-width: 374px) {
    .home-layout {
        padding: 16px 12px;
        gap: 20px;
    }
    
    .home-header {
        padding: 32px 16px;
    }
    
    .home-header h1 {
        font-size: 1.5rem;
    }
    
    .hot-books {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .book-card {
        padding: 12px;
    }
    
    .book-card .cover {
        height: 140px;
    }
    
    .book-card .title {
        font-size: 0.85rem;
    }
    
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    .book-list-item {
        padding: 12px;
    }
    
    .book-list-item .cover {
        width: 70px;
        height: 93px;
    }
    
    .sidebar-section {
        padding: 16px;
    }
}

/* 标准手机优化 - 375px-767px */
@media (min-width: 375px) and (max-width: 767px) {
    .home-layout {
        padding: 20px 16px;
    }
    
    .hot-books {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    
    .book-card .cover {
        height: 160px;
    }
    
    .book-list-grid {
        gap: 14px;
    }
}

/* 平板竖屏优化 - 768px-1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .hot-books {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
    
    .book-card .cover {
        height: 180px;
    }
}

/* 移动端触摸优化 */
@media (max-width: 1023px) {
    .book-card,
    .book-list-item,
    .text-list li a {
        -webkit-tap-highlight-color: transparent;
    }
    
    .book-card:active,
    .book-list-item:active {
        transform: scale(0.98);
    }
    
    .nav-menu {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .section-header .more {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    /* 移动端导航栏固定 */
    .main-nav {
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    /* 移动端底部安全区域 */
    .footer {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* 暗黑模式下的移动端优化 */
@media (max-width: 1023px) {
    html.dark-mode .main-nav {
        background: rgba(30, 41, 59, 0.95);
    }
}
