/* ManhDes — FendyCode design system layout, ManhDes colors + font */

@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-700.woff2") format("woff2"); }

/* ---------- Color block (the only part that differs per site) ---------- */
:root,
:root[data-theme="dark"] {
    --accent: #5BE04A;
    --accent-hover: #7FEA71;
    --accent-soft: rgba(91, 224, 74, 0.14);
    --on-accent: #04130A;
    --bg: #060A07;
    --surface: #0D140F;
    --surface-2: #131D16;
    --line: #1D2B21;
    --text: #E9F3EB;
    --text-2: #A9BCAE;
    --text-3: #809486;
    --ok: #5BE04A;
    --warn: #F5C451;
    --danger: #F87171;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
}
:root[data-theme="light"] {
    --accent: #15803D;
    --accent-hover: #116A32;
    --accent-soft: #E1F3E6;
    --on-accent: #FFFFFF;
    --bg: #F3F7F4;
    --surface: #FFFFFF;
    --surface-2: #F0F5F1;
    --line: #DCE7DF;
    --text: #0B1A10;
    --text-2: #3D5244;
    --text-3: #55695B;
    --ok: #15803D;
    --warn: #A16207;
    --danger: #B91C1C;
    --shadow: 0 10px 30px rgba(16, 40, 24, .12);
    color-scheme: light;
}
:root {
    --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Fixed tokens (same on every FendyCode site) */
    --topbar-h: 60px;
    --sidebar-w: 248px;
    --bottom-h: 64px;
    --control-h: 44px;
    --r-btn: 10px;
    --r-panel: 14px;
    --content-max: 1040px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.icon { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--accent); color: var(--on-accent); border-radius: var(--r-btn); }
.skip:focus { left: 8px; }
.muted { color: var(--text-3); }
[hidden] { display: none !important; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.sidebar { display: none; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.brand img { height: 40px; width: auto; border-radius: 8px; }
.brand-top { flex: none; }
.topbar-title { display: none; font-weight: 600; font-size: 17px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.top-search { display: none; }

.icon-btn {
    width: var(--control-h); height: var(--control-h);
    display: inline-grid; place-items: center;
    border: 0; border-radius: var(--r-btn);
    background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.is-disabled { opacity: .35; pointer-events: none; }
.icon-btn-accent { background: var(--accent); color: var(--on-accent); }
.icon-btn-accent:hover { background: var(--accent-hover); color: var(--on-accent); }
:root[data-theme="dark"] .icon-sun, :root[data-theme="light"] .icon-moon { display: block; }
:root[data-theme="dark"] .icon-moon, :root[data-theme="light"] .icon-sun { display: none; }

.content {
    flex: 1;
    width: 100%; max-width: calc(var(--content-max) + 32px);
    margin: 0 auto;
    padding: 16px 16px calc(var(--bottom-h) + 40px);
}
.footer {
    display: none;
    justify-content: space-between; gap: 12px;
    padding: 20px 24px; border-top: 1px solid var(--line);
    color: var(--text-3); font-size: 14px;
}
.footer a:hover { color: var(--accent); }

/* Bottom nav (mobile): exactly 5 items, the middle one raised */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--surface);
    border-top: 1px solid var(--line);
}
.bn-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--text-3); font-size: 12px; font-weight: 500;
    min-width: 0;
}
.bn-item.is-active { color: var(--accent); }
.bn-label { white-space: nowrap; }
.bn-primary { justify-content: flex-end; padding-bottom: 6px; color: var(--text-2); }
.bn-primary .bn-icon {
    width: 58px; height: 58px; margin-top: -30px; margin-bottom: 2px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--accent); color: var(--on-accent);
    border: 4px solid var(--bg);
    box-shadow: var(--shadow);
}
.bn-primary.is-active { color: var(--accent); }

@media (min-width: 992px) {
    .app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
    .sidebar {
        display: flex; flex-direction: column; gap: 4px;
        position: sticky; top: 0; height: 100vh; overflow-y: auto;
        padding: 16px 12px;
        background: var(--surface);
        border-right: 1px solid var(--line);
    }
    .sidebar .brand { padding: 4px 8px 16px; }
    .sidebar .brand img { height: 56px; }
    .brand-top { display: none; }
    .topbar { padding: 0 24px; gap: 16px; }
    .topbar-title { display: block; flex: 0 1 auto; }
    .top-search { display: flex; }
    .top-search + .topbar-actions { margin-left: 0; }
    .top-search-btn { display: none; }
    .bottom-nav { display: none; }
    .content { padding: 24px 24px 48px; }
    .footer { display: flex; }
}

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
    display: flex; align-items: center; gap: 12px;
    height: var(--control-h); padding: 0 12px;
    border-radius: var(--r-btn);
    color: var(--text-2); font-weight: 500;
}
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-link-sm { height: 40px; font-size: 15px; }
.side-label { margin: 16px 12px 4px; font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.side-contact {
    margin-top: auto;
    display: flex; align-items: center; gap: 10px;
    padding: 12px; border: 1px solid var(--line); border-radius: var(--r-btn);
    color: var(--text-2);
}
.side-contact span { display: flex; flex-direction: column; line-height: 1.3; }
.side-contact strong { color: var(--text); font-weight: 600; font-size: 15px; }
.side-contact small { font-size: 13px; color: var(--text-3); }
.side-contact:hover { border-color: var(--accent); }

/* ---------- Live search ---------- */
.top-search {
    position: relative;
    flex: 1; max-width: 440px; margin-left: auto;
    align-items: center; gap: 8px;
    height: var(--control-h); padding: 0 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-btn);
    color: var(--text-3);
}
.top-search:focus-within { border-color: var(--accent); }
.top-search input, .search-box input, .mini-search input {
    flex: 1; min-width: 0; height: 100%;
    border: 0; outline: 0; background: transparent; color: var(--text);
}
input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1); }
.live-results {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    max-height: min(70vh, 520px); overflow-y: auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
    box-shadow: var(--shadow);
    padding: 6px;
}
.live-item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--r-btn); }
.live-item:hover, .live-item.is-focus { background: var(--surface-2); }
.live-item img, .live-item .img-empty { width: 40px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--surface-2); flex: none; }
.live-item-text { min-width: 0; display: flex; flex-direction: column; }
.live-item-title { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-item-sub { font-size: 14px; color: var(--text-3); }
.live-msg { padding: 14px 12px; color: var(--text-3); font-size: 15px; }
.live-all { display: block; padding: 10px 12px; color: var(--accent); font-weight: 600; border-top: 1px solid var(--line); margin-top: 4px; }

.search-box {
    display: flex; align-items: center; gap: 10px;
    height: 52px; padding: 0 4px 0 14px; margin-bottom: 20px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
    color: var(--text-3);
}
.search-box:focus-within { border-color: var(--accent); }
.search-box .btn { height: 44px; }
.live-inline .live-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 6px; }
.result-count { color: var(--text-2); margin-bottom: 12px; }
.search-hint .chips { margin-top: 8px; }

/* ---------- Building blocks ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-title, .section-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; letter-spacing: .01em; }
.panel-title .icon, .section-title .icon { color: var(--accent); }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title { font-size: 20px; }
.link-more { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 600; font-size: 15px; white-space: nowrap; }
.link-more:hover { color: var(--accent-hover); }
.page-head { margin-bottom: 16px; }
.page-title { font-size: 26px; line-height: 1.2; font-weight: 700; }
.page-sub { color: var(--text-3); margin-top: 4px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; margin-bottom: 12px; min-height: 32px; }
.back-link:hover { color: var(--accent); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: var(--control-h); padding: 0 18px;
    border-radius: var(--r-btn); border: 1px solid transparent;
    font-weight: 600; font-size: 16px; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.text-btn { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 8px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
    border-radius: 999px; border: 1px solid var(--line);
    font-size: 14px; font-weight: 500; color: var(--text-2);
}
.chip-link { height: 36px; padding: 0 14px; font-size: 15px; }
.chip-link:hover { border-color: var(--accent); color: var(--accent); }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
    display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
    border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
    font-size: 13px; font-weight: 600; color: var(--text-2);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-on { color: var(--ok); }
.status-done { color: var(--text-2); }

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: none; display: inline-flex; align-items: center; height: 40px; padding: 0 16px;
    border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
    color: var(--text-2); font-weight: 600; font-size: 15px;
}
.tab:hover { color: var(--text); border-color: var(--text-3); }
.tab.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.notice {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 16px;
    border-radius: var(--r-btn); border: 1px solid var(--line);
    background: var(--surface); color: var(--text-2); font-size: 15px;
}
.notice .icon { color: var(--warn); margin-top: 2px; }
.empty { padding: 20px 16px; color: var(--text-3); }
.empty a { color: var(--accent); font-weight: 600; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 40px 20px; }
.empty-state > .icon { color: var(--text-3); margin-bottom: 6px; }
.empty-state .btn-row { margin-top: 10px; justify-content: center; }
.empty-state > .btn { margin-top: 10px; }

/* Images */
.img-empty { display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
img.is-broken { visibility: hidden; }
.cover-img { width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }

/* ---------- Home ---------- */
.home-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.feature { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; padding: 16px; }
.feature-body > * { min-width: 0; }
.feature-cover { display: block; aspect-ratio: 12 / 17; border-radius: var(--r-btn); overflow: hidden; align-self: start; }
.feature-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.feature-title { font-size: 24px; line-height: 1.15; font-weight: 700; }
.feature-title a:hover { color: var(--accent); }
.feature-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-3); font-size: 15px; }
.feature-meta span:not(:last-child)::after { content: "·"; margin-left: 12px; color: var(--text-3); }
.feature-synopsis { color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feature .btn-row { margin-top: 4px; }
@media (max-width: 599px) {
    .feature .chips, .feature-synopsis { grid-column: 1 / -1; }
    .feature-body { display: contents; }
    .feature-body > .eyebrow, .feature-body > .feature-title, .feature-body > .feature-meta { grid-column: 2; }
    .feature-cover { grid-row: 1 / span 3; }
    .feature .btn-row { grid-column: 1 / -1; }
    .feature .btn-row .btn { flex: 1; }
}
@media (min-width: 600px) {
    .feature { grid-template-columns: 180px minmax(0, 1fr); gap: 20px; padding: 20px; }
    .feature-title { font-size: 30px; }
}

.rank-list { padding: 6px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-btn); }
.rank-row:hover { background: var(--surface-2); }
.rank-num { width: 22px; flex: none; text-align: center; font-weight: 700; font-size: 20px; color: var(--text-3); }
.rank-list li:nth-child(-n+3) .rank-num { color: var(--accent); }
.rank-thumb { width: 44px; height: 62px; flex: none; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.rank-text { min-width: 0; display: flex; flex-direction: column; }
.rank-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { font-size: 14px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-extra { display: none; }

@media (min-width: 600px) {
    .rank-extra { display: block; }
    .rank-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
}
@media (min-width: 1200px) {
    .home-top { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .feature { grid-template-columns: 180px minmax(0, 1fr); }
    .rank-list { display: block; }
    .rank-extra { display: none; }
    .rank-thumb { width: 38px; height: 54px; }
    .rank-row { padding: 6px 10px; }
}

/* Cover grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
@media (min-width: 360px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-cover {
    position: relative; display: block; aspect-ratio: 12 / 17;
    border-radius: var(--r-btn); overflow: hidden;
    background: var(--surface-2); border: 1px solid var(--line);
}
.card-cover .img-empty { position: absolute; inset: 0; }
.card:hover .card-cover { border-color: var(--accent); }
.card:hover .card-title { color: var(--accent); }
.type-badge {
    position: absolute; top: 6px; left: 6px;
    height: 22px; padding: 0 8px; display: inline-flex; align-items: center;
    border-radius: 6px; font-size: 12px; font-weight: 700;
    background: rgba(6, 10, 7, .82); color: #E9F3EB;
}
.card-title { font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 13px; color: var(--text-3); line-height: 1.35; }
.card-ch { color: var(--accent); font-weight: 600; }
@media (min-width: 640px) { .card-title { font-size: 16px; } .card-meta { font-size: 14px; } }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 24px; }
.pager > :last-child { justify-self: end; }
.pager-num { color: var(--text-3); font-size: 15px; }
@media (max-width: 420px) { .pager .btn { padding: 0 12px; } }

/* Trending page */
.trend-full { padding: 6px; }
.trend-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-btn); }
.trend-item + .trend-item { border-top: 1px solid var(--line); border-radius: 0; }
.rank-num-lg { width: 28px; font-size: 24px; }
.trend-full li:nth-child(-n+3) .rank-num { color: var(--accent); }
.trend-cover { width: 64px; flex: none; aspect-ratio: 12/17; border-radius: 8px; overflow: hidden; }
.trend-text { flex: 1; min-width: 0; font-size: 15px; }
.trend-title { display: block; font-weight: 700; font-size: 17px; line-height: 1.25; margin-bottom: 2px; }
.trend-title:hover { color: var(--accent); }
@media (max-width: 479px) { .trend-read span { display: none; } .trend-read { width: 40px; padding: 0; } }
@media (min-width: 640px) { .trend-cover { width: 80px; } }

/* ---------- Series detail ---------- */
.series-head { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 16px; }
.series-cover { aspect-ratio: 12 / 17; border-radius: var(--r-btn); overflow: hidden; align-self: start; }
.series-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.series-title { font-size: 24px; line-height: 1.15; font-weight: 700; }
.series-alt { color: var(--text-3); margin-top: -4px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 13px; color: var(--text-3); }
.facts dd { margin: 0; font-weight: 600; }
@media (max-width: 599px) {
    .series-info { display: contents; }
    .series-info > .badges, .series-info > .series-title, .series-info > .series-alt { grid-column: 2; }
    .series-cover { grid-row: 1 / span 4; }
    .series-info > .facts, .series-info > .chips, .series-info > .btn-row { grid-column: 1 / -1; }
    .series-head .btn-row .btn { flex: 1; }
}
@media (min-width: 600px) {
    .series-head { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; padding: 24px; }
    .series-title { font-size: 32px; }
}
.synopsis { margin-top: 16px; padding: 16px; }
.synopsis-text { margin-top: 10px; color: var(--text-2); }
.synopsis-text p + p { margin-top: 10px; }
.synopsis-text.is-clamped { max-height: 7.5em; overflow: hidden; }

.chapters { margin-top: 16px; }
.chapters-head { flex-wrap: wrap; }
.count { display: inline-grid; place-items: center; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; }
.chapters-tools { display: flex; gap: 6px; align-items: center; flex: 1; justify-content: flex-end; min-width: 220px; }
.mini-search {
    display: flex; align-items: center; gap: 8px; flex: 1; max-width: 260px;
    height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-btn); color: var(--text-3);
}
.mini-search:focus-within { border-color: var(--accent); }
.chapter-list { max-height: 620px; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; }
.chapter-list.is-reversed { flex-direction: column-reverse; justify-content: flex-end; }
.chapter-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--control-h); padding: 8px 12px; border-radius: var(--r-btn); }
.chapter-list a:hover { background: var(--accent-soft); }
.chapter-list a:hover b { color: var(--accent); }
.chapter-list b { font-weight: 600; }
.chapter-list i { font-style: normal; font-size: 14px; color: var(--text-3); white-space: nowrap; }
.chapter-list a:visited b { color: var(--text-3); }

/* ---------- About ---------- */
.about { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.about-logo { border-radius: var(--r-panel); overflow: hidden; background: #000; border: 1px solid var(--line); }
.about .panel:not(.list-panel) { padding: 20px; }
.about-text { color: var(--text-2); margin-top: 10px; }
.list-panel { padding: 6px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-btn); }
.list-row + .list-row { border-top: 1px solid var(--line); border-radius: 0; }
a.list-row:hover { background: var(--surface-2); }
.list-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: var(--r-btn); background: var(--accent-soft); color: var(--accent); }
.list-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-text small { color: var(--text-3); font-size: 15px; }
.list-go { color: var(--text-3); }

/* ---------- Reader ---------- */
.reader-body { background: var(--bg); }
.reader-top {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h); display: flex; align-items: center; gap: 8px; padding: 0 8px;
    background: var(--bg); border-bottom: 1px solid var(--line);
}
.reader-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.reader-series { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-series:hover { color: var(--accent); }
.reader-chapter { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-logo { display: none; }
.reader-logo img { height: 32px; width: auto; border-radius: 6px; }
@media (min-width: 640px) { .reader-logo { display: block; } .reader-top { padding: 0 16px; } }

.reader { max-width: 820px; margin: 0 auto; padding: 0 0 calc(var(--bottom-h) + 24px); }
.reader-info { text-align: center; color: var(--text-3); font-size: 14px; padding: 10px 0; }
.pages { display: flex; flex-direction: column; background: #000; }
.page { position: relative; margin: 0; }
.page img { width: 100%; height: auto; }
.page.is-loading { min-height: 70vh; background: var(--surface); }
.page.is-loading + .page.is-loading { border-top: 1px solid var(--line); }
.page-spinner {
    display: none; position: absolute; top: 40px; left: 50%; margin-left: -18px;
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid var(--line); border-top-color: var(--accent);
    animation: spin .8s linear infinite;
}
.page.is-loading .page-spinner { display: block; }
.page.is-error .page-spinner { display: none; }
.page.is-error { min-height: 240px; background: var(--surface); }
.page.is-error img { display: none; }
.page-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-2); font-size: 15px; padding: 16px; text-align: center; }
.page.is-error .page-error[hidden] { display: flex !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .page-spinner { animation-duration: 2.4s; } }

.reader-end { margin: 16px; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.reader-end .btn-row { justify-content: center; }

.reader-bar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40;
    width: min(560px, calc(100% - 16px));
    display: flex; align-items: center; gap: 6px; padding: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
    box-shadow: var(--shadow);
}
.chapter-select {
    position: relative; flex: 1; min-width: 0; height: var(--control-h);
    display: flex; align-items: center;
    border: 1px solid var(--line); border-radius: var(--r-btn); background: var(--surface-2);
}
.chapter-select select {
    appearance: none; -webkit-appearance: none; width: 100%; height: 100%;
    padding: 0 36px 0 12px; border: 0; background: transparent; font-weight: 600; cursor: pointer;
    text-overflow: ellipsis;
}
.chapter-select select option { background: var(--surface); color: var(--text); }
.chapter-select .icon { position: absolute; right: 12px; pointer-events: none; color: var(--text-3); }
.chapter-select-static { padding: 0 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
