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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* 头部导航 */
.header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #e63946;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-text {
    font-weight: 700;
}

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

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: #e63946;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 25px;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}

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

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.search-btn img {
    width: 20px;
    height: 20px;
}

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

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s;
}

/* 轮播图区域 */
.carousel-section {
    margin-bottom: 2rem;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    height: 500px;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    height: 100%;
}

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

.carousel-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: #fff;
}

.carousel-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.carousel-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.95;
}

.btn-primary {
    display: inline-block;
    background: #e63946;
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #d62839;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.dot.active {
    background: #fff;
}

/* 分类标签 */
.category-tags {
    margin-bottom: 2rem;
}

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 1.5rem 0;
}

.tag {
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: 1px solid #e0e0e0;
}

.tag:hover,
.tag.active {
    background: #e63946;
    color: #fff;
    border-color: #e63946;
}

/* 章节样式 */
.comic-section,
.update-section,
.ranking-section,
.editor-section {
    margin-bottom: 3rem;
}

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

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.more-link {
    color: #3a86ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.more-link:hover {
    color: #2563eb;
}

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

.comic-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.comic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

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

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

.comic-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.comic-badge.hot {
    background: #e63946;
}

.comic-badge.new {
    background: #3a86ff;
}

.comic-update {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: #fff;
    padding: 0.5rem;
    font-size: 0.75rem;
}

.comic-info {
    padding: 1rem;
}

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

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

.comic-tag {
    color: #666;
    background: #f0f0f0;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
}

.comic-score {
    color: #ff9800;
    font-weight: 600;
}

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

/* 更新列表 */
.update-list {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.update-item {
    display: flex;
    padding: 1.5rem;
    gap: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

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

.update-item:hover {
    background: #f9f9f9;
}

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

.update-info {
    flex: 1;
    min-width: 0;
}

.update-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.update-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tag-item {
    font-size: 0.75rem;
    background: #f0f0f0;
    color: #666;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
}

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

.update-link {
    color: #3a86ff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.update-link:hover {
    text-decoration: underline;
}

.update-time {
    color: #999;
    font-size: 0.85rem;
}

/* 排行榜 */
.ranking-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1.5rem;
    border: none;
    background: #fff;
    color: #666;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #e63946;
    color: #fff;
}

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

.ranking-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ranking-header {
    padding: 1rem;
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

.ranking-header.popularity {
    background: linear-gradient(135deg, #e63946, #d62839);
}

.ranking-header.favorite {
    background: linear-gradient(135deg, #3a86ff, #2563eb);
}

.ranking-header.rating {
    background: linear-gradient(135deg, #9333ea, #7e22ce);
}

.ranking-list {
    padding: 1rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.rank-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e63946;
    min-width: 30px;
}

.ranking-item img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

/* 注册区域 */
.register-section {
    background: linear-gradient(135deg, #e63946, #3a86ff);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    color: #fff;
}

.register-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.register-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.register-text p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.register-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.register-features li {
    font-size: 1rem;
}

.register-form {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    color: #333;
}

.register-form h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #e63946;
}

.btn-register {
    width: 100%;
    padding: 1rem;
    background: #e63946;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-register:hover {
    background: #d62839;
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.form-footer a {
    color: #e63946;
    text-decoration: none;
}

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

/* 编辑推荐 */
.editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.editor-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
}

.editor-card img {
    width: 200px;
    height: 280px;
    object-fit: cover;
    flex-shrink: 0;
}

.editor-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.editor-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.badge.hot {
    background: #e63946;
}

.badge.new {
    background: #3a86ff;
}

.editor-content .category {
    color: #999;
    font-size: 0.85rem;
}

.editor-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.editor-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex: 1;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-footer span {
    color: #999;
    font-size: 0.9rem;
}

.read-link {
    color: #e63946;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.read-link:hover {
    color: #d62839;
    text-decoration: underline;
}

/* 页脚 */
.footer {
    background: #212529;
    color: #fff;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

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

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.footer-col p {
    color: #adb5bd;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

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

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

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: #fff;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    transition: transform 0.3s;
}

.social-links a:hover {
    transform: scale(1.1);
}

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

.qr-code {
    text-align: center;
}

.qr-code img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: #fff;
    padding: 0.5rem;
}

.qr-code p {
    font-size: 0.85rem;
    color: #adb5bd;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #495057;
    color: #adb5bd;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        display: none;
    }

    .nav.active {
        display: flex;
    }

    .search-box {
        display: none;
    }

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

    .carousel-content p {
        font-size: 0.9rem;
    }

    .carousel-container {
        height: 300px;
    }

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

    .tags-wrapper {
        gap: 0.5rem;
    }

    .tag {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

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

    .update-item img {
        width: 100px;
        height: 140px;
    }

    .update-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

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

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

    .register-text h2 {
        font-size: 1.8rem;
    }

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

    .editor-card {
        flex-direction: column;
    }

    .editor-card img {
        width: 100%;
        height: 400px;
    }

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

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

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

    .carousel-container {
        height: 250px;
    }

    .carousel-content {
        padding: 2rem 1rem 1rem;
    }

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

    .carousel-content p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .btn-primary {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

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

    .register-section {
        padding: 2rem 1rem;
    }

    .register-text h2 {
        font-size: 1.5rem;
    }

    .ranking-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
}
