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

:root {
    --primary-color: #e91e63;
    --secondary-color: #9c27b0;
    --accent-color: #ff4081;
    --bg-dark: #0f0f1e;
    --bg-card: #1a1a2e;
    --bg-hover: #252547;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --border-color: #2d2d44;
    --gradient-1: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
    --gradient-2: linear-gradient(135deg, #ff4081 0%, #e91e63 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* 顶部导航栏 */
.header {
    background: var(--bg-card);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-1);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all 0.3s;
}

/* 轮播横幅 */
.hero-section {
    position: relative;
    height: 500px;
    overflow: hidden;
    margin-bottom: 40px;
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-slide.active {
    opacity: 1;
}

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

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(15, 15, 30, 0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 1;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-hero {
    display: inline-block;
    padding: 15px 40px;
    background: var(--gradient-1);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.4);
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.6);
}

/* 分类导航 */
.category-section {
    padding: 50px 0;
    background: var(--bg-card);
}

.section-title {
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.category-item {
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s;
}

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

.category-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.category-item:hover img {
    border-color: var(--primary-color);
}

.category-item span {
    display: block;
    font-size: 14px;
    font-weight: 500;
}

/* 漫画卡片网格 */
.comic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

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

.comic-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(233, 30, 99, 0.3);
    border-color: var(--primary-color);
}

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

.comic-cover {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

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

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

.comic-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    background: var(--gradient-1);
    color: white;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.comic-info {
    padding: 15px;
}

.comic-title {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comic-author {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

.comic-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

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

.comic-status {
    padding: 3px 10px;
    background: var(--bg-hover);
    border-radius: 10px;
    color: var(--primary-color);
}

/* 最新更新列表 */
.latest-section {
    padding: 50px 0;
}

.update-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.update-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.update-link {
    display: flex;
    gap: 20px;
    text-decoration: none;
    color: var(--text-primary);
    padding: 15px;
}

.update-link img {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.update-content {
    flex: 1;
}

.update-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.update-info {
    font-size: 13px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.update-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 排行榜 */
.ranking-section {
    padding: 50px 0;
    background: var(--bg-card);
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

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

.rank-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #000;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a85c 100%);
    color: #000;
}

.ranking-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-primary);
    flex: 1;
}

.ranking-link img {
    width: 80px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.ranking-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

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

/* 特色区块 */
.featured-section,
.daily-section,
.recommend-section {
    padding: 50px 0;
}

/* 页脚 */
.footer {
    background: var(--bg-card);
    padding: 50px 0 20px;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

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

.footer-column h3,
.footer-column h4 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

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

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

.footer-column ul li {
    margin-bottom: 10px;
}

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

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

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

/* 内页样式 */
.page-header {
    background: var(--gradient-1);
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 15px;
    color: white;
}

.page-header p {
    font-size: 18px;
    opacity: 0.9;
    color: white;
}

.content-section {
    padding: 40px 0;
}

.content-section h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.content-section p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 15px;
}

/* 阅读页样式 */
.reader-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

.reader-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 12px;
    flex-wrap: wrap;
    gap: 15px;
}

.reader-controls button {
    padding: 10px 20px;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.3s;
}

.reader-controls button:hover {
    transform: scale(1.05);
}

.reader-image {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.reader-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 搜索页样式 */
.search-box {
    max-width: 700px;
    margin: 30px auto;
    display: flex;
    gap: 15px;
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.search-box button {
    padding: 15px 40px;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.3s;
}

.search-box button:hover {
    transform: scale(1.05);
}

.filter-section {
    margin: 30px 0;
    padding: 25px;
    background: var(--bg-card);
    border-radius: 12px;
}

.filter-section h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        transition: left 0.3s;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    }

    .main-nav.active {
        left: 0;
    }

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

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .hero-section {
        height: 350px;
    }

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

    .category-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .update-link {
        flex-direction: column;
    }

    .update-link img {
        width: 100%;
        height: 200px;
    }

    .ranking-item {
        flex-direction: column;
        text-align: center;
    }

    .ranking-link {
        flex-direction: column;
    }

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

    .page-header h1 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .comic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

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

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

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(233, 30, 99, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 夜间模式 */
body.dark-mode {
    --bg-dark: #000000;
    --bg-card: #0a0a0a;
    --bg-hover: #1a1a1a;
}
