* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden;
    position: relative;
    width: 100%;
    min-height: 100vh;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-x: hidden;
    width: 100%;
}

#hot, #trending, #finished, #ranking {
    scroll-margin-top: 80px;
}

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

.logo {
    display: flex;
    align-items: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
}

.logo img {
    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 8px;
}

.logo p {
    font-size: 24px;
    margin: 0;
}

.search-box {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.8;
}

.banner {
    margin-top: 15px;
    background: linear-gradient(135deg, #fff0f3 0%, #ffe4e8 100%);
    border-radius: 12px;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, #ff9ec4 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
}

.banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.banner-logo {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.banner-content h1 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}

.banner-desc {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
}

.banner-stats {
    display: flex;
    gap: 60px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 13px;
    color: #999;
}

.banner-buttons {
    display: flex;
    gap: 12px;
}

.banner-btn {
    padding: 10px 20px;
    border-radius: 25px;
    background: white;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
}

.banner-btn:hover {
    background: #f8f9fa;
}

.banner-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.banner-btn.primary:hover {
    opacity: 0.9;
}

.carousel {
    display: none;
    margin-top: 15px;
    position: relative;
    height: 280px;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    height: 280px;
    position: relative;
}

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

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.carousel-caption h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.carousel-indicators {
    position: absolute;
    bottom: 15px;
    right: 20px;
    display: flex;
    gap: 8px;
}

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

.carousel-indicator.active {
    background: white;
}

.category-nav {
    background: white;
    padding: 12px 0;
    margin-top: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.category-nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 15px;
    padding: 0 15px;
    margin: 0;
}

.category-nav li {
    padding: 6px 16px;
    border-radius: 20px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.category-nav li:hover {
    background: #667eea;
    color: white;
}

.category-nav li.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.recommend-section {
    margin-top: 30px;
}

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

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.section-header a {
    color: #999;
    font-size: 14px;
    text-decoration: none;
}

.recommend-card {
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    height: 240px;
    position: relative;
}

.recommend-content {
    width: 55%;
    padding: 20px 25px;
    color: white;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.recommend-content h3 {
    font-size: 20px;
    margin: 0;
    font-weight: 600;
    color: #fff;
}

.recommend-content .tags {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.recommend-content .tag {
    padding: 3px 10px;
    border-radius: 4px;
    background: #ccc;
    font-size: 11px;
    color: #444;
}

.recommend-content .divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 0;
}

.recommend-content p {
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
    color: #999;
    margin-top: 5px;
}

.recommend-sub {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.recommend-sub img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.recommend-sub img.active {
    border-color: #4a90d9;
    transform: scale(1.1);
}

.recommend-image {
    width: 45%;
    position: relative;
    height: 100%;
    padding: 15px;
    box-sizing: border-box;
}

.recommend-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.recommend-image .btn-read {
    position: absolute;
    bottom: 25px;
    right: 25px;
    padding: 8px 20px;
    background: rgba(255,255,255,0.9);
    border-radius: 18px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    font-weight: 500;
}

.scroll-section {
    margin-top: 30px;
}

.scroll-container {
    position: relative;
}

.scroll-wrapper {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.comic-list {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 15px;
}

.comic-card {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 180px;
    max-width: 220px;
    width: calc(25% - 12px);
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

.comic-image {
    position: relative;
    overflow: hidden;
}

.comic-image .top-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.comic-image img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.comic-intro {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.6));
    color: white;
    padding: 15px 12px;
    font-size: 12px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 5;
}

.comic-intro p {
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    word-break: break-all;
}

.comic-card:hover .comic-intro {
    opacity: 1;
    transform: translateY(0);
}

.comic-card:hover .comic-tags {
    opacity: 0;
}

.comic-info {
    padding: 10px;
}

h3.comic-title {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.comic-author {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
}

.comic-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.comic-image .comic-tags {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    gap: 5px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
}

.comic-status span {
    font-size: 11px;
    color: #666;
}

.btn-read-card {
    font-size: 11px;
    color: #ff6b6b;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.btn-read-card:hover {
    color: #ff4757;
}

.comic-status .tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
}

.comic-image .top-tag.serialize {
    background: #4a90d9;
    color: #fff;
}

.comic-image .top-tag.hot {
    background: #ff6b6b;
    color: #fff;
}

.comic-image .top-tag.finished {
    background: #4caf50;
    color: #fff;
}

.comic-image .top-tag.new {
    background: #4a90d9;
    color: #fff;
}

.comic-tags .tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(255,255,255,0.3);
    color: #fff;
    backdrop-filter: blur(2px);
}

.comic-status .tag.romance {
    background: #fce7f3;
    color: #ec4899;
}

.comic-status .tag.comedy {
    background: #fef3c7;
    color: #f59e0b;
}

.comic-status .tag.school {
    background: #d1fae5;
    color: #10b981;
}

.comic-status .tag.city {
    background: #dbeafe;
    color: #3b82f6;
}

.comic-status .tag.magic {
    background: #e0e7ff;
    color: #6366f1;
}

.comic-status .tag.action {
    background: #fee2e2;
    color: #ef4444;
}

.comic-status .tag.mystery {
    background: #f0f9ff;
    color: #0ea5e9;
}

.comic-status .tag.sci-fi {
    background: #e0f2fe;
    color: #0284c7;
}

.comic-status .tag.sports {
    background: #dcfce7;
    color: #22c55e;
}

.ranking-section {
    margin-top: 30px;
}

.ranking-list {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 15px;
}

.ranking-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.ranking-tabs a {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.ranking-tabs a.active {
    color: #667eea;
    border-color: #667eea;
}

.ranking-list {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 15px;
}

.ranking-card {
    position: relative;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 180px;
    max-width: 220px;
    width: calc(25% - 12px);
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.ranking-card .rank {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 1;
}

.ranking-card .rank.top2 {
    background: linear-gradient(135deg, #ffd93d 0%, #f4a261 100%);
}

.ranking-card .rank.top3 {
    background: linear-gradient(135deg, #6bcb77 0%, #4d9688 100%);
}

.ranking-card .comic-image {
    position: relative;
    overflow: hidden;
}

.ranking-card img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.ranking-card .comic-intro {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.6));
    color: white;
    padding: 15px 12px;
    font-size: 12px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 5;
}

.ranking-card .comic-intro p {
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    word-break: break-all;
}

.ranking-card:hover .comic-intro {
    opacity: 1;
    transform: translateY(0);
}

.ranking-card:hover .comic-tags {
    opacity: 0;
}

.ranking-card .comic-tags {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    gap: 5px;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.ranking-card .comic-info {
    padding: 10px;
}

.download-section {
    margin-top: 30px;
    background: #667eea;
    border-radius: 10px;
    padding: 25px;
}

.download-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.download-inner h3 {
    color: white;
    font-size: 20px;
    margin: 0;
}

.download-buttons {
    display: flex;
    gap: 15px;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px;
    background: white;
    color: #333;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: opacity 0.3s;
    min-width: 140px;
    width: 140px;
}

.download-btn:hover {
    opacity: 0.9;
}

.download-btn i {
    font-size: 20px;
}

footer {
    margin-top: 40px;
    background: #1a1a2e;
    padding: 20px 0;
    color: #999;
    overflow-x: hidden;
    width: 100%;
}

.footer-bottom {
    text-align: center;
    font-size: 12px;
    color: #666;
}

.back-to-top {
    display: none;
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(74, 144, 217, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 18px;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: none;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    a {
        transition: none !important;
        -webkit-tap-highlight-color: transparent;
    }

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

    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    .search-box {
        display: none;
    }

    .nav-links {
        display: flex;
        gap: 0;
    }

    .nav-links a:not(:last-child) {
        display: none;
    }

    .nav-links a:last-child {
        font-size: 14px;
        padding: 8px 12px;
        background: #4a90d9;
        color: white;
        border-radius: 20px;
    }

    .carousel {
        height: 180px;
    }

    .carousel-item {
        height: 180px;
    }

    .carousel-caption {
        padding: 15px;
    }

    .carousel-caption h3 {
        font-size: 16px;
    }

    .banner {
        padding: 20px 15px;
    }

    .banner-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }

    .banner-content h1 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .banner-desc {
        font-size: 12px;
        margin-bottom: 15px;
        line-height: 1.5;
    }

    .banner-stats {
        gap: 40px;
        margin-bottom: 15px;
    }

    .stat-number {
        font-size: 22px;
    }

    .stat-label {
        font-size: 11px;
    }

    .banner-buttons {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .banner-btn {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 70px;
        white-space: nowrap;
    }

    .recommend-card {
        flex-direction: column;
        height: auto;
        width: 100%;
        box-sizing: border-box;
    }

    .recommend-content {
        width: 100%;
        padding: 15px;
        box-sizing: border-box;
    }

    .recommend-image {
        width: 100%;
        height: 200px;
        padding: 0 15px 15px;
    }

    .category-nav ul {
        gap: 10px;
    }

    .category-nav li {
        padding: 5px 12px;
        font-size: 13px;
    }

    .comic-card,
    .ranking-card {
        min-width: calc(33.33% - 10px);
        max-width: calc(33.33% - 10px);
        width: calc(33.33% - 10px);
        flex: none;
        -webkit-box-flex: 0;
        -ms-flex: none;
    }

    .comic-card img,
    .ranking-card img {
        height: 200px;
    }

    .footer-content {
        flex-direction: column;
        gap: 30px;
    }

    .footer-links {
        gap: 30px;
    }

    .download-section {
        padding: 15px;
        margin: 15px 0;
        border-radius: 8px;
    }

    .download-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
    }
}

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

    .logo h1 {
        display: inline;
        font-size: 26px;
        margin: 0;
    }

    .carousel-caption h3 {
        font-size: 14px;
    }

    .recommend-main h3 {
        font-size: 18px;
    }

    .comic-card,
    .ranking-card {
        min-width: calc(50% - 8px);
        max-width: calc(50% - 8px);
        width: calc(50% - 8px);
        flex: none;
        -webkit-box-flex: 0;
        -ms-flex: none;
    }

    .comic-card img,
    .ranking-card img {
        height: 180px;
    }
}