/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 韩漫网站配色方案 - 清新明亮风格 */
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --hover-color: #4f46e5;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(99, 102, 241, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.logo .tagline {
    font-size: 0.875rem;
    opacity: 0.9;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    min-width: 200px;
}

.search-box button {
    padding: 0.5rem 1.5rem;
    background: white;
    color: var(--primary-color);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--bg-secondary);
}

/* 主要内容区域 */
.main-content {
    padding: 2rem 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    padding-left: 1rem;
}

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

/* 轮播推荐区 */
.hero-section {
    margin-bottom: 3rem;
    scroll-margin-top: 80px;
}

.hero-carousel {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-item {
    position: relative;
    height: 400px;
    overflow: hidden;
}

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

.hero-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 2rem;
    color: white;
}

.hero-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* 漫画网格 */
.comic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.comic-card {
    background: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.comic-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.comic-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.comic-cover {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.comic-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.comic-card:hover .comic-cover img {
    transform: scale(1.05);
}

.update-badge,
.finish-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.update-badge {
    background: var(--accent-color);
    color: white;
}

.finish-badge {
    background: var(--primary-color);
    color: white;
}

.comic-info {
    padding: 1rem;
}

.comic-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comic-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.comic-type,
.comic-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.comic-type {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.comic-status {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.comic-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分类导航 */
.category-section {
    margin-bottom: 3rem;
    background: var(--bg-secondary);
    padding: 2rem 0;
    scroll-margin-top: 80px;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    padding: 1rem;
    background: white;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow);
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.category-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.category-item span {
    font-weight: 500;
    font-size: 0.875rem;
}

/* 排行榜 */
.ranking-section {
    margin-bottom: 3rem;
    scroll-margin-top: 80px; /* 避免被固定头部遮挡 */
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.ranking-item:hover {
    background: var(--border-color);
}

.rank-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.ranking-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.ranking-link img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.ranking-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.ranking-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* SEO内容区域 */
.content-section {
    margin-bottom: 3rem;
    background: var(--bg-secondary);
    padding: 2rem 0;
    scroll-margin-top: 80px;
}

.seo-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.seo-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.seo-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.seo-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* 页脚 */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section p {
    font-size: 0.875rem;
    line-height: 1.6;
    opacity: 0.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.footer-section a:hover {
    opacity: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tags a {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.75rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .header .container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav ul {
        gap: 1rem;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        flex: 1;
        min-width: 0;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .logo .tagline {
        font-size: 0.75rem;
    }
    
    .hero-item {
        height: 250px;
    }
    
    .hero-info {
        padding: 1rem;
    }
    
    .hero-info h3 {
        font-size: 1.25rem;
    }
    
    .comic-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .comic-cover {
        height: 180px;
    }
    
    .comic-title {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .category-list {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-item img {
        width: 60px;
        height: 60px;
    }
    
    .ranking-link img {
        width: 60px;
        height: 80px;
    }
    
    .seo-content {
        padding: 1.5rem;
    }
    
    .seo-content h2 {
        font-size: 1.25rem;
    }
    
    .seo-content h3 {
        font-size: 1.125rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .comic-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rank-number {
        font-size: 1.25rem;
        min-width: 30px;
    }
}

/* 性能优化 - 图片懒加载样式 */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* 无障碍优化 */
a:focus,
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .header,
    .footer,
    .search-box {
        display: none;
    }
}

