
:root {
    --bg-light: #eeeeee;
    --accent: #00adb5;
    --text-dark: #393e46;
    --nav-bg: #222831;
    --white: #ffffff;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --border-color: #e0e0e0;
    --hover-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.25s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== 顶部导航栏 ==================== */
.top-nav {
    width: 100%;
    background-color: var(--nav-bg);
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.top-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
}
.top-nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-shrink: 0;
}
.top-nav-left h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition);
}
.top-nav-left h1:hover {
    color: var(--accent);
}
.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
}
.nav-links li a {
    color: #cccccc;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition);
    padding: 6px 0;
    position: relative;
    white-space: nowrap;
}
.nav-links li a:hover {
    color: var(--accent);
}
.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width var(--transition);
}
.nav-links li a:hover::after {
    width: 100%;
}
.top-nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity var(--transition);
}
.top-nav-right:hover {
    opacity: 0.85;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    flex-shrink: 0;
}
.user-name {
    font-size: 0.9rem;
    color: #ffffff;
    white-space: nowrap;
}
.login-badge {
    background-color: var(--accent);
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color var(--transition);
}
.login-badge:hover {
    background-color: #009aa1;
}

/* ==================== 主布局 ==================== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 24px;
    padding: 24px;
    flex: 1;
}
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.sidebar {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==================== 通用卡片样式 ==================== */
.section-card {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: box-shadow var(--transition);
}
.section-card:hover {
    box-shadow: var(--hover-shadow);
}
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
    letter-spacing: 1px;
}
.section-title-wrapper {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 18px;
}

/* ==================== 热门漫画网格 ==================== */
.hot-comics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}
.comic-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid transparent;
}
.comic-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--hover-shadow);
    border-color: var(--accent);
}
.comic-card-img-wrap {
    width: 100%;
    aspect-ratio: 5 / 7;
    overflow: hidden;
    background-color: #e8e8e8;
    position: relative;
}
.comic-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.comic-card:hover .comic-card-img-wrap img {
    transform: scale(1.08);
}
.comic-card-info {
    padding: 10px 12px 14px;
}
.comic-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.comic-card-author {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}
.comic-card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.comic-tag {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 10px;
    background-color: #eef7f8;
    color: var(--accent);
    white-space: nowrap;
    font-weight: 500;
}

/* ==================== 漫画详细介绍 ==================== */
.comic-detail-layout {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.comic-detail-cover {
    flex-shrink: 0;
    width: 200px;
    height: 280px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    background-color: #e8e8e8;
}
.comic-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.comic-detail-info {
    flex: 1;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.comic-detail-info h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
}
.comic-detail-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #666;
}
.comic-detail-meta span {
    background: #f5f5f5;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.comic-detail-meta .meta-accent {
    color: var(--accent);
    font-weight: 600;
}
.comic-detail-desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
    margin-top: 4px;
}
.comic-detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.comic-detail-tags .detail-tag {
    padding: 5px 14px;
    border-radius: 16px;
    background-color: var(--accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}
.btn-read-now {
    display: inline-block;
    padding: 10px 28px;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    white-space: nowrap;
    align-self: flex-start;
    letter-spacing: 1px;
}
.btn-read-now:hover {
    background-color: #009aa1;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 173, 181, 0.35);
}

/* ==================== 角色详细介绍 ==================== */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.character-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px 14px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: all var(--transition);
    cursor: pointer;
}
.character-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: var(--accent);
}
.character-avatar-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 10px;
    background-color: #e8e8e8;
    border: 3px solid var(--accent);
}
.character-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.character-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}
.character-role-tag {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 6px;
}
.character-desc {
    font-size: 0.75rem;
    color: #777;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== 评论区域 ==================== */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
    transition: background var(--transition);
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-avatar-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #e0e0e0;
}
.comment-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.comment-body {
    flex: 1;
    min-width: 0;
}
.comment-user {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.comment-badge {
    display: inline-block;
    background-color: #eef7f8;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
}
.comment-time {
    font-size: 0.72rem;
    color: #aaa;
    margin-left: 8px;
}
.comment-text {
    font-size: 0.85rem;
    color: #555;
    margin-top: 4px;
    line-height: 1.6;
}
.comment-actions {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #999;
}
.comment-actions span {
    cursor: pointer;
    transition: color var(--transition);
}
.comment-actions span:hover {
    color: var(--accent);
}
.comment-likes {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== 侧边栏组件 ==================== */
.sidebar .section-card {
    padding: 16px 18px;
}
.sidebar .section-title {
    font-size: 1.05rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
}
.sidebar .section-title-wrapper {
    margin-bottom: 14px;
}

/* 排行榜列表 */
.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: background var(--transition);
    cursor: pointer;
}
.rank-list li:hover {
    background-color: #f8fafa;
}
.rank-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    background-color: #e8e8e8;
    color: #888;
}
.rank-list li:nth-child(1) .rank-num,
.rank-list li:nth-child(2) .rank-num,
.rank-list li:nth-child(3) .rank-num {
    background-color: var(--accent);
    color: #fff;
}
.rank-info {
    flex: 1;
    min-width: 0;
}
.rank-comic-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rank-comic-reads {
    font-size: 0.7rem;
    color: #999;
}
.rank-change {
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.rank-up {
    color: #e74c3c;
}
.rank-down {
    color: #27ae60;
}
.rank-same {
    color: #999;
}

/* 总阅读卡片 */
.total-reads-display {
    text-align: center;
    padding: 10px 0;
}
.total-reads-number {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 1px;
    line-height: 1;
}
.total-reads-label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

/* 数据统计小卡片 */
.stats-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.stat-mini-item {
    text-align: center;
    padding: 12px 6px;
    background: #f9fbfb;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.stat-mini-item:hover {
    background: #eef7f8;
}
.stat-mini-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.stat-mini-label {
    font-size: 0.7rem;
    color: #888;
    margin-top: 4px;
}

/* ==================== 底部导航 ==================== */
.bottom-nav {
    width: 100%;
    background-color: var(--nav-bg);
    color: #cccccc;
    padding: 28px 24px 20px;
    margin-top: auto;
}
.bottom-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.bottom-nav-links {
    display: flex;
    gap: 24px;
    list-style: none;
    flex-wrap: wrap;
}
.bottom-nav-links li a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition);
}
.bottom-nav-links li a:hover {
    color: var(--accent);
}
.bottom-copyright {
    font-size: 0.8rem;
    color: #777;
    white-space: nowrap;
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 1300px) {
    .hot-comics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .sidebar {
        width: 300px;
    }
}
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }
    .sidebar .section-card {
        flex: 1 1 calc(50% - 8px);
        min-width: 250px;
    }
    .hot-comics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .nav-links {
        display: none;
    }
}
@media (max-width: 640px) {
    .hot-comics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .comic-detail-layout {
        flex-direction: column;
        align-items: center;
    }
    .comic-detail-cover {
        width: 160px;
        height: 224px;
    }
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-mini-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .top-nav-inner {
        padding: 0 12px;
    }
    .top-nav-left h1 {
        font-size: 1.2rem;
    }
    .bottom-nav-inner {
        flex-direction: column;
        text-align: center;
    }
    .sidebar .section-card {
        flex: 1 1 100%;
        min-width: auto;
    }
}
