:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --border: #e4e7ec;
    --text: #1f2430;
    --muted: #6b7280;
    --brand: #2563eb;
    --brand-soft: #eff4ff;
    --chip: #f1f3f7;
    --radius: 12px;
    --maxw: 2560px;   /* 内容最大宽度：配合 masonry 列宽，大屏自动铺开更多列 */
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 14px rgba(16, 24, 40, .05);
}

:root.dark {
    --bg: #0f1216;
    --panel: #181c24;
    --border: #2a313d;
    --text: #e6e9ef;
    --muted: #8d95a4;
    --brand: #6c8eff;
    --brand-soft: #1e2742;
    --chip: #232936;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 64px; }

/* ---------------- header ---------------- */
.site-head {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
}
.site-head .inner {
    max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.logo { font-size: 17px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.logo span { color: var(--brand); }
.stat-mini { color: var(--muted); font-size: 13px; margin-left: auto; }

.search-bar { display: flex; gap: 8px; flex: 1 1 320px; max-width: 520px; }
.search-bar input {
    flex: 1; padding: 8px 12px; border: 1px solid var(--border);
    border-radius: 9px; background: #fff; font-size: 14px; color: var(--text);
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.search-bar input:focus {
    border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.search-bar button, .btn {
    padding: 8px 16px; border: 1px solid var(--border); background: #fff;
    border-radius: 9px; font-size: 14px; cursor: pointer; color: var(--text);
    transition: background .15s, border-color .15s;
}
.search-bar button:hover, .btn:hover { background: var(--chip); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.random-btn { white-space: nowrap; }
.random-btn:disabled { opacity: .6; cursor: default; }

/* ---------------- filter chips ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0 6px; }
.chip {
    padding: 5px 13px; border-radius: 999px; background: var(--chip);
    border: 1px solid transparent; color: var(--muted); font-size: 13px;
}
.chip:hover { background: #e8ebf1; text-decoration: none; }
.chip.on { background: var(--brand-soft); border-color: #c7d9ff; color: var(--brand); font-weight: 600; }
.chip .n { opacity: .6; margin-left: 4px; font-size: 12px; }

/* ---------------- masonry gallery ---------------- */
/* 列数随容器宽度自适应铺满：column-width 定最小列宽，column-count 不设上限。
   1920px 屏 ≈ 6 列，2560px 屏 ≈ 8 列，宽屏自动更多；调列宽改这里的 280px 即可。 */
.masonry { column-width: 280px; column-gap: 18px; margin-top: 18px; }
.card {
    break-inside: avoid; margin: 0 0 18px; background: var(--panel);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
    display: block; color: inherit;
    content-visibility: auto; contain-intrinsic-size: auto 340px;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(16, 24, 40, .12); text-decoration: none; }
.card .thumb {
    display: block; width: 100%; background: #eef0f4; overflow: hidden;
}
.card .thumb img {
    display: block; width: 100%; height: auto;
    opacity: 0; transition: opacity .35s ease;
}
.card .thumb img.on { opacity: 1; }
.card .thumb .ph { height: 180px; display: grid; place-items: center; color: #b6bcc7; font-size: 13px; }
.card .body { padding: 11px 14px 14px; }
.card .t {
    font-size: 14px; font-weight: 600; line-height: 1.45; margin: 0 0 8px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag {
    font-size: 11.5px; padding: 2px 8px; border-radius: 6px;
    background: var(--chip); color: var(--muted);
}
.tag.model { background: var(--brand-soft); color: var(--brand); }
.tag.video { background: #fff2e6; color: #c2410c; }
:root.dark .tag.video { background: #4a2e15; color: #f6a96c; }

/* ---------------- theme switcher ---------------- */
.theme-toggle {
    border: 1px solid var(--border); background: var(--panel); color: var(--text);
    width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s ease;
}
.theme-toggle:hover { background: var(--chip); }
.theme-toggle svg { width: 18px; height: 18px; fill: currentColor; }
:root.dark .theme-toggle .sun  { display: block; }
:root.dark .theme-toggle .moon { display: none; }
:root:not(.dark) .theme-toggle .sun  { display: none; }
:root:not(.dark) .theme-toggle .moon { display: block; }

/* ---------------- keyboard hint ---------------- */
.kbd {
    display: inline-block; min-width: 18px; padding: 1px 6px;
    border: 1px solid var(--border); border-radius: 4px;
    background: var(--chip); color: var(--text); font: 11px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
    text-align: center;
}
.kbd-hint {
    margin: 14px 0 0; color: var(--muted); font-size: 12.5px;
    display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
}

/* ---------------- pager ---------------- */
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; padding: 28px 0 0; flex-wrap: wrap; }
.pager a, .pager span {
    padding: 7px 13px; border-radius: 9px; border: 1px solid var(--border);
    background: #fff; font-size: 14px; color: var(--text);
}
.pager a:hover { background: var(--chip); text-decoration: none; }
.pager .cur { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* ---------------- detail ---------------- */
.detail { background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
          box-shadow: var(--shadow); overflow: hidden; margin-top: 20px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-media { background: #f0f2f6; border-right: 1px solid var(--border); }
.detail-media img {
    display: block; width: 100%; height: auto;
    /* 单图不超一屏：超过视口高度时按高度约束等比缩放（点击仍可全屏看原图） */
    max-height: 100vh; object-fit: contain;
    margin-left: auto; margin-right: auto;
}
.detail-side { padding: 22px 26px 28px; min-width: 0; }
.detail-side h1 { font-size: 21px; line-height: 1.4; margin: 0 0 14px; }

.kv { display: grid; grid-template-columns: 74px 1fr; gap: 7px 12px; font-size: 13.5px; margin-bottom: 20px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

.prompt-block { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.prompt-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 12px; background: #fafbfc; border-bottom: 1px solid var(--border);
}
.prompt-head .lbl { font-size: 13px; font-weight: 600; }
.prompt-head .ops { display: flex; gap: 8px; align-items: center; }
.copy {
    border: 1px solid var(--border); background: #fff; border-radius: 7px;
    padding: 4px 11px; font-size: 12.5px; cursor: pointer; color: var(--text);
}
.copy:hover { background: var(--chip); }
.copy.ok { background: #e7f7ee; border-color: #b7e4cb; color: #0f7a45; }
.prompt-block pre {
    margin: 0; padding: 14px 16px; max-height: 380px; overflow: auto;
    background: #fff; font: 12.8px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap; word-break: break-word; color: #2a3040;
}

.back { display: inline-block; margin: 20px 0 0; font-size: 14px; }

/* 图片淡入 + 破图兜底 */
.card .thumb img, .detail-media img { opacity: 0; transition: opacity .3s ease; }
.card .thumb img.on, .detail-media img.on { opacity: 1; }
.detail-media img { display: block; width: 100%; height: auto; }
.detail-media .nopic { height: 320px; display: grid; place-items: center; color: #b6bcc7; }
.video-block { padding: 16px; background: var(--panel); border-top: 1px solid var(--border); }
.video-block .sec-title { margin: 0 0 12px; }
.video-block video { display: block; width: 100%; border-radius: 10px; background: #000; max-height: 520px; }

.sec-title {
    font-size: 15px; font-weight: 600; margin: 4px 0 10px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sec-title .copy-all { padding: 5px 12px; font-size: 12.5px; }
.muted { color: var(--muted); font-weight: 400; }
.nav-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.result-line { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }
.pager .gap { border: 0; background: transparent; color: var(--muted); padding: 7px 4px; }

.empty { text-align: center; padding: 90px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }

.toast {
    position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(12px);
    background: #111827; color: #fff; padding: 9px 18px; border-radius: 9px;
    font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 99;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 提示词 中/英 tab ---------------- */
.prompt-tabs { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--border); }
.ptab {
    border: 0; background: transparent; padding: 8px 16px; cursor: pointer;
    font-size: 13.5px; color: var(--muted); font-weight: 500;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color .15s, border-color .15s;
}
.ptab:hover { color: var(--text); }
.ptab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.ppanel { display: none; }
.ppanel.on { display: block; }

/* ---------------- 详情图片：点击放大 ---------------- */
.detail-media .dimg { cursor: zoom-in; }

/* ---------------- Lightbox 全屏看图 ---------------- */
.lb {
    position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92);
    display: none; align-items: center; justify-content: center;
}
.lb.on { display: flex; }
.lb-img {
    max-width: 92vw; max-height: 88vh; object-fit: contain;
    border-radius: 6px; box-shadow: 0 12px 48px rgba(0, 0, 0, .6);
    animation: lbIn .18s ease;
}
@keyframes lbIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.lb-close, .lb-prev, .lb-next {
    position: absolute; z-index: 2; width: 46px; height: 46px; border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .3); }
.lb-close { top: 20px; right: 24px; font-size: 30px; }
.lb-prev  { left: 20px;  top: 50%; margin-top: -23px; }
.lb-next  { right: 20px; top: 50%; margin-top: -23px; }
.lb-count {
    position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 13px; background: rgba(0, 0, 0, .55);
    padding: 5px 14px; border-radius: 999px; letter-spacing: .5px;
}
@media (max-width: 640px) {
    .lb-prev { left: 8px; } .lb-next { right: 8px; }
    .lb-close { top: 12px; right: 14px; }
    .lb-close, .lb-prev, .lb-next { width: 40px; height: 40px; font-size: 22px; }
}
.lb-fig { position: relative; display: flex; align-items: center; justify-content: center; }

/* ---------------- 图片水印（文案由 config 自定义，底部居中；空则不显示） ---------------- */
.card .thumb, .dimg-wrap, .lb-fig { position: relative; }
.dimg-wrap { display: block; }
.card .thumb::after,
.gcard-thumb::after,
.dimg-wrap::after,
.lb-fig::after {
    content: var(--wm-text, "");
    position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
    max-width: 92%; color: #fff; font-size: 12.5px; font-weight: 600; letter-spacing: 1px;
    line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .8), 0 0 2px rgba(0, 0, 0, .55);
    opacity: .92; pointer-events: none; z-index: 3;
}
/* 详情大图 / lightbox 上的水印略大一些 */
.dimg-wrap::after, .lb-fig::after { font-size: 15px; bottom: 16px; letter-spacing: 1.5px; }

/* ---------------- 页脚（JS 注入：footer.js） ---------------- */
.site-foot { border-top: 1px solid var(--border); background: var(--panel); margin-top: 40px; }
.site-foot .inner {
    max-width: var(--maxw); margin: 0 auto; padding: 22px 24px 28px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    text-align: center; color: var(--muted); font-size: 13px;
}
.site-foot .inner a { color: var(--muted); text-decoration: none; }
.site-foot .inner a:hover { color: var(--brand); text-decoration: underline; }
.foot-stats { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.foot-stats b { color: var(--text); font-weight: 700; }
.foot-stats:empty { display: none; }
.foot-nav {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 6px 4px; line-height: 1.6;
}
.foot-sep { margin: 0 6px; color: var(--border); user-select: none; }
.foot-nav-btn {
    border: 0; background: none; padding: 0; margin: 0;
    color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
    text-decoration: none;
}
.foot-nav-btn:hover { color: var(--brand); text-decoration: underline; }
.foot-copy, .foot-beian { margin: 0; line-height: 1.5; }
.foot-beian { font-size: 12px; opacity: .9; }

/* 页脚说明弹窗 */
.foot-modal {
    position: fixed; inset: 0; z-index: 140; background: rgba(15, 18, 22, .55);
    display: none; align-items: center; justify-content: center; padding: 20px;
    backdrop-filter: blur(2px);
}
.foot-modal.on { display: flex; }
.foot-modal-box {
    width: min(560px, 94vw); max-height: 82vh; overflow: auto;
    background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35); padding: 18px 20px 22px;
}
.foot-modal-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
    position: sticky; top: 0; background: var(--panel); padding-bottom: 4px; z-index: 1;
}
.foot-modal-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--text); }
.foot-modal-close {
    margin-left: auto; border: 0; background: var(--chip); color: var(--text);
    width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer;
}
.foot-modal-close:hover { background: #e8ebf1; }
.foot-modal-body { color: var(--text); font-size: 13.5px; line-height: 1.75; text-align: left; }
.foot-modal-body p { margin: 0 0 12px; white-space: pre-wrap; }
.foot-modal-body p:last-child { margin-bottom: 0; }
.foot-modal-links {
    list-style: none; margin: 0 0 14px; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.foot-modal-links a {
    color: var(--brand); text-decoration: none;
    display: inline-block; padding: 8px 12px; border-radius: 10px;
    background: var(--brand-soft); border: 1px solid transparent;
}
.foot-modal-links a:hover { text-decoration: underline; border-color: #c7d9ff; }

/* ---------------- 详情页操作条 ---------------- */
.detail-ops { display: flex; gap: 10px; margin: 0 0 14px; flex-wrap: wrap; }

/* ---------------- 分享弹窗 ---------------- */
.share-modal {
    position: fixed; inset: 0; z-index: 120; background: rgba(15, 18, 22, .55);
    display: none; align-items: center; justify-content: center; padding: 20px;
    backdrop-filter: blur(2px);
}
.share-modal.on { display: flex; }
.share-box {
    width: min(440px, 94vw); max-height: 92vh; overflow: auto;
    background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35); padding: 18px 18px 20px;
}
.share-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.share-title { font-size: 16px; font-weight: 700; }
.share-langs { display: flex; gap: 6px; margin-left: auto; }
.slang {
    border: 1px solid var(--border); background: transparent; color: var(--muted);
    border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer;
}
.slang.on { background: var(--brand-soft); border-color: #c7d9ff; color: var(--brand); font-weight: 600; }
.share-close {
    border: 0; background: var(--chip); color: var(--text); width: 30px; height: 30px;
    border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer;
}
.share-close:hover { background: #e8ebf1; }
.share-body { position: relative; }
.poster-preview {
    position: relative;
    background: #eef0f4; border: 1px solid var(--border); border-radius: 12px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    max-height: 52vh; min-height: 300px;
}
/* 海报生成完成前先隐藏 <img>（避免出现破图占位），就绪后淡入 */
.poster-preview img { display: none; max-width: 100%; max-height: 52vh; height: auto; }
.poster-preview img.on { display: block; animation: posterIn .25s ease; }
/* 加载动画 / 失败重试浮层（元素由 poster.js 动态注入） */
.poster-ov {
    position: absolute; inset: 0; display: none;
    flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.poster-preview.loading .poster-ov,
.poster-preview.error .poster-ov { display: flex; }
.poster-spin {
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid rgba(37, 99, 235, .18); border-top-color: var(--brand);
    animation: posterSpin .8s linear infinite;
}
.poster-ov-txt { margin: 0; color: var(--muted); font-size: 13px; }
.poster-retry { display: none; }
.poster-preview.error .poster-spin,
.poster-preview.error .poster-ov-txt { display: none; }
.poster-preview.error .poster-retry { display: inline-block; }
@keyframes posterSpin { to { transform: rotate(360deg); } }
@keyframes posterIn { from { opacity: 0; } to { opacity: 1; } }
.qr-box {
    display: none; position: absolute; inset: 0; background: rgba(255, 255, 255, .97);
    border-radius: 12px; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
}
.qr-box.on { display: flex; }
.qr-box img { width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.qr-box p { margin: 0; color: var(--muted); font-size: 13px; }
.share-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.share-actions .btn { padding: 9px 6px; font-size: 13px; text-align: center; }
@media (max-width: 420px) { .share-actions { grid-template-columns: repeat(2, 1fr); } }

/* ---------------- JS 分列瀑布流（替代 CSS columns 做无限下拉） ---------------- */
/* CSS columns 追加内容会全列重新平衡：新卡插前面列、旧卡被挤走，左侧出现大片空白。
   JS 分列：外层横排等宽列，新卡只插「当前最矮列」，已渲染卡片永不移动。
   .masonry 保留给静态首屏（一次性渲染无重排问题）；无限下拉走 .masonry-columns。 */
.masonry-columns {
    display: flex; gap: 18px; align-items: flex-start; margin-top: 18px;
}
.masonry-columns > .mcol {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 18px;
}

/* ---------------- 统一卡片 .gcard（首页列表 / 相关推荐 / 广告占位共用，cards.js 渲染） ---------------- */
.gcard {
    display: block; background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; color: inherit; margin: 0 0 18px;
    transition: transform .15s ease, box-shadow .15s ease; break-inside: avoid;
}
.gcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.gcard-thumb { display: block; aspect-ratio: 1 / 1; background: #eef0f4; overflow: hidden; position: relative; }
.gcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s ease; }
.gcard-thumb img.on { opacity: 1; }
.gcard-thumb .ph { height: 100%; display: grid; place-items: center; color: #b6bcc7; font-size: 12px; }
.gcard-t {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    padding: 8px 10px 10px; font-size: 13px; line-height: 1.45;
}

/* 移动端列表：图片宽度 100%、完整展示不裁切 */
@media (max-width: 900px) {
    .gcard-thumb { aspect-ratio: auto; }
    .gcard-thumb img {
        width: 100%; height: auto; max-height: none;
        object-fit: contain; object-position: center top;
    }
    .gcard-thumb .ph { min-height: 120px; height: auto; padding: 24px 0; }
}

/* ---------------- 相关推荐（PC 4 列；移动端 2 列 + 随机无限下拉） ---------------- */
.related { margin: 26px 0 0; }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.related-grid .gcard { margin: 0; }

/* ---------------- 移动端：分页 / 下拉加载切换 + 无限滚动哨兵 ---------------- */
.view-mode-tabs {
    display: inline-flex; gap: 0; margin: 14px 0 4px; padding: 3px;
    background: var(--chip); border-radius: 999px; width: fit-content; max-width: 100%;
}
.view-mode-tabs .vtab {
    border: 0; background: transparent; color: var(--muted);
    border-radius: 999px; padding: 7px 16px; font-size: 13px; cursor: pointer;
}
.view-mode-tabs .vtab.on {
    background: var(--panel); color: var(--text); font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.load-sentinel {
    display: flex; align-items: center; justify-content: center;
    padding: 18px 12px 8px; min-height: 48px;
}
.load-sentinel .load-tip { color: var(--muted); font-size: 13px; }
.load-sentinel.busy .load-tip::before {
    content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 8px;
    border: 2px solid rgba(37,99,235,.25); border-top-color: var(--brand);
    border-radius: 50%; vertical-align: -2px;
    animation: posterSpin .8s linear infinite;
}
.load-sentinel.done .load-tip { opacity: .7; }
@media (max-width: 900px) {
    .related-grid { grid-template-columns: 1fr; } /* 随便看看：移动端单列一行一张 */
}

/* ---------------- 广告位（ad_slots.json 驱动） ---------------- */
/* 广告浮标：移动端 in-flow 插入导航下方居中；PC(≥900px) 固定右上角竖排 */
.ad-float {
    display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px;
    justify-content: center; padding: 10px 12px 0;
}
@media (min-width: 900px) {
    .ad-float {
        position: fixed; top: 74px; right: 14px; z-index: 60;
        flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; padding: 0;
    }
}
.ad-float-item {
    border: 1px solid var(--border); background: var(--panel); color: var(--brand);
    border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
    box-shadow: var(--shadow); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ad-float-item:hover { background: var(--brand-soft); }
.ad-modal {
    position: fixed; inset: 0; z-index: 130; background: rgba(15, 18, 22, .6);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.ad-modal.on { display: flex; }
.ad-modal-box {
    position: relative; width: min(400px, 92vw); max-height: 88vh; overflow: auto;
    background: var(--panel); border-radius: 16px; padding: 16px; text-align: center;
}
.ad-modal-img { max-width: 100%; border-radius: 10px; display: block; margin: 0 auto; }
.ad-modal-cap { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.ad-modal-jump { margin-top: 12px; display: inline-block; }
.ad-modal-close {
    position: absolute; top: 8px; right: 10px; border: 0; background: var(--chip); color: var(--text);
    width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer;
}
/* 列表内广告占位(.ad-card)当前不启用，样式随功能一并移除；如需恢复见 ads.js 注释 */

/* ---------------- i.html 私密分享页 ---------------- */
.i-ops { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.i-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.i-modal {
    position: fixed; inset: 0; z-index: 150; background: rgba(15, 18, 22, .55);
    display: none; align-items: center; justify-content: center; padding: 20px;
    backdrop-filter: blur(2px);
}
.i-modal.on { display: flex; }
.i-modal-box {
    width: min(360px, 92vw); background: var(--panel); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    padding: 20px 18px 22px; text-align: center; position: relative;
}
.i-modal-box h3 { margin: 0 0 4px; font-size: 16px; color: var(--text); }
.i-modal-box .i-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.i-qr {
    width: 220px; height: 220px; margin: 0 auto 14px; display: flex;
    align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 12px; background: #fff;
}
.i-qr img, .i-qr canvas, .i-qr table { width: 200px !important; height: 200px !important; image-rendering: pixelated; border: 0; }
.i-link {
    display: block; width: 100%; box-sizing: border-box; margin: 0 0 12px;
    padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--chip); color: var(--muted); font-size: 12.5px; text-align: left;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all;
}
.i-modal-acts { display: flex; gap: 8px; }
.i-modal-acts .btn { flex: 1; padding: 9px 6px; font-size: 13px; text-align: center; }
.i-close {
    position: absolute; top: 8px; right: 10px; border: 0; background: var(--chip); color: var(--text);
    width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer;
}
.i-close:hover { background: #e8ebf1; }
