
:root {
    --color-deep: #40514e;
    --color-teal: #11999e;
    --color-bright: #30e3ca;
    --color-light: #e4f9f5;
    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --color-red: #ef4444;
    --color-orange: #f59e0b;
    --color-gold: #fbbf24;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    --max-width: 1320px;
    --sidebar-width: 340px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: #f5f8f7;
    color: var(--color-gray-800);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-nav {
    width: 100%;
    background: var(--color-deep);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    min-height: 60px;
}
.top-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    min-height: 60px;
    gap: 16px;
}
.top-nav-left {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-shrink: 0;
}
.site-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.site-title a {
    color: var(--color-bright);
    text-decoration: none;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}
.site-title a:hover {
    color: #5ff0dd;
}
.site-title .logo-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--color-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    color: var(--color-deep);
    flex-shrink: 0;
}
.nav-links {
    display: flex;
    list-style: none;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.nav-links li a {
    color: #c8dcd9;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.nav-links li a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}
.nav-links li a.active {
    color: var(--color-bright);
    background: rgba(48, 227, 202, 0.1);
    font-weight: 600;
}
.top-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.btn-login {
    padding: 9px 22px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.4px;
    transition: all var(--transition-normal);
    border: 2px solid var(--color-bright);
    background: transparent;
    color: var(--color-bright);
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-login:hover {
    background: var(--color-bright);
    color: var(--color-deep);
    box-shadow: 0 0 20px rgba(48, 227, 202, 0.35);
    transform: translateY(-1px);
}
.btn-login .user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid currentColor;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}
.mobile-menu-toggle span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--color-bright);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.main-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 20px 32px;
    display: flex;
    gap: 28px;
    flex: 1;
}
.content-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.sidebar-right {
    width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid #eef3f1;
    transition: box-shadow var(--transition-normal);
}
.section-card:hover {
    box-shadow: var(--shadow-lg);
}
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-deep);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--color-bright);
    display: inline-block;
    letter-spacing: 0.5px;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.section-header .section-title {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.section-header .view-all {
    font-size: 0.85rem;
    color: var(--color-teal);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    white-space: nowrap;
}
.section-header .view-all:hover {
    color: var(--color-bright);
    text-decoration: underline;
}
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: var(--color-light);
    color: var(--color-teal);
}
.badge-hot {
    background: #fef2f2;
    color: #dc2626;
}
.badge-new {
    background: #ecfdf5;
    color: #059669;
}

.hot-comics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}
.comic-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-slow);
    cursor: pointer;
    border: 1px solid #eef3f1;
    display: flex;
    flex-direction: column;
}
.comic-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-bright);
}
.comic-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: #e8eceb;
    flex-shrink: 0;
}
.comic-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
    loading: lazy;
}
.comic-card:hover .comic-card-img-wrap img {
    transform: scale(1.06);
}
.comic-card-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--color-deep);
    color: var(--color-bright);
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.comic-card-type-tag {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 2;
    letter-spacing: 0.3px;
}
.comic-card-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}
.comic-card-info h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-deep);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.comic-card-meta {
    font-size: 0.7rem;
    color: var(--color-gray-500);
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
}
.comic-card-meta span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comic-card-meta .meta-label {
    color: var(--color-gray-400);
    font-weight: 500;
}

.detail-section {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.detail-cover {
    width: 180px;
    height: 252px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #e8eceb;
}
.detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.detail-content {
    flex: 1;
    min-width: 260px;
}
.detail-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-deep);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.detail-tags .tag {
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 500;
    background: var(--color-light);
    color: var(--color-teal);
    letter-spacing: 0.3px;
}
.detail-desc {
    font-size: 0.92rem;
    color: var(--color-gray-600);
    line-height: 1.75;
    margin-bottom: 10px;
}
.detail-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--color-gray-500);
}
.detail-info-row .info-item {
    display: flex;
    gap: 4px;
    align-items: baseline;
}
.detail-info-row .info-label {
    font-weight: 600;
    color: var(--color-deep);
    white-space: nowrap;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.character-card {
    text-align: center;
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eef3f1;
    transition: all var(--transition-normal);
}
.character-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-bright);
    transform: translateY(-3px);
}
.character-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 10px;
    display: block;
    border: 3px solid var(--color-light);
    box-shadow: var(--shadow-sm);
    background: #e8eceb;
}
.character-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-deep);
    margin-bottom: 4px;
}
.character-card .char-role {
    font-size: 0.75rem;
    color: var(--color-teal);
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.character-card .char-desc {
    font-size: 0.78rem;
    color: var(--color-gray-500);
    line-height: 1.5;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.comment-item {
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    background: #fafcfb;
    border-radius: var(--radius-md);
    border: 1px solid #eef3f1;
    transition: all var(--transition-fast);
}
.comment-item:hover {
    background: #f5faf8;
    border-color: #d5e8e3;
}
/* 评论无头像，调整布局 */
.comment-body {
    flex: 1;
    min-width: 0;
}
.comment-body .comment-user {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--color-deep);
    margin-bottom: 2px;
}
.comment-body .comment-time {
    font-size: 0.73rem;
    color: var(--color-gray-400);
    margin-bottom: 6px;
}
.comment-body .comment-text {
    font-size: 0.88rem;
    color: var(--color-gray-600);
    line-height: 1.7;
}
.comment-actions {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--color-gray-400);
}
.comment-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color var(--transition-fast);
    padding: 2px 0;
}
.comment-actions button:hover {
    color: var(--color-teal);
}

.sidebar-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid #eef3f1;
}
.sidebar-card .card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-deep);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-light);
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-card .card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--color-bright);
    border-radius: 2px;
    flex-shrink: 0;
}
.rank-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rank-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
}
.rank-list li:hover {
    background: #f8fcfa;
}
.rank-num {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.rank-num.top1 { background: #f59e0b; }
.rank-num.top2 { background: #94a3b8; }
.rank-num.top3 { background: #b87c4b; }
.rank-num.normal { background: #cbd5e1; color: #64748b; }
.rank-info {
    flex: 1;
    min-width: 0;
}
.rank-info .rank-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-deep);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rank-info .rank-sub {
    font-size: 0.72rem;
    color: var(--color-gray-400);
}
.rank-badge-num {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-teal);
    flex-shrink: 0;
}
.trend-up {
    color: #10b981;
    font-weight: 700;
    font-size: 0.8rem;
}
.trend-icon {
    display: inline-block;
    font-size: 0.85rem;
}

.total-reads-display {
    text-align: center;
    padding: 16px 10px;
    background: linear-gradient(135deg, #f8fcfa 0%, var(--color-light) 100%);
    border-radius: var(--radius-md);
    border: 2px dashed #d0e8e3;
}
.total-reads-display .big-number {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--color-teal);
    letter-spacing: 1px;
    line-height: 1;
}
.total-reads-display .big-number-label {
    font-size: 0.8rem;
    color: var(--color-gray-500);
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.stat-item {
    text-align: center;
    padding: 12px 8px;
    background: #fafcfb;
    border-radius: var(--radius-sm);
    border: 1px solid #eef3f1;
}
.stat-item .stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-deep);
    line-height: 1;
}
.stat-item .stat-label {
    font-size: 0.7rem;
    color: var(--color-gray-400);
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.bottom-nav {
    width: 100%;
    background: var(--color-deep);
    color: #bcc9c6;
    margin-top: auto;
}
.bottom-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 28px 24px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
}
.bottom-nav-column h4 {
    color: var(--color-bright);
    font-size: 0.95rem;
    margin-bottom: 10px;
    letter-spacing: 0.4px;
}
.bottom-nav-column ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bottom-nav-column ul li a {
    color: #a3b5b1;
    text-decoration: none;
    font-size: 0.83rem;
    transition: color var(--transition-fast);
}
.bottom-nav-column ul li a:hover {
    color: #ffffff;
}
.bottom-copyright {
    text-align: center;
    padding: 14px 20px;
    font-size: 0.78rem;
    color: #7d9490;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.3px;
}
.bottom-copyright a {
    color: var(--color-bright);
    text-decoration: none;
    margin-left: 8px;
    font-weight: 500;
}
.bottom-copyright a:hover {
    text-decoration: underline;
}

@media (max-width: 1200px) {
    .hot-comics-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    .sidebar-right {
        width: 300px;
    }
    :root {
        --sidebar-width: 300px;
    }
    .detail-cover {
        width: 150px;
        height: 210px;
    }
}
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        gap: 20px;
        padding: 16px 14px 24px;
    }
    .sidebar-right {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .sidebar-right .sidebar-card:last-child {
        grid-column: 1 / -1;
    }
    .hot-comics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .characters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .nav-links {
        display: none;
    }
    .mobile-menu-toggle {
        display: flex;
    }
    .top-nav-inner {
        padding: 0 14px;
        gap: 10px;
    }
}
@media (max-width: 768px) {
    .hot-comics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .sidebar-right {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .detail-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .detail-cover {
        width: 160px;
        height: 224px;
    }
    .detail-content {
        text-align: center;
    }
    .detail-tags {
        justify-content: center;
    }
    .detail-info-row {
        justify-content: center;
    }
    .section-card {
        padding: 14px 12px;
    }
    .section-title {
        font-size: 1.1rem;
    }
    .site-title {
        font-size: 1.2rem;
    }
    .btn-login {
        padding: 7px 14px;
        font-size: 0.8rem;
    }
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .bottom-nav-inner {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 20px 14px 16px;
    }
    .comment-item {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}
@media (max-width: 480px) {
    .hot-comics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .comic-card-info h3 {
        font-size: 0.78rem;
    }
    .comic-card-meta {
        font-size: 0.65rem;
    }
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .character-avatar {
        width: 64px;
        height: 64px;
    }
    .character-card {
        padding: 10px 8px;
    }
    .character-card h4 {
        font-size: 0.82rem;
    }
    .stats-row {
        gap: 4px;
    }
    .stat-item .stat-value {
        font-size: 1rem;
    }
    .detail-cover {
        width: 130px;
        height: 182px;
    }
    .top-nav-inner {
        padding: 0 8px;
        gap: 6px;
    }
    .site-title {
        font-size: 1.05rem;
    }
    .btn-login {
        padding: 6px 10px;
        font-size: 0.72rem;
        border-radius: 18px;
    }
}

@media (max-width: 1024px) {
    .nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--color-deep);
        padding: 12px 16px;
        gap: 2px;
        box-shadow: var(--shadow-xl);
        z-index: 999;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .nav-links.mobile-open li a {
        display: block;
        padding: 10px 14px;
        border-radius: var(--radius-sm);
        font-size: 0.9rem;
    }
}

img {
    background: #e8eceb;
}
img[loading="lazy"] {
    transition: opacity 0.4s ease;
}
img:not([src]),
img[src=""] {
    opacity: 0;
    min-height: 40px;
}
