:root {
    --ink: #173b39;
    --ink-soft: #526764;
    --paper: #f7f3eb;
    --paper-deep: #ece5d7;
    --card: #fffdf8;
    --line: #ded6c7;
    --accent: #bf5b3b;
    --accent-dark: #99432b;
    --green: #1d514d;
    --gold: #c7a05c;
    --shadow: 0 18px 48px rgba(32, 54, 48, .09);
    --radius: 18px;
    --shell: min(1180px, calc(100% - 40px));
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-serif: "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
    --font-reader: "SourceHanSansSC-Regular", "SourceHanSansCN-Regular", "PingFangSC-Regular", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.65 var(--font-ui);
    -webkit-font-smoothing: antialiased;
}
.home-page, .category-page { font-family: var(--font-reader); }
.home-page .hero h1,
.home-page .book-spine strong,
.home-page .section-heading h2,
.home-page .ranking-card > header h3,
.home-page .rank-copy > a,
.home-page .latest-main h3,
.category-page .page-banner h1,
.category-page .list-book-copy h2 {
    font-family: var(--font-reader);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
.shell { width: var(--shell); margin-inline: auto; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: fixed; left: 20px; top: -80px; z-index: 100;
    padding: 10px 16px; color: white; background: var(--ink); border-radius: 8px;
}
.skip-link:focus { top: 16px; }

.site-header {
    position: sticky; top: 0; z-index: 30;
    background: rgba(247, 243, 235, .96); border-bottom: 1px solid rgba(222, 214, 199, .85);
    backdrop-filter: blur(14px);
}
.header-main { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand-mark {
    width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px;
    color: #fff9ed; background: var(--ink); font: 700 24px/1 var(--font-serif);
    box-shadow: 5px 5px 0 var(--gold);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font: 700 20px/1.2 var(--font-serif); letter-spacing: .08em; }
.brand-text small { margin-top: 5px; color: var(--ink-soft); font-size: 11px; letter-spacing: .24em; }
.header-tools { width: min(650px, 64vw); display: flex; align-items: center; gap: 12px; }
.search-form {
    display: flex; min-width: 0; flex: 1; border: 1px solid var(--line);
    background: var(--card); border-radius: 999px; overflow: hidden; transition: .2s ease;
}
.search-form:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29, 81, 77, .12); }
.search-form input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 11px 18px; background: transparent; color: var(--ink); }
.search-form button { border: 0; padding: 0 20px; color: white; background: var(--green); cursor: pointer; }
.header-history {
    min-height: 44px; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px;
    padding: 9px 16px; color: var(--green); border: 1px solid var(--green);
    background: var(--card); border-radius: 999px; font-size: 14px; font-weight: 700;
}
.history-icon {
    position: relative; width: 18px; height: 18px; flex: 0 0 18px;
    color: var(--accent); border: 2px solid currentColor; border-radius: 50%;
}
.history-icon::before, .history-icon::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 2px; background: currentColor; border-radius: 2px; transform-origin: 50% 0;
}
.history-icon::before { height: 5px; transform: translate(-50%, -1px) rotate(180deg); }
.history-icon::after { height: 6px; transform: translate(-50%, -1px) rotate(90deg); }
.header-history:hover, .header-history.active { color: white; background: var(--green); }
.header-history:hover .history-icon, .header-history.active .history-icon { color: var(--gold); }
.category-nav { background: var(--ink); color: #edf1e7; }
.nav-scroll { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-scroll a { flex: 0 0 auto; padding: 12px 18px; font-size: 14px; border-bottom: 3px solid transparent; }
.nav-scroll a:hover, .nav-scroll a.active { color: #fff; background: rgba(255,255,255,.06); border-bottom-color: var(--gold); }
.domain-reminder {
    min-height: 30px; display: grid; place-items: center; color: var(--ink-soft);
    background: #f0eadf; border-top: 1px solid rgba(255, 255, 255, .55);
}
.domain-reminder span {
    font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: .22em;
    text-transform: lowercase;
}

.hero {
    min-height: 600px; display: grid; align-items: center; overflow: hidden;
    background:
        radial-gradient(circle at 82% 24%, rgba(199, 160, 92, .23), transparent 23%),
        linear-gradient(135deg, #efe7d8 0%, #f8f4ec 52%, #e4dfd2 100%);
    border-bottom: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 60px; padding-block: 72px; }
.eyebrow { display: inline-block; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.hero h1, .page-banner h1, .book-detail h1 {
    margin: 16px 0 20px; font: 800 clamp(42px, 6vw, 72px)/1.1 var(--font-serif);
    letter-spacing: -.04em;
}
.hero-copy > p { max-width: 620px; margin: 0; color: var(--ink-soft); font-size: 18px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
    display: inline-flex; min-height: 46px; align-items: center; justify-content: center;
    padding: 10px 22px; border-radius: 999px; font-weight: 700; transition: .2s ease;
}
.button-primary { color: white; background: var(--accent); box-shadow: 0 10px 24px rgba(191, 91, 59, .22); }
.button-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.button-ghost { border: 1px solid var(--ink); }
.button-ghost:hover { color: white; background: var(--ink); }
.hero-stack { position: relative; height: 390px; }
.book-spine {
    position: absolute; display: flex; flex-direction: column; justify-content: space-between;
    width: 210px; height: 330px; padding: 28px 24px; border-radius: 5px 18px 18px 5px;
    color: #fdf9ee; box-shadow: 18px 24px 38px rgba(30, 52, 48, .2);
    transform-origin: bottom center; transition: transform .25s ease;
}
.book-spine:hover { transform: translateY(-10px) rotate(var(--rotate)); }
.book-spine::before { content: ""; position: absolute; inset: 0 auto 0 13px; width: 1px; background: rgba(255,255,255,.3); }
.book-spine span, .book-spine small { font-size: 12px; letter-spacing: .1em; opacity: .8; }
.book-spine strong { font: 700 26px/1.35 var(--font-serif); writing-mode: vertical-rl; align-self: center; }
.spine-1 { right: 215px; top: 35px; --rotate: -8deg; transform: rotate(-8deg); background: #a44f36; }
.spine-2 { right: 95px; top: 12px; --rotate: 3deg; transform: rotate(3deg); background: #214d49; }
.spine-3 { right: 0; top: 52px; --rotate: 10deg; transform: rotate(10deg); background: #755f49; }

.section { padding-block: 70px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading h2 { margin: 8px 0 0; font: 800 clamp(28px, 4vw, 42px)/1.2 var(--font-serif); }
.section-heading.compact h2 { font-size: 30px; }
.quiet { color: var(--ink-soft); font-size: 14px; }
.rankings-section { background: var(--card); border-bottom: 1px solid var(--line); }
.ranking-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ranking-card {
    min-width: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: 0 12px 32px rgba(32, 54, 48, .06);
}
.ranking-card > header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 21px 22px 18px; background: linear-gradient(135deg, rgba(29, 81, 77, .08), transparent);
    border-bottom: 1px solid var(--line);
}
.ranking-card > header h3 { margin: 5px 0 0; font: 700 23px/1.3 var(--font-serif); }
.ranking-card > header > a {
    flex: 0 0 auto; margin-top: 5px; padding: 5px 10px; color: var(--ink-soft);
    border: 1px solid var(--line); background: var(--card); border-radius: 999px; font-size: 12px;
}
.ranking-card > header > a:hover { color: white; border-color: var(--green); background: var(--green); }
.ranking-label { color: var(--accent); font: 800 11px/1 var(--font-ui); letter-spacing: .16em; }
.ranking-list { margin: 0; padding: 5px 20px 10px; list-style: none; }
.ranking-list li {
    display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px;
    align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line);
}
.ranking-list li:last-child { border-bottom: 0; }
.rank-number { color: var(--ink-soft); font: 700 13px/1 monospace; }
.ranking-list li:nth-child(-n+3) .rank-number { color: var(--accent); }
.rank-copy { min-width: 0; display: grid; gap: 2px; }
.rank-copy > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 15px/1.4 var(--font-serif); }
.rank-copy > a:hover { color: var(--accent); }
.rank-copy small { overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.rank-views { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.rank-views::after { content: " 阅读"; margin-left: 2px; font-size: 10px; }
.ranking-empty { margin: 0; padding: 36px 22px; color: var(--ink-soft); text-align: center; }
.latest-list { border-top: 1px solid var(--line); }
.latest-row {
    display: grid; grid-template-columns: 66px 1fr 260px; gap: 22px; align-items: center;
    padding: 22px 8px; border-bottom: 1px solid var(--line);
}
.mini-cover {
    --cover: #315c58; width: 58px; height: 76px; display: grid; place-items: center;
    color: #fff8ed; background: var(--cover); border-radius: 3px 9px 9px 3px;
    box-shadow: 5px 7px 14px rgba(32, 54, 48, .14); font: 700 25px/1 var(--font-serif);
}
.latest-main h3, .book-card h2, .search-results h2 { margin: 5px 0; font: 700 21px/1.4 var(--font-serif); }
.latest-main h3 a:hover, .book-card h2 a:hover, .search-results h2 a:hover { color: var(--accent); }
.latest-main p, .book-card-copy p, .search-results p { margin: 5px 0 0; color: var(--ink-soft); font-size: 14px; }
.book-meta { display: flex; gap: 8px; color: var(--accent); font-size: 12px; font-weight: 700; }
.book-meta span + span::before { content: "·"; margin-right: 8px; color: var(--line); }
.latest-chapter { display: grid; gap: 3px; text-align: right; }
.latest-chapter > span { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.latest-chapter a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.latest-chapter time { color: var(--ink-soft); font-size: 12px; }

.page-banner { padding: 58px 0; color: #f7f2e7; background: var(--ink); }
.page-banner h1 { margin-block: 12px; font-size: clamp(38px, 5vw, 58px); }
.page-banner p { margin: 0; color: #cbd7d1; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.toolbar > div:first-child { display: flex; flex-direction: column; }
.traditional-book-list { border-top: 1px solid var(--line); }
.traditional-book-row {
    display: grid; grid-template-columns: 82px minmax(0, 1fr) 230px; gap: 22px;
    align-items: center; min-width: 0; padding: 22px 8px; border-bottom: 1px solid var(--line);
    transition: background .2s ease;
}
.traditional-book-row:hover { background: rgba(255, 253, 248, .72); }
.list-cover {
    --cover: #315c58; width: 72px; height: 96px; display: flex; flex-direction: column;
    justify-content: space-between; overflow: hidden; padding: 11px 9px; color: #fff8ed;
    background: linear-gradient(90deg, rgba(0,0,0,.16), transparent 14%), var(--cover);
    border-radius: 3px 9px 9px 3px; box-shadow: 6px 8px 16px rgba(32, 54, 48, .14);
}
.list-cover span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; opacity: .78; }
.list-cover strong {
    display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
    font: 700 13px/1.4 var(--font-serif);
}
.list-book-copy { min-width: 0; }
.list-book-copy h2 { margin: 6px 0 5px; font: 700 21px/1.4 var(--font-serif); }
.list-book-copy h2 a:hover { color: var(--accent); }
.list-book-copy p {
    display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-soft);
    -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 14px;
}
.list-latest { min-width: 0; display: grid; gap: 4px; text-align: right; }
.list-latest small, .list-latest time { color: var(--ink-soft); font-size: 11px; }
.list-latest a, .list-latest > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.list-latest a:hover { color: var(--accent); }
.pagination { display: flex; justify-content: center; gap: 7px; margin-top: 34px; }
.pagination a { min-width: 38px; height: 38px; display: grid; place-items: center; padding-inline: 12px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; }
.pagination a:hover, .pagination a.active { color: white; background: var(--green); border-color: var(--green); }

.book-hero { padding: 64px 0; background: linear-gradient(135deg, #eee7d9, #faf7f0); border-bottom: 1px solid var(--line); }
.book-hero-grid { display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: 54px; align-items: stretch; }
.detail-cover {
    --cover: #315c58; min-height: 360px; display: flex; flex-direction: column; justify-content: space-between;
    padding: 30px; color: #fff8ec; background: linear-gradient(90deg, rgba(0,0,0,.15), transparent 10%), var(--cover);
    border-radius: 5px 18px 18px 5px; box-shadow: 16px 22px 34px rgba(30, 52, 48, .18);
}
.detail-cover span, .detail-cover small { opacity: .8; }
.detail-cover strong { font: 700 31px/1.5 var(--font-serif); }
.book-detail { min-width: 0; }
.book-detail h1 { overflow-wrap: anywhere; }
.breadcrumbs, .reader-crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--ink-soft); font-size: 13px; }
.breadcrumbs a:hover, .reader-crumbs a:hover { color: var(--accent); }
.book-detail h1 { margin-block: 16px 8px; font-size: clamp(34px, 5vw, 56px); }
.canonical-name { margin: 0 0 22px; color: var(--accent); font-size: 14px; }
.detail-stats { display: flex; flex-wrap: wrap; gap: 0; margin-block: 22px; }
.detail-stats span { display: flex; min-width: 110px; flex-direction: column; padding: 0 22px; border-left: 1px solid var(--line); }
.detail-stats span:first-child { padding-left: 0; border-left: 0; }
.detail-stats strong { font-size: 18px; }
.detail-stats small { color: var(--ink-soft); }
.summary { max-width: 800px; color: var(--ink-soft); line-height: 1.85; }
.aliases-section { padding-bottom: 25px; }
.alias-list { display: flex; flex-wrap: wrap; gap: 10px; }
.alias-list a { max-width: 100%; padding: 9px 13px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; overflow-wrap: anywhere; font-size: 13px; }
.alias-list a:hover, .alias-list a.active { border-color: var(--green); color: var(--green); box-shadow: 0 0 0 2px rgba(29, 81, 77, .08); }
.alias-list small { margin-left: 5px; padding: 2px 5px; color: white; background: var(--accent); border-radius: 4px; }
.chapter-section { min-width: 0; padding-top: 35px; }
.chapter-grid { display: grid; width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.chapter-grid a { display: flex; min-width: 0; max-width: 100%; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chapter-grid a:hover { color: var(--accent); background: #fffaf0; }
.chapter-grid span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-grid small { flex: 0 0 auto; color: var(--ink-soft); white-space: nowrap; }

.reader-page { --reader-bg: #efe8da; --reader-card: #fbf8f1; }
.reader-page .site-header, .reader-page .site-footer { display: none; }
.reader-page main { min-height: 100vh; background: var(--reader-bg); transition: background .2s ease; }
.reader-toolbar {
    position: fixed; z-index: 20; left: 50%; top: 18px; transform: translateX(-50%);
    width: min(780px, calc(100% - 28px)); display: flex; justify-content: space-between;
    padding: 8px; background: rgba(255, 253, 248, .9); border: 1px solid var(--line);
    border-radius: 999px; box-shadow: 0 12px 28px rgba(31, 52, 48, .12); backdrop-filter: blur(12px);
}
.reader-toolbar button, .toolbar-back {
    min-width: 42px; border: 0; padding: 7px 12px; color: var(--ink);
    background: transparent; border-radius: 999px; cursor: pointer;
}
.reader-toolbar button:hover, .toolbar-back:hover { background: var(--paper-deep); }
.reader-shell {
    width: min(860px, calc(100% - 28px)); margin-inline: auto; padding: 110px clamp(24px, 6vw, 78px) 54px;
    background: var(--reader-card); min-height: 100vh; box-shadow: 0 0 55px rgba(32, 54, 48, .08);
    transition: color .2s ease, background .2s ease;
}
.chapter-header { margin: 48px 0 45px; padding-bottom: 32px; text-align: center; border-bottom: 1px solid var(--line); }
.chapter-header > span { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.chapter-header h1 { margin: 12px 0; font: 800 clamp(30px, 5vw, 44px)/1.3 var(--font-serif); }
.chapter-header p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.chapter-content { font: 400 18px/1.8 var(--font-reader); letter-spacing: .02em; text-rendering: optimizeLegibility; }
.chapter-content p { margin: 0 0 1.25em; text-indent: 2em; overflow-wrap: anywhere; }
.chapter-navigation { display: grid; grid-template-columns: 1fr auto 1fr; gap: 15px; align-items: center; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); }
.chapter-navigation > a:not(.directory-link), .chapter-navigation > span {
    display: flex; min-width: 0; flex-direction: column; padding: 12px; border-radius: 10px;
}
.chapter-navigation > :last-child { text-align: right; }
.chapter-navigation small { color: var(--ink-soft); }
.chapter-navigation span span, .chapter-navigation a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-navigation a:hover { color: var(--accent); background: var(--paper-deep); }
.chapter-navigation .disabled { opacity: .4; }
.directory-link { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; }
.reader-page.reader-night { --reader-bg: #080909; --reader-card: #141515; color: #deded8; }
.reader-page.reader-night .reader-toolbar { background: rgba(20,21,21,.94); border-color: #383a3a; }
.reader-page.reader-night .reader-toolbar button, .reader-page.reader-night .toolbar-back { color: #deded8; }
.reader-page.reader-night .reader-toolbar button:hover, .reader-page.reader-night .toolbar-back:hover,
.reader-page.reader-night .chapter-navigation a:hover { background: #262828; }
.reader-page.reader-night .chapter-header, .reader-page.reader-night .chapter-navigation { border-color: #383a3a; }
.reader-page.reader-night .chapter-header p, .reader-page.reader-night .reader-crumbs, .reader-page.reader-night .chapter-navigation small { color: #999e9b; }

.search-results { display: grid; gap: 14px; }
.search-results article { display: grid; grid-template-columns: 70px 1fr; gap: 18px; align-items: center; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.search-results article > div > small { color: var(--accent); }
.history-section { min-height: 430px; }
.history-toolbar strong { font: 700 22px/1.35 var(--font-serif); }
.history-clear, .history-remove {
    border: 0; padding: 7px 12px; color: var(--ink-soft); background: transparent;
    border-radius: 999px; cursor: pointer;
}
.history-clear { border: 1px solid var(--line); background: var(--card); }
.history-clear:hover, .history-remove:hover { color: var(--accent); background: var(--paper-deep); }
.history-list { border-top: 1px solid var(--line); }
.history-row {
    display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 20px;
    align-items: center; padding: 20px 8px; border-bottom: 1px solid var(--line);
}
.history-cover {
    --cover: #315c58; width: 64px; height: 86px; display: flex; flex-direction: column;
    justify-content: space-between; overflow: hidden; padding: 10px 8px; color: #fff8ed;
    background: linear-gradient(90deg, rgba(0,0,0,.16), transparent 14%), var(--cover);
    border-radius: 3px 8px 8px 3px; box-shadow: 5px 7px 14px rgba(32, 54, 48, .14);
}
.history-cover span { font-size: 8px; opacity: .78; }
.history-cover strong {
    display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
    font: 700 12px/1.4 var(--font-serif);
}
.history-copy { min-width: 0; }
.history-copy h2 { margin: 0 0 3px; font: 700 20px/1.4 var(--font-serif); }
.history-copy h2 a:hover { color: var(--accent); }
.history-copy p { margin: 2px 0; }
.history-meta, .history-progress { color: var(--ink-soft); font-size: 12px; }
.history-chapter { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.history-progress { display: block; margin-top: 4px; }
.history-actions { display: flex; align-items: center; gap: 6px; }
.history-actions .button { min-height: 40px; padding: 7px 17px; font-size: 14px; }
.history-empty { padding-top: 50px; }
.empty-state, .error-page { padding: 80px 20px; text-align: center; }
.empty-state h2, .error-page h1 { font: 800 32px/1.3 var(--font-serif); }
.empty-state p, .error-page p { color: var(--ink-soft); }
.error-page { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.error-code { color: var(--accent); font: 900 90px/1 Georgia, serif; opacity: .25; }
.site-footer { padding: 42px 0; color: #d7e0d9; background: #102e2c; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.footer-inner strong { color: white; font: 700 21px/1.3 var(--font-serif); }
.footer-inner p { max-width: 540px; margin: 6px 0 0; color: #aebcb5; font-size: 13px; }
.footer-domain { margin-left: 10px; color: #d49a62; font: 600 12px/1 var(--font-sans); letter-spacing: .08em; text-transform: lowercase; }
.footer-site-link { color: #d7e0d9; text-decoration-color: rgba(215, 224, 217, .45); text-underline-offset: 3px; }
.footer-site-link:hover { color: #fff; }

@media (max-width: 900px) {
    :root { --shell: min(100% - 28px, 760px); }
    .hero { min-height: auto; }
    .hero-grid { grid-template-columns: 1fr; padding-block: 58px; }
    .hero-stack { display: none; }
    .ranking-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-row { grid-template-columns: 60px 1fr; }
    .latest-chapter { grid-column: 2; text-align: left; }
    .traditional-book-row { grid-template-columns: 72px minmax(0, 1fr); }
    .list-cover { width: 64px; height: 86px; }
    .list-latest { grid-column: 2; text-align: left; }
    .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .history-row { grid-template-columns: 64px minmax(0, 1fr); }
    .history-actions { grid-column: 2; }
}

@media (max-width: 640px) {
    :root { --shell: calc(100% - 24px); --radius: 14px; }
    .header-main { min-height: 68px; gap: 12px; }
    .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 21px; box-shadow: 4px 4px 0 var(--gold); }
    .brand-text small { display: none; }
    .brand-text strong { font-size: 17px; }
    .header-main { flex-wrap: wrap; padding-block: 12px; }
    .header-tools { width: 100%; gap: 8px; }
    .search-form { width: auto; flex: 1; }
    .search-form input { padding: 9px 12px; }
    .search-form button { padding-inline: 13px; }
    .header-history { min-height: 40px; padding: 7px 12px; }
    .nav-scroll a { padding: 10px 14px; }
    .domain-reminder { min-height: 27px; }
    .domain-reminder span { font-size: 10px; letter-spacing: .18em; }
    .hero-grid { padding-block: 48px; }
    .hero h1 { font-size: 42px; }
    .hero-copy > p { font-size: 16px; }
    .ranking-grid { grid-template-columns: minmax(0, 1fr); }
    .section { padding-block: 48px; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .latest-row { padding-block: 18px; }
    .latest-main p { display: none; }
    .page-banner { padding-block: 42px; }
    .toolbar { align-items: flex-start; flex-direction: column; }
    .traditional-book-row { gap: 13px; padding: 17px 4px; }
    .list-book-copy h2 { font-size: 18px; }
    .list-book-copy p { -webkit-line-clamp: 3; font-size: 13px; }
    .book-hero { padding-block: 40px; }
    .book-hero-grid { grid-template-columns: 105px 1fr; gap: 22px; align-items: start; }
    .detail-cover { min-height: 170px; padding: 15px 12px; border-radius: 3px 10px 10px 3px; }
    .detail-cover strong { font-size: 17px; }
    .detail-cover span, .detail-cover small { font-size: 10px; }
    .book-detail h1 { font-size: 29px; margin-top: 12px; }
    .detail-stats { gap: 10px; }
    .detail-stats span { min-width: 0; padding: 0 10px; }
    .detail-stats strong { font-size: 14px; }
    .summary { grid-column: 1 / -1; }
    .chapter-grid { grid-template-columns: minmax(0, 1fr); }
    .history-row { gap: 14px; padding: 17px 4px; }
    .history-copy h2 { font-size: 18px; }
    .history-chapter { white-space: normal; }
    .history-actions { flex-wrap: wrap; }
    .reader-shell { width: 100%; padding-inline: 20px; }
    .chapter-header { margin-top: 34px; }
    .chapter-content { font-size: 18px; line-height: 1.8; }
    .chapter-navigation { grid-template-columns: 1fr 1fr; }
    .directory-link { grid-column: 1 / -1; grid-row: 2; text-align: center; }
    .footer-inner { align-items: flex-start; flex-direction: column; gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
