:root {
    --ink: #242133;
    --muted: #756f86;
    --purple: #6d43c5;
    --lavender: #f2edff;
    --orange: #ff8b4c;
    --line: #e9e4f1;
    --surface: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: #fcfbff;
    font-family: "Microsoft YaHei", sans-serif;
    line-height: 1.65;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    width: 100%;
    max-width: 100%;
    object-fit: cover;
}

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
}

.header-inner {
    display: flex;
    min-height: 76px;
    align-items: center;
    gap: 26px;
}

.brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    color: var(--purple);
    font-size: 21px;
    font-weight: 800;
}

.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px 12px 16px 16px;
    color: #fff;
    background: linear-gradient(145deg, #8a5ae5, #512391);
}

.main-nav {
    display: flex;
    flex: 1;
    justify-content: flex-end;
    gap: 4px;
}

.nav-link {
    padding: 8px 9px;
    border-radius: 9px;
    color: #514c61;
    font-size: 13px;
    white-space: nowrap;
}

.nav-link span {
    margin-right: 4px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--purple);
    background: var(--lavender);
    font-weight: 700;
}

.menu-toggle {
    display: none;
    border: 0;
    background: transparent;
    font-size: 22px;
}

.hero {
    margin-top: 38px;
    padding: 56px;
    overflow: hidden;
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(135deg, #4d2289, #8759dc 62%, #ff9d64);
}

.hero h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 58px);
}

.hero h1 a {
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.35);
}

.hero p {
    max-width: 650px;
    font-size: 18px;
}

.hero-actions,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.button {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 10px;
    color: var(--purple);
    background: #fff;
    font-weight: 700;
}

.button.secondary {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.section {
    margin-top: 64px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.section-heading h2 {
    margin: 0;
    font-size: 28px;
}

.section-heading p,
.muted {
    margin: 3px 0 0;
    color: var(--muted);
}

.text-link {
    color: var(--purple);
    font-weight: 700;
}

.comic-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

.comic-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    transition: transform 0.2s;
}

.comic-card:hover {
    transform: translateY(-4px);
}

.comic-card img {
    aspect-ratio: 3 / 4;
}

.card-body {
    padding: 13px;
}

.card-body h3 {
    margin: 6px 0 2px;
    font-size: 16px;
}

.card-body p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.tag {
    color: var(--purple);
    font-size: 12px;
    font-weight: 700;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.category-card,
.panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.category-card span {
    font-size: 28px;
}

.category-card h3 {
    margin: 8px 0 5px;
}

.category-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.split-grid,
.about-grid,
.download-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.ranking-list {
    display: grid;
    gap: 8px;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 12px;
    background: var(--lavender);
}

.rank-no {
    color: var(--orange);
    font-size: 22px;
    font-weight: 800;
}

.feature-story {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 20px;
}

.feature-story img {
    aspect-ratio: 3 / 4;
    border-radius: 14px;
}

.notice {
    padding: 18px 22px;
    border-left: 5px solid var(--orange);
    border-radius: 0 14px 14px 0;
    background: #fff4ed;
}

.topic-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.topic-card {
    padding: 24px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #6d43c5, #a980ed);
}

.topic-card:nth-child(2) {
    background: linear-gradient(135deg, #f07157, #ffb061);
}

.topic-card:nth-child(3) {
    background: linear-gradient(135deg, #277d88, #65bbb2);
}

.download {
    padding: 34px;
    border-radius: 24px;
    color: #fff;
    background: #2d1a4b;
}

.qr {
    display: grid;
    width: 150px;
    min-height: 150px;
    place-items: center;
    border-radius: 14px;
    color: var(--purple);
    background: repeating-linear-gradient(45deg, #fff 0 7px, #ece5ff 7px 14px);
    font-weight: 800;
}

.breadcrumb {
    margin-top: 34px;
    color: var(--muted);
    font-size: 14px;
}

.page-title {
    margin: 20px 0 8px;
    font-size: 36px;
}

.page-intro {
    max-width: 800px;
    color: var(--muted);
}

.reader {
    max-width: 790px;
    margin: 40px auto 0;
}

.reader-meta {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.reader-image {
    margin-top: 24px;
    overflow: hidden;
    border-radius: 14px;
}

.reader-image img {
    aspect-ratio: 4 / 3;
}

.chapter-end {
    margin-top: 24px;
    padding: 18px;
    border-radius: 14px;
    text-align: center;
    background: var(--lavender);
}

.site-footer {
    margin-top: 70px;
    padding-top: 38px;
    color: #dfd7ef;
    background: #211635;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
}

.footer-grid p {
    color: #a99dbd;
}

.footer-grid a {
    display: block;
    margin: 5px 0;
}

.copyright {
    margin-top: 22px;
    padding: 18px;
    border-top: 1px solid #423357;
    text-align: center;
    color: #a99dbd;
    font-size: 13px;
}

@media (max-width: 900px) {
    .menu-toggle {
        display: block;
        margin-left: auto;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 76px;
        right: 16px;
        left: 16px;
        flex-wrap: wrap;
        justify-content: flex-start;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
    }
    .main-nav.open {
        display: flex;
    }
    .comic-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 24px, 1200px);
    }
    .hero {
        margin-top: 24px;
        padding: 32px 24px;
    }
    .section {
        margin-top: 48px;
    }
    .comic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .split-grid,
    .about-grid,
    .download-box,
    .topic-row {
        grid-template-columns: 1fr;
    }
    .feature-story {
        grid-template-columns: 110px 1fr;
    }
    .category-grid {
        gap: 12px;
    }
    .category-card,
    .panel {
        padding: 16px;
    }
    .footer-grid {
        display: grid;
        gap: 16px;
    }
}
