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

:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-color: #ffffff;
    --text-secondary: #b8b8b8;
    --border-color: #2d2d44;
    --hover-color: #ff8fab;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* 导航栏 */
.navbar {
    background-color: var(--card-bg);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

.nav-brand a {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s;
}

/* 轮播横幅 */
.hero-banner {
    margin-bottom: 3rem;
}

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

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

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

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

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

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

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

/* 分类导航 */
.categories {
    padding: 3rem 0;
    background-color: var(--card-bg);
}

.categories h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

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

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

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

.category-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.category-item span {
    display: block;
    font-size: 1rem;
}

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

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

.comic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.3);
}

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

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

.comic-info {
    padding: 1rem;
}

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

.comic-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comic-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: var(--primary-color);
    border-radius: 15px;
    font-size: 0.8rem;
}

/* 章节列表 */
.featured, .recommendations {
    padding: 3rem 0;
}

.featured h2, .recommendations h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* 最新更新 */
.latest-updates {
    padding: 3rem 0;
    background-color: var(--card-bg);
}

.latest-updates h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

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

.update-item {
    display: flex;
    gap: 1rem;
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 10px;
    transition: background-color 0.3s;
}

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

.update-item img {
    width: 100px;
    height: 130px;
    object-fit: cover;
    border-radius: 5px;
}

.update-info {
    flex: 1;
}

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

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

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

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

/* 热搜排行 */
.trending {
    padding: 3rem 0;
}

.trending h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.trending-list {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-item:hover {
    background-color: var(--bg-color);
    border-radius: 5px;
}

.rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 30px;
}

.trending-item a {
    flex: 1;
    color: var(--text-color);
    text-decoration: none;
}

.trending-item a:hover {
    color: var(--primary-color);
}

.trend-badge {
    padding: 0.2rem 0.6rem;
    background-color: #ff4444;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* 页脚 */
.footer {
    background-color: var(--card-bg);
    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, .footer-section h4 {
    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: var(--text-secondary);
    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 var(--border-color);
    color: var(--text-secondary);
}

/* 内页样式 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.content-section {
    padding: 2rem 0;
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

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

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

.reader-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: 10px;
}

.reader-controls button {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.reader-controls button:hover {
    background-color: var(--hover-color);
}

.reader-image {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 5px;
}

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

/* 搜索页样式 */
.search-box {
    max-width: 600px;
    margin: 2rem auto;
    display: flex;
    gap: 1rem;
}

.search-box input {
    flex: 1;
    padding: 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    font-size: 1rem;
}

.search-box button {
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.filter-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-radius: 10px;
}

.filter-section h3 {
    margin-bottom: 1rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--card-bg);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

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

    .nav-toggle {
        display: flex;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

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

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

    .hero-slider {
        height: 250px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

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

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

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

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

/* 夜间模式切换 */
body.dark-mode {
    --bg-color: #0a0a0a;
    --card-bg: #1a1a1a;
    --border-color: #2a2a2a;
}

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

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