/* ==========================================================================
   漫屿 MANYU · WAP 基础层
   ========================================================================== */

:root {
    --paper: #f6f1e6;
    --card: #fffdf8;
    --card-2: #faf6ec;
    --ink: #1b1a16;
    --ink-2: #575249;
    --ink-3: #8f887a;
    --line: #e5dbc8;
    --line-2: #d3c5ab;
    --brand: #2046c9;
    --brand-d: #16339a;
    --brand-soft: #e9edfb;
    --coral: #df5539;
    --coral-soft: #fbeae5;
    --gold: #a97b1c;
    --deep: #161a2c;
    --r: 4px;
    --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
    --mono: "DIN Alternate", "SF Mono", "Consolas", "Roboto Mono", monospace;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding-bottom: calc(58px + var(--safe-b));
    color: var(--ink);
    background: var(--paper);
    font: 14px/1.65 "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
body.has-dock { padding-bottom: calc(62px + var(--safe-b)); }
body.reader, body.no-dock { padding-bottom: 0; }

h1, h2, h3, h4, p, dl, dd, dt, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; border: 0; vertical-align: middle; }
button, input, textarea, select { font: inherit; color: inherit; }
button { padding: 0; border: 0; background: none; cursor: pointer; }
table { border-collapse: collapse; border-spacing: 0; }
em, i { font-style: normal; }
svg { overflow: hidden; }

::selection { background: var(--brand); color: #fff; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 800; letter-spacing: .01em; }

.icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -.14em;
    fill: currentColor;
    flex: none;
}

.u-hidden, .hide { display: none !important; }
.t-mute { color: var(--ink-3); }
.t-ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.t-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.t-clamp-2, .t-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.t-clamp-2 { -webkit-line-clamp: 2; }
.t-clamp-3 { -webkit-line-clamp: 3; }

.pic { display: block; position: relative; overflow: hidden; background: #e8e1d3; }
.pic img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s ease; }
.pic.is-ready img { opacity: 1; }

/* ---------- 骨架屏 ---------- */
.sk {
    position: fixed;
    inset: 0;
    z-index: 900;
    padding: 16px 14px;
    background: var(--paper);
    overflow: hidden;
    transition: opacity .28s ease;
}
.sk.is-off { opacity: 0; }
.sk__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sk__line, .sk__box {
    display: block;
    background: linear-gradient(90deg, #e8e0d0 25%, #f4eee2 42%, #e8e0d0 62%);
    background-size: 420% 100%;
    animation: skShine 1.3s linear infinite;
    border-radius: 3px;
}
.sk__line { height: 12px; margin-bottom: 10px; }
.sk__box { border-radius: 4px; }
.sk__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sk__card { aspect-ratio: 3 / 4; height: auto; }
.sk[data-dark] { background: #161a1f; }
.sk[data-dark] .sk__line,
.sk[data-dark] .sk__box { background: linear-gradient(90deg, #242a31 25%, #333b44 42%, #242a31 62%); background-size: 420% 100%; }

@keyframes skShine {
    0% { background-position: 100% 0; }
    100% { background-position: -20% 0; }
}

/* ---------- 轻提示 ---------- */
.toast-wrap {
    position: fixed;
    left: 50%;
    top: 68px;
    z-index: 999;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: 86vw;
    padding: 9px 15px;
    background: rgba(22, 26, 44, .94);
    border-radius: 20px;
    color: #fff;
    font-size: 12.5px;
    box-shadow: 0 12px 30px -14px rgba(0, 0, 0, .6);
}
.toast .icon { color: #ffd36e; }

/* ---------- 空状态 ---------- */
.empty {
    margin: 14px;
    padding: 30px 16px;
    border: 1px dashed var(--line-2);
    border-radius: var(--r);
    background: var(--card);
    color: var(--ink-3);
    font-size: 12.5px;
    line-height: 1.9;
    text-align: center;
}
.empty b { display: block; margin-bottom: 5px; color: var(--ink); font-family: var(--serif); font-size: 16px; }
.empty a:not(.btn) { color: var(--brand); }

/* ---------- 分页 ---------- */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 0 6px;
}
.pager a, .pager span {
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--ink-2);
    font-size: 12.5px;
}
.pager .on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .is-disabled { opacity: .4; pointer-events: none; }
