:root {
    --color-dark: #403f48;
    --color-mid: #596c68;
    --color-accent: #95a792;
    --color-bg: #e3d9ca;
    --color-white: #fdfaf5;
    --color-card: #fffefb;
    --color-text: #2d2c33;
    --color-text-light: #5a5863;
    --color-border: #d9d0c0;
    --color-tag-bg: #eef2ee;
    --color-rank-badge: #c47a4a;
    --shadow-sm: 0 1px 3px rgba(64, 63, 72, 0.06);
    --shadow-md: 0 4px 16px rgba(64, 63, 72, 0.1);
    --shadow-lg: 0 8px 32px rgba(64, 63, 72, 0.14);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1360px;
    --nav-height: 60px;
    --sub-nav-height: 44px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + var(--sub-nav-height) + 16px);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.top-nav {
    width: 100%;
    height: var(--nav-height);
    background: var(--color-dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.top-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.top-nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.site-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}
.site-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fdfaf5;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.site-name h1 {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    display: inline;
    margin: 0;
    padding: 0;
}
.top-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 22px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    border: none;
    letter-spacing: 0.3px;
}
.btn-read-now {
    background: var(--color-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(149, 167, 146, 0.4);
}
.btn-read-now:hover {
    background: #829a7f;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(149, 167, 146, 0.55);
}
.btn-login {
    background: transparent;
    color: #e3d9ca;
    border: 1.5px solid #6b6878;
    padding: 8px 16px;
    font-size: 0.85rem;
}
.btn-login:hover {
    border-color: #95a792;
    color: #fff;
    background: rgba(149, 167, 146, 0.1);
}
.user-avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #596c68;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e3d9ca;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
    border: 2px solid transparent;
}
.user-avatar-placeholder:hover {
    border-color: #95a792;
}

.sub-nav {
    width: 100%;
    background: #fffefb;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: var(--nav-height);
    z-index: 999;
    height: var(--sub-nav-height);
    box-shadow: var(--shadow-sm);
}
.sub-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
}
.sub-nav-inner::-webkit-scrollbar {
    display: none;
}
.sub-nav-link {
    display: inline-block;
    padding: 8px 15px;
    font-size: 0.88rem;
    color: var(--color-text-light);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 20px;
    transition: var(--transition);
    font-weight: 500;
    letter-spacing: 0.2px;
}
.sub-nav-link:hover,
.sub-nav-link:focus {
    color: var(--color-dark);
    background: #f0ede6;
}
.sub-nav-link.active {
    color: #fff;
    background: var(--color-accent);
    font-weight: 600;
}

.main-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 24px;
    flex: 1;
}
.content-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.sidebar-right {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: calc(var(--nav-height) + var(--sub-nav-height) + 20px);
    align-self: flex-start;
    max-height: calc(100vh - var(--nav-height) - var(--sub-nav-height) - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c5bfb2 transparent;
    padding-right: 4px;
}
.sidebar-right::-webkit-scrollbar {
    width: 5px;
}
.sidebar-right::-webkit-scrollbar-thumb {
    background: #c5bfb2;
    border-radius: 10px;
}
.sidebar-right::-webkit-scrollbar-track {
    background: transparent;
}

.section-card {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid #ece7dd;
    transition: var(--transition);
}
.section-card:hover {
    box-shadow: var(--shadow-lg);
}
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ece7dd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.3px;
}
.section-title .title-icon {
    width: 6px;
    height: 22px;
    background: var(--color-accent);
    border-radius: 3px;
    display: inline-block;
    margin-right: 10px;
    flex-shrink: 0;
}
.section-title-inner {
    display: flex;
    align-items: center;
}
.section-title .more-link {
    font-size: 0.8rem;
    color: var(--color-mid);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}
.section-title .more-link:hover {
    color: var(--color-accent);
}

.hot-comics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}
.comic-card {
    background: #fffefb;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid #eee9df;
    display: flex;
    flex-direction: column;
}
.comic-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #d5cdbc;
}
.comic-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f0ede6;
}
.comic-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.comic-card:hover .comic-cover {
    transform: scale(1.06);
}
.comic-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 9px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    z-index: 2;
}
.comic-rank-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--color-rank-badge);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(196, 122, 74, 0.4);
}
.comic-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.comic-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-dark);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.comic-meta {
    font-size: 0.7rem;
    color: var(--color-text-light);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    line-height: 1.5;
}
.comic-meta span {
    white-space: nowrap;
}
.comic-meta .label {
    color: #8c8a94;
    font-weight: 500;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.featured-card {
    display: flex;
    gap: 14px;
    background: #fffefb;
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid #ece7dd;
    transition: var(--transition);
    cursor: pointer;
}
.featured-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #d5cdbc;
}
.featured-cover {
    width: 100px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.featured-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 0;
}
.featured-info .comic-title {
    font-size: 0.95rem;
}
.featured-desc {
    font-size: 0.75rem;
    color: var(--color-text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.badge-featured {
    display: inline-block;
    background: #fdf2e0;
    color: #c47a4a;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    width: fit-content;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.character-card {
    text-align: center;
    background: #fffefb;
    border-radius: var(--radius-md);
    padding: 18px 12px;
    border: 1px solid #ece7dd;
    transition: var(--transition);
}
.character-card:hover {
    box-shadow: var(--shadow-md);
}
.character-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 10px;
    border: 3px solid #ece7dd;
    display: block;
}
.character-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-dark);
}
.character-role {
    font-size: 0.72rem;
    color: var(--color-mid);
    margin-top: 2px;
}
.character-brief {
    font-size: 0.7rem;
    color: var(--color-text-light);
    margin-top: 4px;
    line-height: 1.4;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.advantage-item {
    text-align: center;
    padding: 20px 14px;
    background: #fdfaf7;
    border-radius: var(--radius-md);
    border: 1px solid #ece7dd;
    transition: var(--transition);
}
.advantage-item:hover {
    background: #fffefb;
    box-shadow: var(--shadow-sm);
}
.advantage-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #eef2ee;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--color-accent);
    font-weight: 700;
}
.advantage-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--color-dark);
}
.advantage-desc {
    font-size: 0.72rem;
    color: var(--color-text-light);
    margin-top: 4px;
    line-height: 1.5;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.faq-item {
    border: 1px solid #ece7dd;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    background: #fffefb;
}
.faq-question {
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: var(--transition);
}
.faq-question:hover {
    background: #fdfaf7;
}
.faq-answer {
    padding: 0 18px 14px;
    font-size: 0.82rem;
    color: var(--color-text-light);
    line-height: 1.6;
    display: none;
}
.faq-item.open .faq-answer {
    display: block;
}
.faq-item.open .faq-question {
    color: var(--color-accent);
}
.faq-toggle-icon {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    color: var(--color-mid);
    flex-shrink: 0;
}
.faq-item.open .faq-toggle-icon {
    transform: rotate(45deg);
}

.sidebar-card {
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #ece7dd;
}
.sidebar-card .section-title {
    font-size: 1rem;
    margin-bottom: 10px;
    padding-bottom: 8px;
}
.rank-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rank-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    border-bottom: 1px solid #f5f1ea;
}
.rank-list li:last-child {
    border-bottom: none;
}
.rank-list li:hover {
    background: #fdfaf7;
}
.rank-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
    color: #fff;
    background: #b0b8aa;
}
.rank-list li:nth-child(1) .rank-num { background: #d4a24e; }
.rank-list li:nth-child(2) .rank-num { background: #a0a8a0; }
.rank-list li:nth-child(3) .rank-num { background: #c49a6c; }
.rank-thumb {
    width: 36px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.rank-info {
    flex: 1;
    min-width: 0;
}
.rank-comic-title {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--color-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rank-stat {
    font-size: 0.68rem;
    color: var(--color-text-light);
}
.rank-change {
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}
.rank-change.up { color: #c44a3f; }
.rank-change.down { color: #5a8a6a; }

.total-read-stat {
    text-align: center;
    padding: 10px 0;
}
.total-read-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--color-dark);
    letter-spacing: 1px;
}
.total-read-label {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: 2px;
}
.update-time {
    font-size: 0.68rem;
    color: #999;
    margin-top: 4px;
}

.stats-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.stat-item {
    flex: 1;
    min-width: 70px;
    text-align: center;
    background: #fdfaf7;
    border-radius: var(--radius-sm);
    padding: 12px 8px;
}
.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-dark);
}
.stat-label {
    font-size: 0.68rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.tag-cloud .tag {
    display: inline-block;
    padding: 5px 12px;
    background: #f0ede6;
    color: var(--color-mid);
    border-radius: 16px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.2px;
}
.tag-cloud .tag:hover {
    background: var(--color-accent);
    color: #fff;
}

.sidebar-comment-item {
    padding: 10px 0;
    border-bottom: 1px solid #f5f1ea;
}
.sidebar-comment-item:last-child {
    border-bottom: none;
}
.comment-username {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--color-dark);
}
.comment-time-sm {
    font-size: 0.65rem;
    color: #aaa;
    margin-left: auto;
}
.sidebar-comment-text {
    font-size: 0.73rem;
    color: var(--color-text-light);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.footer {
    width: 100%;
    background: var(--color-dark);
    color: #c5c0b8;
    margin-top: 40px;
    padding: 0;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 36px 20px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}
.footer-col {
    flex: 1;
    min-width: 160px;
}
.footer-col h4 {
    color: #e3d9ca;
    font-size: 0.95rem;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.footer-col p,
.footer-col a {
    font-size: 0.8rem;
    color: #b5b0a6;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    transition: var(--transition);
    line-height: 1.6;
}
.footer-col a:hover {
    color: #e3d9ca;
    text-decoration: underline;
}
.footer-bottom {
    width: 100%;
    border-top: 1px solid #4a4852;
    padding: 16px 20px;
    text-align: center;
    font-size: 0.72rem;
    color: #8c8a90;
    max-width: var(--max-width);
    margin: 0 auto;
}
.app-download-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 6px;
}
.app-download-icons a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 20px;
    background: #3a3942;
    color: #e3d9ca;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}
.app-download-icons a:hover {
    background: #4a4852;
    border-color: #95a792;
    color: #fff;
}
.app-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-block;
}

@media (max-width: 1200px) {
    .hot-comics-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .featured-grid { grid-template-columns: repeat(2, 1fr); }
    .characters-grid { grid-template-columns: repeat(3, 1fr); }
    .advantages-grid { grid-template-columns: repeat(3, 1fr); }
    .sidebar-right { width: 290px; }
}
@media (max-width: 1024px) {
    .main-wrapper { flex-direction: column; gap: 20px; }
    .sidebar-right { width: 100%; position: static; max-height: none; overflow-y: visible; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .hot-comics-grid { grid-template-columns: repeat(4, 1fr); }
    .featured-grid { grid-template-columns: repeat(2, 1fr); }
    .characters-grid { grid-template-columns: repeat(3, 1fr); }
    .advantages-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .hot-comics-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .featured-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .featured-card { flex-direction: column; align-items: center; text-align: center; }
    .featured-cover { width: 80px; height: 110px; }
    .characters-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .advantages-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .sidebar-right { grid-template-columns: 1fr; gap: 12px; }
    .footer-inner { flex-direction: column; gap: 20px; }
}
@media (max-width: 480px) {
    .hot-comics-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .featured-grid { grid-template-columns: 1fr; gap: 10px; }
    .characters-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .advantages-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .section-card { padding: 14px 12px; }
    .comic-title { font-size: 0.78rem; }
    .comic-meta { font-size: 0.65rem; }
    .top-nav-inner { padding: 0 10px; }
    .btn-nav { padding: 6px 10px; font-size: 0.72rem; gap: 3px; }
    .site-logo { width: 32px; height: 32px; }
    .site-name { font-size: 1rem; }
}
