/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --bg-color: #ffffff;
    --text-color: #333333;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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(--bg-color);
}

.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-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.logo h1 a {
    color: white;
    text-decoration: none;
}

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

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.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;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

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

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

.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-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 2rem;
}

.hero-content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero-content p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

/* 按钮样式 */
.btn-primary,
.btn-secondary,
.btn-download {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-download:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

/* 分类导航 */
.categories-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-align: center;
}

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

.category-card {
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    background: var(--light-bg);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

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

.category-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.category-card h3 {
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* 漫画卡片网格 */
.comics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

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

.comic-card a {
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

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

.comic-info {
    padding: 1rem;
}

.comic-info h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comic-desc {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comic-tag {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* 最新更新列表 */
.updates-section {
    margin-bottom: 3rem;
}

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

.update-item {
    display: flex;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.update-item:hover {
    box-shadow: var(--shadow-hover);
}

.update-item img {
    width: 80px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
}

.update-info {
    flex: 1;
}

.update-info h3 {
    margin-bottom: 0.5rem;
}

.update-info h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.update-info h3 a:hover {
    color: var(--primary-color);
}

.update-info p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.update-tag {
    display: inline-block;
    background: var(--light-bg);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* 智能推荐 */
.recommend-section {
    background: var(--light-bg);
    padding: 2rem 0;
    margin-bottom: 3rem;
    border-radius: 12px;
}

.recommend-content {
    text-align: center;
}

.recommend-content p {
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.8;
}

/* SEO内容区 */
.seo-content {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--light-bg);
    border-radius: 12px;
}

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

.seo-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #666;
}

/* 下载页面样式 */
.download-hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-bottom: 3rem;
}

.download-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.download-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.download-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s;
}

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

.download-icon img {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
}

.download-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.download-card .features {
    margin: 0.5rem 0;
    color: #666;
}

.download-tip {
    font-size: 0.85rem;
    color: #999;
    margin-top: 1rem;
}

.download-info {
    margin-bottom: 3rem;
}

.download-info h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.info-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.download-steps {
    margin-bottom: 3rem;
}

.download-steps h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-item {
    display: flex;
    gap: 1.5rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

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

.step-content h3 {
    margin-bottom: 0.5rem;
}

/* 阅读器页面样式 */
.reader-page {
    background: #1a1a1a;
    color: white;
}

.reader-header {
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.back-btn {
    color: white;
    text-decoration: none;
    font-size: 1rem;
}

.comic-title {
    font-size: 1.2rem;
    flex: 1;
    text-align: center;
}

.reader-controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.reader-main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.reader-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    gap: 1rem;
}

.reader-sidebar {
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.page-nav {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.page-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.reader-content {
    flex: 1;
    text-align: center;
}

.reader-image-container {
    position: relative;
    margin-bottom: 1rem;
}

.reader-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: opacity 0.3s;
}

.loading-indicator,
.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
}

.reader-info {
    margin-top: 1rem;
}

.reader-progress {
    margin-top: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.reader-settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 2rem;
    border-radius: 12px;
    z-index: 2000;
    min-width: 300px;
}

.reader-settings-panel h3 {
    margin-bottom: 1rem;
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
}

.setting-item select {
    width: 100%;
    padding: 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.close-settings {
    margin-top: 1rem;
    width: 100%;
}

.reader-footer {
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem 0;
}

.reader-footer-content {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.reader-footer-content a {
    color: white;
    text-decoration: none;
}

.reader-footer-content a:hover {
    text-decoration: underline;
}

.loading-tutorial {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-content {
    background: white;
    color: var(--text-color);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.tutorial-content h3 {
    margin-bottom: 1rem;
}

.tutorial-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.tutorial-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.close-tutorial {
    margin-top: 1rem;
    width: 100%;
}

/* 夜间模式 */
.night-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

.night-mode .reader-image-container {
    background: #2a2a2a;
}

/* 搜索页面样式 */
.search-section {
    margin-bottom: 3rem;
}

.search-section h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto 2rem;
    gap: 1rem;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.search-btn:hover {
    background: var(--secondary-color);
}

.search-filters {
    margin-bottom: 2rem;
}

.search-filters h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

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

.filter-tag {
    padding: 0.5rem 1rem;
    background: var(--light-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s;
}

.filter-tag:hover {
    background: var(--primary-color);
    color: white;
}

.results-header {
    margin-bottom: 2rem;
}

.results-header h2 {
    margin-bottom: 0.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: var(--secondary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 关于我们和FAQ页面 */
.about-hero,
.faq-hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-bottom: 3rem;
}

.about-hero h1,
.faq-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.about-content,
.faq-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-section,
.faq-section {
    margin-bottom: 3rem;
}

.about-section h2,
.faq-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

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

.feature-item {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.feature-item img {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.contact-list {
    list-style: none;
    margin-left: 1.5rem;
}

.contact-list li {
    margin-bottom: 0.5rem;
}

.contact-list a {
    color: var(--primary-color);
    text-decoration: none;
}

.faq-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.faq-category-btn {
    padding: 0.8rem 1.5rem;
    background: var(--light-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s;
}

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

.faq-item {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.faq-answer {
    color: #666;
    line-height: 1.8;
}

.faq-answer ol,
.faq-answer ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
}

/* 页脚样式 */
.footer {
    background: #2a2a2a;
    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 h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

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

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

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--secondary-color);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-list.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero-content h2 {
        font-size: 1.5rem;
    }

    .comics-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

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

    .download-cards {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .reader-container {
        flex-direction: column;
    }

    .reader-sidebar {
        display: none;
    }

    .search-box {
        flex-direction: column;
    }

    .search-input,
    .search-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.4rem;
    }

    .tagline {
        font-size: 0.8rem;
    }

    .hero-content {
        padding: 1rem;
    }

    .hero-content h2 {
        font-size: 1.2rem;
    }

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

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

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

/* 图片懒加载优化 */
img {
    max-width: 100%;
    height: auto;
}

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

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