/*
 * 小说湾前台页面样式：首页、书库、榜单、详情、目录、阅读器、用户中心、登录注册、充值等。
 *
 * @author zhenhua
 * @since 2026-08-02
 */

/* ---------- 首页 ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #fbfaf8 0%, #f4f2ee 100%);
    border-bottom: 1px solid var(--line);
}

.hero-in {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 58px 24px 62px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 520px);
    gap: 48px;
    align-items: center;
}

.hero h1 {
    font-size: 40px;
    line-height: 1.28;
    letter-spacing: 1px;
}

.hero .sub {
    margin-top: 14px;
    font-size: 16px;
    color: var(--ink-3);
    max-width: 46em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.hero-search {
    display: flex;
    gap: 8px;
    margin-top: 26px;
    max-width: 520px;
}

.hero-search input {
    flex: 1;
    height: 46px;
    padding: 0 16px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface);
    outline: none;
}

.hero-search input:focus {
    border-color: var(--accent);
}

.hero-hot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--ink-3);
}

.hero-hot a {
    color: var(--ink-2);
}

.hero-hot a:hover {
    color: var(--accent);
}

.hero-books {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.hero-book {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.hero-book .cover-sm {
    width: 84px;
}

.hero-book h3 {
    font-size: 15.5px;
    margin-bottom: 4px;
}

.hero-book p {
    font-size: 12.5px;
    color: var(--ink-3);
    line-height: 1.65;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.cat-card {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 15px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.cat-card b {
    font-size: 15.5px;
    font-weight: 600;
}

.cat-card span {
    font-size: 12.5px;
    color: var(--ink-3);
}

.cat-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.home-ranks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.update-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
}

.update-line:last-child {
    border-bottom: 0;
}

.update-line .name {
    color: var(--ink-2);
    flex: none;
    max-width: 34%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.update-line .name:hover {
    color: var(--accent);
}

.update-line .ch {
    flex: 1;
    color: var(--ink-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- 书库 / 搜索结果 ---------- */
.shelf-head {
    padding: 34px 0 6px;
}

.filter-bar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 20px;
    margin-bottom: 22px;
}

.filter + .filter {
    border-top: 1px solid var(--line);
}

.result-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    padding: 26px 0 4px;
}

.result-head b {
    color: var(--accent);
    font-weight: 600;
}

/* ---------- 排行榜 ---------- */
.rank-hero {
    padding: 34px 0 10px;
}

.rank-hero h1 {
    font-size: 32px;
    letter-spacing: 1px;
}

.rank-hero p {
    margin-top: 8px;
    color: var(--ink-3);
}

.rank-feature {
    display: grid;
    grid-template-columns: 116px 1fr;
    gap: 20px;
    padding: 22px;
}

.rank-feature .cover-sm {
    width: 116px;
}

.rank-feature .no {
    font-family: var(--serif);
    font-size: 34px;
    line-height: 1;
    color: var(--accent);
}

.rank-feature h2 {
    font-size: 24px;
    margin: 6px 0 8px;
}

.rank-feature .desc {
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.8;
    margin-top: 10px;
}

/* ---------- 详情 ---------- */
.detail-hero {
    display: grid;
    grid-template-columns: 172px minmax(0, 1fr);
    gap: 28px;
    padding: 30px;
}

.cover-lg {
    width: 172px;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-alt);
    box-shadow: var(--shadow);
}

.cover-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-title {
    font-size: 30px;
    line-height: 1.3;
}

.detail-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-top: 12px;
    color: var(--ink-3);
    font-size: 14px;
}

.detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
    margin: 22px 0;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.detail-stats div {
    min-width: 78px;
}

.detail-stats b {
    display: block;
    font-size: 19px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.detail-stats span {
    font-size: 12.5px;
    color: var(--ink-3);
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-latest {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    font-size: 14px;
}

.detail-latest a {
    color: var(--ink);
}

.detail-latest a:hover {
    color: var(--accent);
}

.desc-wrap {
    position: relative;
}

.desc-clamp {
    position: relative;
    max-height: 8.5em;
    overflow: hidden;
    line-height: 1.85;
    font-size: 15px;
    color: var(--ink-2);
    white-space: pre-wrap;
}

.desc-clamp[data-open="1"] {
    max-height: none;
}

.desc-wrap:not([data-open="1"]) .desc-clamp::after,
.desc-clamp:not([data-open="1"])::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3.4em;
    background: linear-gradient(transparent, var(--surface));
}

.desc-toggle {
    margin-top: 8px;
    color: var(--accent);
    font-size: 13.5px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.toc-mini {
    display: grid;
    gap: 0;
}

.toc-mini a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14.5px;
    color: var(--ink-2);
}

.toc-mini a:last-child {
    border-bottom: 0;
}

.toc-mini a:hover {
    color: var(--accent);
}

.toc-mini .time {
    color: var(--ink-4);
    font-size: 12.5px;
    flex: none;
}

/* 评论 */
.comment-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 13px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.comment-item:last-child {
    border-bottom: 0;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.comment-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13.5px;
}

.comment-head b {
    color: var(--ink);
    font-weight: 600;
}

.comment-head time {
    color: var(--ink-4);
    font-size: 12.5px;
}

.comment-body {
    font-size: 14.5px;
    line-height: 1.85;
    color: var(--ink-2);
    margin: 4px 0 8px;
    white-space: pre-wrap;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
    color: var(--ink-3);
}

.comment-actions button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
    cursor: pointer;
}

.comment-actions button:hover {
    color: var(--accent);
}

.comment-actions button.on {
    color: var(--accent);
}

.comment-form textarea {
    width: 100%;
    min-height: 92px;
    padding: 12px 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    resize: vertical;
    outline: none;
    line-height: 1.8;
}

.comment-form textarea:focus {
    border-color: var(--accent);
}

/* ---------- 目录 ---------- */
.toc-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toc-tools .count {
    margin-left: auto;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.toc-filter {
    width: 200px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    outline: none;
}

.toc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px 26px;
}

.toc-grid a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px;
    font-size: 14.5px;
    color: var(--ink-2);
    border-bottom: 1px solid var(--line);
}

.toc-grid a:hover {
    color: var(--accent);
}

.toc-grid a.read {
    color: var(--ink-4);
}

.toc-grid a.current {
    color: var(--accent);
    font-weight: 600;
}

.toc-grid .num {
    color: var(--ink-4);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    flex: none;
    min-width: 3ch;
}

.vip-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 10px;
    display: inline-grid;
    place-items: center;
    flex: none;
}

/* ---------- 阅读器 ---------- */
body.reader {
    background: #f7f4ec;
    color: #33302b;
    transition: background-color .2s, color .2s;
}

body.reader[data-theme="gray"] {
    background: #f1f1ee;
    color: #333;
}

body.reader[data-theme="green"] {
    background: #e8f0e8;
    color: #2f3b33;
}

body.reader[data-theme="night"] {
    background: #1e1f21;
    color: #c9c9c9;
}

.reader-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    z-index: 90;
}

.reader-bar {
    position: sticky;
    top: 0;
    z-index: 70;
    height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    background: color-mix(in srgb, currentColor 5%, transparent);
    backdrop-filter: blur(8px);
}

.reader-bar a, .reader-bar button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: none;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    opacity: .85;
}

.reader-bar a:hover, .reader-bar button:hover {
    background: color-mix(in srgb, currentColor 9%, transparent);
    color: inherit;
    opacity: 1;
}

.reader-bar .title {
    font-size: 15px;
    font-weight: 600;
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reader-bar .spacer {
    margin-left: auto;
}

.reader-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 26px 24px 90px;
}

.reader-chapter-title {
    font-family: var(--serif);
    font-size: 30px;
    line-height: 1.45;
    text-align: center;
    margin: 18px 0 8px;
}

.reader-meta {
    text-align: center;
    font-size: 13px;
    opacity: .6;
    margin-bottom: 34px;
}

.reader-content {
    font-family: var(--reader-font, var(--serif));
    font-size: var(--reader-fs, 20px);
    line-height: var(--reader-lh, 2);
    letter-spacing: .4px;
}

.reader-content > p,
.reader-content p {
    margin: 0 0 1.15em;
    text-indent: 2em;
}

.reader-content img {
    max-width: 100%;
    margin: 1em auto;
    display: block;
}

.reader-nav {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 46px;
}

.reader-nav a {
    min-width: 132px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    border-radius: var(--radius-sm);
    color: inherit;
    font-size: 15px;
}

.reader-nav a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.reader-nav a.disabled {
    opacity: .4;
    pointer-events: none;
}

.reader-tool {
    position: fixed;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 75;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 6px;
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.reader-tool button, .reader-tool a {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    background: none;
    border-radius: 50%;
    color: var(--ink-2);
    font-size: 18px;
    cursor: pointer;
}

.reader-tool button:hover, .reader-tool a:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.reader-tool button.on {
    background: var(--accent);
    color: #fff;
}

.reader-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 95;
    width: 340px;
    max-width: 88vw;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform .22s ease;
    display: flex;
    flex-direction: column;
}

.reader-panel.open {
    transform: none;
}

.reader-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    font-weight: 600;
}

.reader-panel-body {
    overflow-y: auto;
    flex: 1;
    padding: 6px 18px 24px;
}

.reader-panel-body a {
    display: flex;
    gap: 8px;
    padding: 9px 0;
    font-size: 14px;
    color: var(--ink-2);
    border-bottom: 1px solid var(--line);
}

.reader-panel-body a.on {
    color: var(--accent);
    font-weight: 600;
}

.reader-mask {
    position: fixed;
    inset: 0;
    z-index: 92;
    background: rgba(20, 20, 18, .3);
    display: none;
}

.reader-mask.open {
    display: block;
}

.theme-swatches {
    display: flex;
    gap: 10px;
    margin: 14px 0 4px;
}

.theme-swatches button {
    flex: 1;
    height: 46px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-2);
    font-size: 12.5px;
    cursor: pointer;
}

.theme-swatches button.on {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    color: var(--ink-2);
}

.stepper .step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stepper button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

.stepper button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.stepper span {
    min-width: 42px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* 移动端阅读底栏 */
.reader-tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 75;
    height: 54px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
}

.reader-tabbar a, .reader-tabbar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    color: var(--ink-2);
    border: 0;
    background: none;
    cursor: pointer;
}

.reader-tabbar .i {
    font-size: 19px;
}

.reader-buy {
    max-width: 800px;
    margin: 0 auto 90px;
    padding: 30px 24px;
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    color: var(--ink);
}

.reader-buy h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.reader-buy p {
    color: var(--ink-3);
    font-size: 14px;
    margin-bottom: 18px;
}

/* ---------- 认证页 ---------- */
.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.auth-side {
    position: relative;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    background: linear-gradient(160deg, #f6f3ee, #eeeae3);
    border-right: 1px solid var(--line);
}

.auth-side h2 {
    font-family: var(--serif);
    font-size: 34px;
    line-height: 1.5;
    max-width: 14em;
}

.auth-side p {
    color: var(--ink-3);
    max-width: 34em;
}

.auth-quote {
    font-family: var(--serif);
    font-size: 15px;
    color: var(--ink-2);
    border-left: 2px solid var(--accent);
    padding-left: 14px;
    line-height: 2;
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    width: 100%;
    max-width: 372px;
}

.auth-card h1 {
    font-size: 26px;
    margin-bottom: 6px;
}

.auth-card .sub {
    color: var(--ink-3);
    margin-bottom: 26px;
}

.auth-alt {
    margin-top: 18px;
    font-size: 14px;
    color: var(--ink-3);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.auth-alt a {
    color: var(--accent);
}

.captcha-row {
    display: flex;
    gap: 10px;
}

.captcha-row .input {
    flex: 1;
}

.captcha-img {
    width: 108px;
    height: 42px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: #fff;
    object-fit: cover;
}

/* ---------- 用户中心 ---------- */
.user-layout {
    display: grid;
    grid-template-columns: 218px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    padding: 28px 0 44px;
}

.user-aside {
    position: sticky;
    top: calc(var(--header-h) + 20px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.user-me {
    padding: 20px;
    border-bottom: 1px solid var(--line);
}

.user-me__row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/*
 * 账号是手机号、邮箱这类没有空格的长字符串时，文本列必须 min-width:0 才会被截断；
 * 否则它按整串宽度撑开，把同行的其他元素挤成一列竖排文字。
 */
.user-me__info {
    min-width: 0;
}

.user-me .avatar {
    width: 46px;
    height: 46px;
    font-size: 18px;
}

.user-me__info b {
    display: block;
    font-size: 16px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-me__sub {
    display: block;
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--ink-3);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-me__acts {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 14px 0 0;
    font-size: 12.5px;
    color: var(--ink-3);
    white-space: nowrap;
}

.user-me__acts i {
    font-style: normal;
    color: var(--ink-4);
}

.user-aside nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    color: var(--ink-2);
    border-left: 2px solid transparent;
}

.user-aside nav a:hover {
    background: var(--surface-alt);
}

.user-aside nav a.on {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
    font-weight: 600;
}

.user-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.user-head h1 {
    font-size: 22px;
}

.balance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-radius: var(--radius);
    background: linear-gradient(150deg, #4c4a45, #2f2e2b);
    color: #f4f2ee;
}

.balance-card b {
    display: block;
    font-size: 27px;
    font-variant-numeric: tabular-nums;
}

.balance-card .btn {
    background: #f4f2ee;
    border-color: #f4f2ee;
    color: #2f2e2b;
}

.shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.shelf-item {
    position: relative;
}

.shelf-item .remove {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(28, 28, 26, .55);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
}

.shelf-item:hover .remove {
    opacity: 1;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.shelf-item h3 {
    margin: 10px 0 4px;
    font-size: 15px;
    font-weight: 600;
}

.shelf-item .meta {
    margin: 0;
    font-size: 12.5px;
    color: var(--ink-3);
}

.shelf-item .btn {
    margin-top: 10px;
}

.progress-thin {
    height: 2px;
    background: var(--line);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-thin i {
    display: block;
    height: 100%;
    background: var(--accent);
}

/* ---------- 充值 ---------- */
.pay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.pay-opt {
    padding: 20px 16px;
    text-align: center;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
}

.pay-opt b {
    display: block;
    font-size: 21px;
    font-variant-numeric: tabular-nums;
}

.pay-opt span {
    font-size: 13px;
    color: var(--ink-3);
}

.pay-opt.on {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.pay-opt.on b {
    color: var(--accent);
}

/* ---------- 新闻 / 文本页 ---------- */
.article {
    max-width: 760px;
    margin: 0 auto;
    padding: 34px 24px 60px;
}

.article h1 {
    font-size: 30px;
    line-height: 1.4;
}

.article .meta {
    margin: 12px 0 26px;
}

.article-body {
    font-size: 16px;
    line-height: 1.95;
    color: var(--ink-2);
}

.article-body p {
    margin-bottom: 1.1em;
}

.article-body img {
    max-width: 100%;
}

.news-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}

.news-item:last-child {
    border-bottom: 0;
}

.news-item h3 {
    font-size: 16px;
    font-weight: 500;
    flex: 1;
}

.news-item time {
    color: var(--ink-4);
    font-size: 13px;
    flex: none;
}

/* ---------- 错误页 ---------- */
.err {
    min-height: 68vh;
    display: grid;
    place-items: center;
    padding: 60px 24px;
    text-align: center;
}

.err .code {
    font-family: var(--serif);
    font-size: 88px;
    line-height: 1;
    color: var(--ink-4);
}

.err h1 {
    font-size: 22px;
    margin: 18px 0 8px;
}

.err p {
    color: var(--ink-3);
    margin-bottom: 24px;
}

.err .row {
    justify-content: center;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .hero-in {
        grid-template-columns: 1fr;
        padding: 40px 24px;
        gap: 28px;
    }

    .hero-books {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .home-ranks {
        grid-template-columns: 1fr;
    }

    .toc-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .user-layout {
        grid-template-columns: 1fr;
    }

    .user-aside {
        position: static;
    }

    .user-aside nav {
        display: flex;
        overflow-x: auto;
    }

    .user-aside nav a {
        border-left: 0;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
    }

    .user-aside nav a.on {
        border-left: 0;
        border-bottom-color: var(--accent);
    }

    .auth {
        grid-template-columns: 1fr;
    }

    .auth-side {
        display: none;
    }
}

@media (max-width: 720px) {
    .detail-hero {
        grid-template-columns: 116px minmax(0, 1fr);
        gap: 18px;
        padding: 18px;
    }

    .cover-lg {
        width: 116px;
    }

    .detail-title {
        font-size: 22px;
    }

    .detail-stats {
        gap: 16px;
        margin: 16px 0;
    }

    .detail-stats b {
        font-size: 16px;
    }

    .detail-actions .btn {
        flex: 1;
    }

    .toc-grid {
        grid-template-columns: 1fr;
    }

    .rank-feature {
        grid-template-columns: 88px 1fr;
        gap: 14px;
        padding: 16px;
    }

    .rank-feature .cover-sm {
        width: 88px;
    }

    .hero h1 {
        font-size: 30px;
    }

    .reader-tool {
        display: none;
    }

    .reader-tabbar {
        display: flex;
    }

    .reader-main {
        padding: 12px 18px 96px;
    }

    .reader-chapter-title {
        font-size: 24px;
    }

    .reader-nav {
        margin-bottom: 20px;
    }

    .reader-nav a {
        flex: 1;
        min-width: 0;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .auth-main {
        padding: 32px 20px;
    }

    .article {
        padding: 22px 18px 40px;
    }

    .article h1 {
        font-size: 23px;
    }
}

@media (max-width: 480px) {
    .grid-5, .grid-4 {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .book-card-body {
        padding: 8px 8px 10px;
    }

    .book-card-body .title {
        font-size: 13.5px;
    }

    .book-card-body .sub {
        font-size: 11.5px;
    }

    .hero-books {
        grid-template-columns: 1fr;
    }

    .shelf-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

/* ---------- 阅读器补充 ---------- */
.reader-panel-title {
    font-size: 13px;
    color: var(--ink-3);
    padding: 16px 0 6px;
}

.reader-tabbar .dis {
    flex: 1;
}

.toc-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    color: var(--ink-2);
}

.toc-list a:hover {
    color: var(--accent);
}

.toc-list a.on {
    color: var(--accent);
    font-weight: 600;
}

.toc-list a i {
    font-style: normal;
    font-size: 12.5px;
    color: var(--ink-3);
    min-width: 40px;
    font-variant-numeric: tabular-nums;
}

.toc-list a span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.toc-list a em {
    font-style: normal;
    margin-left: auto;
}

/* ---------- 通用补充 ---------- */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.stat-grid div {
    background: var(--surface);
    padding: 16px 18px;
}

.stat-grid b {
    display: block;
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.stat-grid span {
    font-size: 12.5px;
    color: var(--ink-3);
}
