
:root {
    --color-primary: #ff165d;
    --color-accent: #ff9a00;
    --color-bg-light: #f6f7d7;
    --color-info: #3ec1d3;
    --color-white: #ffffff;
    --color-dark: #1a1a2e;
    --color-gray: #555;
    --color-light-gray: #e8e8e8;
    --color-text: #333;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: 0.25s cubic-bezier(0.2, 0.0, 0, 1);
    --sidebar-width: 350px;
    --max-width: 1400px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 85px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    background-color: #fafaf5;
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-nav {
    width: 100%;
    background: var(--color-white);
    border-bottom: 3px solid var(--color-primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(6px);
}

.top-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 68px;
    gap: 18px;
}

.nav-brand h1 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 2px;
    white-space: nowrap;
    margin: 0;
    cursor: pointer;
    transition: var(--transition);
}
.nav-brand h1:hover {
    color: #d01048;
    transform: scale(1.04);
}
.nav-brand h1 span {
    color: var(--color-accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    list-style: none;
}
.nav-links a {
    display: inline-block;
    padding: 8px 15px;
    text-decoration: none;
    color: var(--color-dark);
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 22px;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.nav-links a:hover,
.nav-links a:focus {
    background: #fff0f4;
    color: var(--color-primary);
}
.nav-links a.nav-hot {
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(255, 22, 93, 0.25);
}
.nav-links a.nav-hot:hover {
    background: #d01048;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 26px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(255, 154, 0, 0.3);
}
.btn-login:hover {
    background: #e68a00;
    box-shadow: 0 8px 22px rgba(255, 154, 0, 0.45);
    transform: translateY(-2px);
}
.btn-login-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.main-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    gap: 28px;
    padding: 28px 24px;
    flex: 1;
}

.content-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 38px;
}

.sidebar-right {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 94px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 4px;
}
.sidebar-right::-webkit-scrollbar {
    width: 5px;
}
.sidebar-right::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 5px;
}
.sidebar-right::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 5px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--color-primary);
    position: relative;
}
.section-title h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-dark);
    letter-spacing: 1px;
    white-space: nowrap;
}
.section-title .title-badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 16px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    white-space: nowrap;
}
.section-title .title-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--color-light-gray), transparent);
    border-radius: 2px;
}
.section-title a {
    font-size: 0.85rem;
    color: var(--color-info);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
}
.section-title a:hover {
    color: #2a9daf;
}

.comic-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}
.comic-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
}
.comic-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
    border-color: rgba(255, 22, 93, 0.2);
}
.comic-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: #f0f0f0;
}
.comic-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.comic-card:hover .comic-card-img {
    transform: scale(1.06);
}
.comic-hot-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 22, 93, 0.9);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(255, 22, 93, 0.5);
    backdrop-filter: blur(2px);
}
.comic-card-body {
    padding: 14px 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.comic-card-body h3 {
    font-size: 1rem;
    font-weight: 750;
    color: var(--color-dark);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
    letter-spacing: 0.4px;
}
.comic-meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
    font-size: 0.7rem;
    color: #777;
    line-height: 1.6;
}
.comic-meta-line span {
    white-space: nowrap;
}
.comic-meta-line .meta-separator {
    color: #ccc;
    margin: 0 2px;
    font-weight: 400;
}
.comic-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.comic-card-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #fff3e0;
    color: var(--color-accent);
    border-radius: 14px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 154, 0, 0.15);
}
.comic-card-type-tag {
    background: #e8f7f9;
    color: var(--color-info);
    border-color: rgba(62, 193, 211, 0.15);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.featured-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    border: 2px solid transparent;
    position: relative;
}
.featured-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.featured-card-img {
    width: 130px;
    height: 180px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}
.featured-card-info {
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    flex: 1;
}
.featured-card-info h3 {
    font-size: 1.05rem;
    font-weight: 750;
    color: var(--color-dark);
}
.featured-card-info .feat-meta {
    font-size: 0.78rem;
    color: #777;
    line-height: 1.55;
}
.featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--color-primary);
    color: #fff;
    padding: 3px 12px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    z-index: 2;
}

.detail-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 24px;
    border-left: 6px solid var(--color-primary);
}
.detail-card-img {
    width: 200px;
    height: 280px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: #f0f0f0;
    box-shadow: var(--shadow-sm);
}
.detail-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.detail-card-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-dark);
}
.detail-card-content .detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: #666;
}
.detail-card-content .detail-meta-row strong {
    color: var(--color-dark);
}
.detail-card-content .detail-desc {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.8;
}
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.detail-tags span {
    padding: 5px 16px;
    border-radius: 18px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.tag-genre {
    background: #ffe0e8;
    color: var(--color-primary);
}
.tag-studio {
    background: #fff3e0;
    color: var(--color-accent);
}
.tag-status {
    background: #e0f4f7;
    color: var(--color-info);
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.character-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 18px 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}
.character-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-info);
}
.character-card-img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: block;
    background: #f0f0f0;
    border: 3px solid var(--color-bg-light);
}
.character-card h4 {
    font-size: 0.92rem;
    font-weight: 750;
    color: var(--color-dark);
    margin-bottom: 4px;
}
.character-card .char-role {
    font-size: 0.72rem;
    color: var(--color-info);
    font-weight: 700;
    margin-bottom: 5px;
}
.character-card .char-desc {
    font-size: 0.72rem;
    color: #888;
    line-height: 1.45;
}

.info-block {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    line-height: 1.9;
}
.info-block h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-dark);
    margin-bottom: 12px;
}
.info-block p {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.app-download-card {
    display: flex;
    align-items: center;
    gap: 22px;
    background: linear-gradient(135deg, #fff5f8, #fffdf5);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    border: 2px dashed var(--color-primary);
    flex-wrap: wrap;
}
.app-download-card .app-icon {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 18px;
    background: #f0f0f0;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.app-download-info {
    flex: 1;
    min-width: 180px;
}
.app-download-info h4 {
    font-weight: 800;
    color: var(--color-dark);
    font-size: 1.1rem;
    margin-bottom: 4px;
}
.app-download-info p {
    font-size: 0.8rem;
    color: #777;
    margin: 0;
}
.btn-download-app {
    display: inline-block;
    padding: 12px 30px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 28px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    letter-spacing: 1px;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(255, 22, 93, 0.35);
}
.btn-download-app:hover {
    background: #d01048;
    box-shadow: 0 8px 24px rgba(255, 22, 93, 0.5);
    transform: translateY(-2px);
}

.sidebar-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--color-primary);
}
.sidebar-card.sidebar-accent {
    border-top-color: var(--color-accent);
}
.sidebar-card.sidebar-info {
    border-top-color: var(--color-info);
}
.sidebar-card h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-dark);
    margin-bottom: 14px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-card h3 .badge-small {
    font-size: 0.65rem;
    background: #ffe0e8;
    color: var(--color-primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}
.rank-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rank-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    background: #fdfdfd;
}
.rank-list li:hover {
    background: #fff8f0;
}
.rank-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
    flex-shrink: 0;
    color: #fff;
    background: #ccc;
}
.rank-list li:nth-child(1) .rank-num {
    background: var(--color-primary);
}
.rank-list li:nth-child(2) .rank-num {
    background: #ff6b8a;
}
.rank-list li:nth-child(3) .rank-num {
    background: var(--color-accent);
}
.rank-thumb {
    width: 46px;
    height: 62px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    background: #f0f0f0;
}
.rank-info {
    flex: 1;
    min-width: 0;
}
.rank-info .rank-title {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--color-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rank-info .rank-sub {
    font-size: 0.7rem;
    color: #999;
}
.rank-change {
    font-weight: 700;
    font-size: 0.78rem;
    white-space: nowrap;
}
.rank-change.up {
    color: #e53e3e;
}
.rank-change.stable {
    color: #888;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dotted #eee;
    font-size: 0.85rem;
}
.stat-row:last-child {
    border-bottom: none;
}
.stat-label {
    color: #888;
}
.stat-value {
    font-weight: 700;
    color: var(--color-dark);
}
.stat-value.highlight {
    color: var(--color-primary);
    font-size: 1.1rem;
}
.update-time {
    font-size: 0.7rem;
    color: #bbb;
    text-align: right;
    margin-top: 8px;
}

.comment-side-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}
.comment-side-list::-webkit-scrollbar {
    width: 4px;
}
.comment-side-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}
.comment-side-item {
    display: flex;
    gap: 10px;
    padding: 12px 10px;
    background: #fdfdfd;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    transition: var(--transition);
    align-items: flex-start;
}
.comment-side-item:hover {
    border-left-color: var(--color-primary);
    background: #fff8fa;
}
.comment-side-body {
    flex: 1;
    min-width: 0;
}
.comment-side-user {
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--color-dark);
    margin-bottom: 2px;
}
.comment-side-time {
    font-size: 0.65rem;
    color: #aaa;
    margin-bottom: 5px;
}
.comment-side-text {
    font-size: 0.75rem;
    color: #555;
    line-height: 1.6;
    word-break: break-word;
}

.bottom-nav {
    width: 100%;
    background: var(--color-dark);
    color: #ccc;
    padding: 32px 24px 20px;
    margin-top: auto;
    border-top: 4px solid var(--color-primary);
}
.bottom-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: space-between;
    align-items: flex-start;
}
.bottom-nav-col h4 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}
.bottom-nav-col a {
    display: block;
    color: #aaa;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 4px 0;
    transition: var(--transition);
}
.bottom-nav-col a:hover {
    color: var(--color-accent);
}
.bottom-nav-bottom {
    max-width: var(--max-width);
    margin: 22px auto 0;
    text-align: center;
    font-size: 0.75rem;
    color: #777;
    padding-top: 18px;
    border-top: 1px solid #333;
}
.bottom-nav-bottom a {
    color: var(--color-info);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}
.bottom-nav-bottom a:hover {
    color: #fff;
    text-decoration: underline;
}

@media (max-width: 1200px) {
    .comic-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    .character-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sidebar-right {
        width: 290px;
    }
    .main-container {
        gap: 20px;
        padding: 20px 16px;
    }
    .detail-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .detail-card-img {
        width: 170px;
        height: 238px;
    }
    .detail-tags {
        justify-content: center;
    }
}
@media (max-width: 768px) {
    .comic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .featured-grid {
        grid-template-columns: 1fr;
    }
    .main-container {
        flex-direction: column;
        padding: 14px 10px;
        gap: 20px;
    }
    .sidebar-right {
        width: 100%;
        position: static;
        max-height: none;
        order: 10;
    }
    .content-main {
        gap: 24px;
    }
    .top-nav-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 12px;
        gap: 8px;
    }
    .nav-links {
        gap: 2px;
        order: 3;
        width: 100%;
        justify-content: center;
    }
    .nav-links a {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    .detail-card {
        padding: 18px;
        gap: 14px;
    }
    .detail-card-img {
        width: 140px;
        height: 196px;
    }
    .featured-card {
        flex-direction: column;
    }
    .featured-card-img {
        width: 100%;
        height: 200px;
    }
    .app-download-card {
        flex-direction: column;
        text-align: center;
    }
    .bottom-nav-inner {
        flex-direction: column;
        gap: 18px;
    }
    .comment-side-list {
        max-height: 360px;
    }
}
@media (max-width: 480px) {
    .comic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .comic-card-body h3 {
        font-size: 0.82rem;
    }
    .comic-meta-line {
        font-size: 0.62rem;
    }
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .section-title h2 {
        font-size: 1.05rem;
    }
    .detail-card-content h2 {
        font-size: 1.15rem;
    }
    .nav-brand h1 {
        font-size: 1.3rem;
    }
    .btn-login {
        padding: 7px 14px;
        font-size: 0.78rem;
    }
}
