
:root {
    --bg-light: #eeeeee;
    --accent: #00adb5;
    --accent-light: #e0f7f9;
    --accent-dark: #00868c;
    --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;
    --radius-xs: 4px;
    --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;
}

/* ==================== A-Z 字母索引区域 ==================== */
.az-index-card {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: box-shadow var(--transition);
}
.az-index-card:hover {
    box-shadow: var(--hover-shadow);
}
.az-index-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.az-index-header .az-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.az-index-header .az-title .az-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--accent-light);
    color: var(--accent-dark);
    font-size: 1rem;
    font-weight: 700;
}
.az-index-header .az-hint {
    font-size: 0.78rem;
    color: #999;
    white-space: nowrap;
}
.az-index-header .az-selected-display {
    font-size: 0.85rem;
    color: var(--accent-dark);
    font-weight: 600;
    background: var(--accent-light);
    padding: 4px 12px;
    border-radius: 14px;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
    transition: all var(--transition);
}
.az-index-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 6px;
}
.az-letter-btn {
    aspect-ratio: 1 / 1;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    border: 1.5px solid #e8e8e8;
    background-color: #fafafa;
    color: #555;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    letter-spacing: 1px;
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
.az-letter-btn:hover {
    background-color: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-dark);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 173, 181, 0.2);
    z-index: 2;
}
.az-letter-btn:active {
    transform: scale(0.92);
    transition: transform 0.1s ease;
}
.az-letter-btn.active {
    background-color: var(--accent);
    border-color: var(--accent-dark);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 173, 181, 0.35);
    transform: translateY(-2px);
    z-index: 3;
}
.az-letter-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 2px;
    rotate: 45deg;
    border-right: 1.5px solid var(--accent-dark);
    border-bottom: 1.5px solid var(--accent-dark);
}
.az-letter-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background-color: #f5f5f5;
    color: #c0c0c0;
    border-color: #e8e8e8;
    pointer-events: none;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    text-decoration-color: #d0d0d0;
}
.az-letter-btn.disabled:hover {
    transform: none;
    box-shadow: none;
    background-color: #f5f5f5;
    border-color: #e8e8e8;
    color: #c0c0c0;
}

.az-letter-btn .az-dot-indicator {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #c0c0c0;
    transition: background-color var(--transition);
}
.az-letter-btn:hover .az-dot-indicator,
.az-letter-btn.active .az-dot-indicator {
    background-color: #ffffff;
}
.az-letter-btn.disabled .az-dot-indicator {
    display: none;
}

.az-filter-result {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 14px;
    background: var(--accent-light);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-dark);
    font-weight: 500;
    opacity: 0;
    transform: translateY(-6px);
    transition: all 0.3s ease;
    pointer-events: none;
    height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    border: none;
}
.az-filter-result.visible {
    opacity: 1;
    transform: translateY(0);
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
    margin-top: 12px;
    border: 1px solid #d0eef0;
    pointer-events: auto;
}
.az-filter-result .az-result-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.az-filter-result .az-clear-btn {
    margin-left: auto;
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent-dark);
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}
.az-filter-result .az-clear-btn:hover {
    background-color: var(--accent);
    color: #fff;
}

/* ==================== 热门漫画网格 ==================== */
.hot-comics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    transition: all 0.4s ease;
}
.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), opacity 0.35s ease;
    border: 1px solid transparent;
}
.comic-card.filter-dimmed {
    opacity: 0.35;
    pointer-events: none;
    filter: grayscale(40%);
    transform: scale(0.96);
    transition: all 0.35s ease;
}
.comic-card.filter-highlight {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 173, 181, 0.18);
    animation: pulseHighlight 0.6s ease-out;
}
@keyframes pulseHighlight {
    0% { box-shadow: 0 0 0 0px rgba(0, 173, 181, 0.5); }
    100% { box-shadow: 0 0 0 12px rgba(0, 173, 181, 0); }
}
.comic-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--hover-shadow);
    border-color: var(--accent);
}
.comic-card.filter-dimmed:hover {
    transform: scale(0.96);
    box-shadow: var(--card-shadow);
    border-color: transparent;
}
.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.filter-dimmed:hover .comic-card-img-wrap img {
    transform: none;
}
.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;
}

.no-filter-result {
    display: none;
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 0.9rem;
    grid-column: 1 / -1;
}
.no-filter-result.visible {
    display: block;
}

/* ==================== 漫画详细介绍 ==================== */
.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-body {
    flex: 1;
    min-width: 0;
}
.comment-user {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.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;
}

.friendlinks-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.friendlinks-list li a {
    color: #555;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition);
}
.friendlinks-list li a:hover {
    color: var(--accent);
}

/* ==================== 底部导航 ==================== */
.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; }
    .az-index-grid { grid-template-columns: repeat(9, 1fr); gap: 5px; }
    .az-letter-btn { font-size: 0.76rem; }
}
@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; }
    .az-index-grid { grid-template-columns: repeat(7, 1fr); gap: 5px; }
    .az-letter-btn { font-size: 0.74rem; min-width: 30px; }
}
@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; }
    .az-index-grid { grid-template-columns: repeat(6, 1fr); gap: 4px; }
    .az-letter-btn { font-size: 0.7rem; min-width: 28px; border-radius: 3px; }
    .az-index-header { flex-direction: column; align-items: flex-start; }
    .az-index-header .az-hint { font-size: 0.7rem; }
}
@media (max-width: 380px) {
    .az-index-grid { grid-template-columns: repeat(5, 1fr); gap: 3px; }
    .az-letter-btn { font-size: 0.65rem; min-width: 24px; }
}
