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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

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

.nav a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s;
    font-size: 0.95rem;
}

.nav a:hover {
    opacity: 0.8;
}

/* 主要内容区域 */
.main {
    min-height: calc(100vh - 200px);
}

/* Hero区域 */
.hero {
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

.hero-text h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-text p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.8;
}

.hero-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* 特色功能区域 */
.features {
    padding: 3rem 0;
    background-color: var(--light-bg);
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.feature-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

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

.feature-card img {
    width: 100%;
    max-width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.feature-card p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #666;
}

/* 分类区域 */
.categories {
    padding: 3rem 0;
}

.categories h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.categories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.category-item {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.category-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.category-item h3 {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.category-item p {
    padding: 0 1rem 1rem;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
}

/* 关于我们区域 */
.about {
    padding: 3rem 0;
    background-color: var(--light-bg);
}

.about h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.8;
    text-align: justify;
}

.about-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* 使用指南区域 */
.how-to-use {
    padding: 3rem 0;
}

.how-to-use h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.step {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.step p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #666;
    margin-bottom: 1rem;
}

.step img {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    margin: 0 auto;
    display: block;
}

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

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.9;
}

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

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

.footer-section a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    opacity: 0.8;
}

/* 响应式设计 - 平板 */
@media (min-width: 768px) {
    html {
        font-size: 17px;
    }

    .container {
        padding: 0 30px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero-content {
        grid-template-columns: 1fr 1fr;
    }

    .hero-text h2 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-content {
        grid-template-columns: 1fr 1fr;
    }

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

    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 响应式设计 - 桌面 */
@media (min-width: 1024px) {
    html {
        font-size: 18px;
    }

    .container {
        padding: 0 40px;
    }

    .hero {
        padding: 4rem 0;
    }

    .hero-text h2 {
        font-size: 2.25rem;
    }

    .features {
        padding: 4rem 0;
    }

    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .categories {
        padding: 4rem 0;
    }

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

    .about {
        padding: 4rem 0;
    }

    .how-to-use {
        padding: 4rem 0;
    }
}

/* 性能优化 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 可访问性优化 */
a:focus,
button:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

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

/* 内页样式 */
.page-header {
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.page-header p {
    font-size: 1rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* 分类详情页样式 */
.categories-page {
    padding: 3rem 0;
}

.category-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.category-detail-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1fr;
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-detail-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-detail-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.category-detail-content {
    padding: 1.5rem;
}

.category-detail-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.category-detail-content > p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    color: #666;
}

.category-features {
    list-style: none;
    margin: 1rem 0;
    padding-left: 0;
}

.category-features li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.95rem;
    color: #666;
}

.category-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

.category-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.category-guide {
    padding: 3rem 0;
    background-color: var(--light-bg);
}

.category-guide h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.guide-content p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: justify;
}

/* 漫画卡片样式 */
.comics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.comic-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

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

.comic-card.featured {
    border: 2px solid var(--accent-color);
}

.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 10;
}

.comic-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.comic-info {
    padding: 1.5rem;
}

.comic-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.comic-type {
    display: inline-block;
    background: var(--light-bg);
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.comic-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #666;
    margin-bottom: 1rem;
}

.comic-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #999;
}

.update-time {
    color: var(--accent-color);
    font-weight: 500;
}

.chapter-count {
    color: var(--secondary-color);
}

.views {
    color: var(--secondary-color);
}

.rating {
    color: #f39c12;
    font-weight: 500;
}

.latest-comics,
.popular-comics {
    padding: 3rem 0;
}

.update-info,
.popular-guide {
    padding: 3rem 0;
    background-color: var(--light-bg);
}

.update-info h2,
.popular-guide h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.info-content p,
.guide-content p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: justify;
}

/* 排行榜样式 */
.popular-ranking {
    margin-bottom: 3rem;
}

.popular-ranking h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.ranking-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.ranking-item {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: auto 150px 1fr;
    gap: 1.5rem;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.rank-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
}

.rank-1 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.rank-2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.rank-3 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.ranking-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
}

.ranking-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.ranking-info .comic-type {
    margin-bottom: 0.75rem;
}

.ranking-info .comic-desc {
    margin-bottom: 1rem;
}

.ranking-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.ranking-stats span {
    color: var(--secondary-color);
    font-weight: 500;
}

.popular-grid h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

/* 响应式设计 - 平板 */
@media (min-width: 768px) {
    .page-header h1 {
        font-size: 2.5rem;
    }

    .category-detail-card {
        grid-template-columns: 300px 1fr;
    }

    .category-detail-card img {
        height: 100%;
    }

    .comics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ranking-item {
        grid-template-columns: auto 200px 1fr;
    }

    .ranking-item img {
        height: 200px;
    }
}

/* 响应式设计 - 桌面 */
@media (min-width: 1024px) {
    .categories-page,
    .latest-comics,
    .popular-comics {
        padding: 4rem 0;
    }

    .category-detail-grid {
        gap: 3rem;
    }

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

    .ranking-item {
        grid-template-columns: auto 250px 1fr;
        padding: 2rem;
    }

    .ranking-item img {
        height: 250px;
    }
}