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

:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --accent-color: #f8b500;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
}

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

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

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 2rem;
}

.logo a {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    gap: 2rem;
    flex: 1;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

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

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    width: 200px;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    padding: 0;
}

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

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--text-dark);
    transition: var(--transition);
}

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

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

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

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

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

.banner-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.banner-desc {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.banner-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: white;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

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

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

/* 通用区块样式 */
section {
    padding: 3rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.section-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.section-more:hover {
    color: var(--secondary-color);
}

/* 热门推荐 */
.featured-section {
    background-color: var(--bg-light);
}

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

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

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

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

.comic-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.comic-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.comic-badge.hot {
    background: var(--accent-color);
}

.comic-info {
    padding: 1rem;
}

.comic-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comic-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.comic-tag {
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.comic-update {
    color: var(--text-light);
}

/* 最新更新 */
.latest-section {
    background-color: var(--bg-white);
}

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

.update-item {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.update-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.update-link {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    padding: 1rem;
}

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

.update-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.update-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.update-desc {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.update-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.update-chapter {
    color: var(--primary-color);
    font-weight: 500;
}

.update-time {
    color: var(--text-light);
}

/* 排行榜 */
.ranking-section {
    background-color: var(--bg-light);
}

.ranking-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tab-btn {
    padding: 0.75rem 2rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dark);
    transition: var(--transition);
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.ranking-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.ranking-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 40px;
    text-align: center;
}

.ranking-link {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.ranking-cover {
    width: 100px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
}

.ranking-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ranking-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.ranking-desc {
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

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

.stat-item {
    color: var(--text-light);
}

/* 分类浏览 */
.category-section {
    background-color: var(--bg-white);
}

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

.category-card {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
}

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

.category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 1.5rem 1rem 1rem;
    color: white;
}

.category-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.category-count {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 页脚 */
.main-footer {
    background-color: var(--text-dark);
    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-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-heading {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-text {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
}

.copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 1000;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.back-to-top.visible {
    display: flex;
}

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

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

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

    .search-form {
        display: none;
    }

    .banner-section {
        height: 300px;
    }

    .banner-title {
        font-size: 1.5rem;
    }

    .banner-desc {
        font-size: 0.9rem;
    }

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

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

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

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

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

    .ranking-link {
        flex-direction: column;
        align-items: center;
    }

    .ranking-cover {
        width: 80px;
        height: 110px;
    }

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

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

@media (max-width: 480px) {
    .banner-section {
        height: 250px;
    }

    .banner-title {
        font-size: 1.25rem;
    }

    .banner-desc {
        font-size: 0.85rem;
    }

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

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

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