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

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul, li {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 主题颜色 */
:root {
    --primary: #7B2CBF;
    --primary-light: #9D4EDD;
    --primary-dark: #5A189A;
    --secondary: #F72585;
    --secondary-light: #FF5CA8;
    --secondary-dark: #D61A75;
    --accent: #FFCA28;
    --accent-light: #FFD54F;
    --accent-dark: #FFC107;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #FFFFFF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-dark: #242424;
}

/* 排版样式 */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 16px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 16px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

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

.primary-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.secondary-btn {
    background-color: var(--bg-primary);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.secondary-btn:hover {
    background-color: var(--primary-light);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.read-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.read-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 头部导航 */
header {
    background-color: var(--bg-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 0;
}

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

.logo {
    display: flex;
    flex-direction: column;
}

.logo h1 {
    color: var(--primary);
    font-size: 1.8rem;
    margin: 0;
}

.slogan {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

nav ul {
    display: flex;
    gap: 24px;
}

nav a {
    font-weight: 600;
    position: relative;
    padding: 8px 0;
}

nav a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

nav a:hover:after,
nav a.active:after {
    width: 100%;
}

.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px 0 0 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

.search-box button {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background: var(--primary-dark);
}

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

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* 英雄区块 */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: var(--text-light);
}

.hero .container {
    display: flex;
    align-items: center;
    gap: 48px;
}

.hero-content {
    flex: 1;
}

.hero-content h2 {
    font-size: 2.8rem;
    margin-bottom: 24px;
    color: var(--text-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.hero-content .btn {
    margin-right: 16px;
    margin-bottom: 16px;
}

.hero-image {
    flex: 1;
    position: relative;
    max-width: 500px;
}

.hero-image img {
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: rotate(2deg);
}

/* 特性部分 */
.features {
    padding: 80px 0;
    background-color: var(--bg-primary);
}

.features .container {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.feature-item {
    flex: 1;
    text-align: center;
    padding: 32px 24px;
    background-color: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-item h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.feature-item p {
    color: var(--text-secondary);
}

/* 漫画网格 */
.popular-section {
    padding: 80px 0;
    background-color: var(--bg-secondary);
}

.comics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.comic-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.comic-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.comic-cover {
    position: relative;
    height: 300px;
    overflow: hidden;
}

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

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

.comic-tag {
    position: absolute;
    top: 16px;
    right: 0;
    background-color: var(--secondary);
    color: white;
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 4px 0 0 4px;
    font-weight: 600;
}

.comic-card h3 {
    padding: 16px 16px 8px;
    font-size: 1.2rem;
}

.comic-card p {
    padding: 0 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.comic-card .read-btn {
    margin: 0 16px 16px;
    display: block;
    text-align: center;
}

/* 分类部分 */
.categories {
    padding: 80px 0;
    background-color: var(--bg-primary);
}

.category-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.category-item:hover {
    background-color: var(--primary);
    color: var(--text-light);
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* 更新列表 */
.updates {
    padding: 80px 0;
    background-color: var(--bg-secondary);
}

.updates-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.update-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 16px;
    gap: 16px;
}

.update-cover {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
}

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

.update-info {
    flex: 1;
}

.update-info h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.update-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

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

/* 排行榜部分 */
.ranking {
    padding: 80px 0;
    background-color: var(--bg-primary);
}

.ranking-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.tab-btn {
    padding: 8px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}

.ranking-list {
    display: none;
}

.ranking-list.active {
    display: block;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: var(--bg-secondary);
    margin-bottom: 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

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

.ranking-item:nth-child(1) .rank {
    color: #FFD700;
}

.ranking-item:nth-child(2) .rank {
    color: #C0C0C0;
}

.ranking-item:nth-child(3) .rank {
    color: #CD7F32;
}

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

.ranking-info {
    margin-left: 16px;
    flex: 1;
}

.ranking-info h3 {
    margin-bottom: 4px;
    font-size: 1.1rem;
}

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

.ranking-stats {
    font-weight: 600;
    color: var(--primary);
}

/* APP下载部分 */
.app-download {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
    color: var(--text-light);
}

.app-download .container {
    display: flex;
    align-items: center;
    gap: 48px;
}

.app-content {
    flex: 1;
}

.app-content h2 {
    color: var(--text-light);
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.qr-code {
    width: 150px;
    height: 150px;
    background-color: white;
    margin: 24px 0;
    border-radius: 8px;
    position: relative;
}

.qr-code:after {
    content: "扫码下载";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1rem;
    color: var(--text-primary);
}

.download-btns {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.download-btn {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 24px;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.download-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-4px);
}

.app-image {
    flex: 1;
    max-width: 300px;
}

.app-image img {
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* 弹窗入口部分 */
.popup-entrance {
    padding: 60px 0;
    background-color: var(--bg-secondary);
    text-align: center;
}

.entrance-description {
    max-width: 800px;
    margin: 0 auto 32px;
    font-size: 1.1rem;
}

.entrance-btn {
    display: inline-block;
    padding: 16px 32px;
    background-color: var(--secondary);
    color: var(--text-light);
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.entrance-btn:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(247, 37, 133, 0.3);
    animation: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(247, 37, 133, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(247, 37, 133, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(247, 37, 133, 0);
    }
}

/* 页脚部分 */
footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 60px 0 20px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 32px;
}

.footer-logo h2 {
    color: var(--text-light);
    margin-bottom: 8px;
}

.footer-nav {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-nav-col h3 {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.footer-nav-col ul li {
    margin-bottom: 8px;
}

.footer-nav-col a {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.footer-nav-col a:hover {
    color: var(--text-light);
}

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

.footer-bottom p {
    margin-bottom: 8px;
}

.keyword-link {
    color: var(--text-light);
    font-weight: 600;
}

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

/* 弹窗样式 */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background-color: var(--bg-primary);
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease forwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-header {
    background-color: var(--primary);
    color: var(--text-light);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    color: var(--text-light);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    transform: rotate(90deg);
}

.popup-body {
    padding: 24px;
    text-align: center;
}

.popup-body p {
    margin-bottom: 16px;
}

.popup-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.popup-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.popup-btn.primary {
    background-color: var(--primary);
    color: var(--text-light);
}

.popup-btn.secondary {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.popup-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 响应式样式 */
@media (max-width: 992px) {
    .hero .container,
    .app-download .container {
        flex-direction: column;
        text-align: center;
    }

    .hero-content,
    .app-content {
        order: 1;
    }

    .hero-image,
    .app-image {
        order: 0;
        margin-bottom: 32px;
    }

    .features .container {
        flex-wrap: wrap;
    }

    .feature-item {
        flex: 0 0 calc(50% - 12px);
    }

    .footer-top {
        flex-direction: column;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .comics-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .feature-item {
        flex: 0 0 100%;
    }

    header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo {
        margin-bottom: 16px;
    }

    nav {
        width: 100%;
        margin: 16px 0;
        display: none;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 8px;
    }

    .menu-toggle {
        display: flex;
        position: absolute;
        top: 20px;
        right: 16px;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        flex: 1;
    }

    .footer-nav {
        flex-direction: column;
        gap: 24px;
    }
}

@media (max-width: 576px) {
    .hero-content h2 {
        font-size: 2rem;
    }

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

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

    .ranking-item .rank {
        width: 30px;
        font-size: 1.2rem;
    }

    .ranking-info {
        width: calc(100% - 106px);
    }

    .ranking-stats {
        margin-left: auto;
    }

    .update-item {
        flex-wrap: wrap;
    }

    .update-info {
        width: calc(100% - 116px);
    }

    .update-item .read-btn {
        margin-top: 8px;
        width: 100%;
    }

    .popup-content {
        width: 95%;
    }
}