/* 移动优先的响应式设计 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --bg-color: #ffffff;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --card-bg: #f9fafb;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --bg-color: #111827;
    --text-color: #f9fafb;
    --text-light: #9ca3af;
    --border-color: #374151;
    --card-bg: #1f2937;
}

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

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

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

.logo {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.nav-list {
    display: none;
    list-style: none;
    gap: 24px;
    flex-wrap: wrap;
}

.nav.active .nav-list {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 16px;
    box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
    .nav.active .nav-list {
        position: static;
        flex-direction: row;
        background: transparent;
        padding: 0;
        box-shadow: none;
    }
}

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

.nav-list a:hover,
.nav-list a.active {
    opacity: 0.8;
    text-decoration: underline;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-btn,
.theme-toggle,
.menu-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s;
}

.search-btn:hover,
.theme-toggle:hover,
.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Search Overlay */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.search-overlay.active {
    display: flex;
}

.search-container {
    position: relative;
    width: 90%;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: 16px 48px 16px 16px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    outline: none;
}

.search-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-color);
    cursor: pointer;
    line-height: 1;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.hero-title {
    font-size: 28px;
    margin-bottom: 16px;
    font-weight: bold;
}

.hero-subtitle {
    font-size: 16px;
    margin-bottom: 32px;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sections */
section {
    padding: 48px 0;
}

.section-title {
    font-size: 24px;
    margin-bottom: 32px;
    text-align: center;
    font-weight: bold;
}

/* Comic Grid */
.comic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

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

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

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

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

.comic-info {
    padding: 12px;
}

.comic-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comic-meta {
    font-size: 12px;
    color: var(--text-light);
}

/* Categories */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.category-item {
    background: var(--card-bg);
    padding: 24px 16px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

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

.category-icon {
    font-size: 32px;
}

.category-name {
    font-weight: 600;
    font-size: 14px;
}

/* Update List */
.update-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.update-item:hover {
    transform: translateX(4px);
}

.update-item a {
    display: flex;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    padding: 16px;
}

.update-cover {
    width: 80px;
    height: 106px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.update-info {
    flex: 1;
}

.update-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

.update-chapter {
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.update-time {
    font-size: 12px;
    color: var(--text-light);
}

/* SEO Links */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.seo-link-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: block;
}

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

.seo-link-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-weight: 600;
}

.seo-link-card p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

/* Content Pages */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 16px;
}

.content-page h1 {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--primary-color);
}

.content-page h2 {
    font-size: 22px;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--text-color);
}

.content-page h3 {
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text-color);
}

.content-page p {
    margin-bottom: 16px;
    line-height: 1.8;
    color: var(--text-color);
}

.content-page ul,
.content-page ol {
    margin: 16px 0;
    padding-left: 24px;
}

.content-page li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.content-page img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
    box-shadow: var(--shadow);
}

.content-page .highlight-box {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin: 24px 0;
}

.content-page .download-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
}

.content-page .download-link {
    background: var(--primary-color);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    transition: background 0.3s;
}

.content-page .download-link:hover {
    background: var(--secondary-color);
}

/* Footer */
.footer {
    background: var(--card-bg);
    padding: 48px 0 24px;
    margin-top: 64px;
    border-top: 1px solid var(--border-color);
}

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

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

.footer-section p {
    color: var(--text-light);
    line-height: 1.8;
}

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

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 14px;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .nav-list {
        display: flex;
    }

    .menu-toggle {
        display: none;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .section-title {
        font-size: 32px;
    }

    .comic-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .comic-cover {
        height: 240px;
    }

    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .update-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .update-item {
        flex: 1 1 calc(50% - 8px);
    }

    .content-page {
        padding: 48px 32px;
    }

    .content-page h1 {
        font-size: 36px;
    }
}

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

    .comic-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .comic-cover {
        height: 280px;
    }

    .link-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Lazy Loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}
