/* ============================================================
   乐读文库 文库 · wenku-app 设计语言复刻皮肤
   品牌蓝 #1d4ed8 · 白底 · 12px 圆角 · 类型着色 · 玻璃拟态导航
   ============================================================ */
:root {
  --brand: 29 78 216;           /* #1d4ed8：#2f6fed 白字仅 4.55:1，卡在 AA 线发虚；改后 6.70:1 */
  --brand-2: 29 78 216;
  --brand-grad: rgb(var(--brand));   /* 1.24.0：原来两端同色=假渐变，平涂实色 */
  --hero-grad: rgb(var(--brand));    /* 同上：去掉假渐变 */
  --radius: 0.75rem;            /* 12px */
  --background: #ffffff;
  --foreground: #18181b;
  --card: #ffffff;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --secondary: #f4f4f5;
  --secondary-fg: #18181b;
  --muted: #f4f4f5;
  --muted-fg: #52525b;          /* 1.23.9：#71717a 在白底只有 4.35:1，未过 AA 4.5:1 */
  --accent: #f4f4f5;
  --accent-fg: #18181b;
  --destructive: #ef4444;
  --ring: rgb(var(--brand));
  --serif: Georgia, "Times New Roman", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --brand-bg: var(--brand-grad);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow-md: 0 6px 18px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 44px rgba(15,23,42,.14);
}

* { box-sizing: border-box; }
body.cg-skin { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
body.cg-skin a { text-decoration: none; color: inherit; }
.cg-container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.app-bg { background: var(--background); min-height: 100vh; }

/* ============ 顶部导航（玻璃拟态） ============ */
.cg-nav-bar { background: rgba(255,255,255,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.cg-nav-inner { display: flex; align-items: center; height: 64px; gap: 16px; }
.cg-nav-logo { display: flex; align-items: center; gap: 8px; }
.cg-nav-logo-badge { background: var(--brand-grad); display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 12px; color: #fff; font-size: 18px; box-shadow: 0 4px 10px rgb(var(--brand)/.25); }
.cg-nav-logo-name { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.cg-nav-search { flex: 1; max-width: 560px; margin-left: 8px; position: relative; }
.cg-nav-search input { width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.7); padding: 0 16px 0 40px; font-size: 14px; outline: none; transition: all .15s; }
.cg-nav-search input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(var(--brand)/.15); }
.cg-nav-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); display: flex; align-items: center; }
.cg-nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cg-nav-link { font-size: 14px; font-weight: 500; color: var(--muted-fg); padding: 6px 10px; border-radius: 8px; transition: all .15s; }
.cg-nav-link:hover, .cg-nav-link.active { color: var(--foreground); }
.cg-nav-vip { background: var(--brand-grad); color: #fff !important; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 10px rgb(var(--brand)/.25); }
.cg-nav-user { display: flex; align-items: center; gap: 8px; }
.cg-nav-avatar { width: 36px; height: 36px; border-radius: 999px; background: var(--ring); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.cg-nav-login { font-size: 14px; color: var(--muted-fg); }
.cg-nav-login:hover { color: var(--foreground); }

/* ============ Hero（品牌渐变 + 光斑 + 搜索） ============ */
.hero-banner { background: var(--hero-grad); color: #fff; position: relative; overflow: hidden; border-bottom: none; }
.hero-banner::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 120% at 50% -20%, rgba(255,255,255,.22), transparent); }
.hero-inner { position: relative; z-index: 1; text-align: center; padding: 56px 0 64px; }
.hero-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.16); padding: 4px 12px; font-size: 12px; margin-bottom: 16px; }
.hero-title { font-family: var(--serif); font-size: 42px; font-weight: 700; letter-spacing: -.5px; margin: 0 0 12px; text-shadow: 0 2px 12px rgba(0,0,0,.15); }
.hero-sub { font-size: 14px; color: rgba(255,255,255,.85); margin: 0 auto 24px; max-width: 600px; line-height: 1.7; }
.hero-search { display: flex; align-items: center; gap: 8px; max-width: 640px; margin: 0 auto; background: #fff; border-radius: 14px; padding: 8px 8px 8px 20px; box-shadow: 0 12px 36px rgba(0,0,0,.18); }
.hero-search .icon { color: #94a3b8; display: flex; align-items: center; }
.hero-search input { flex: 1; border: none; outline: none; height: 36px; font-size: 14px; color: var(--foreground); background: transparent; }
.hero-search button { background: var(--brand-bg); color: #fff; border: none; border-radius: 10px; padding: 9px 20px; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.hero-search button:hover { opacity: .9; }
.hero-hot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.hero-hot a { color: #fff; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.16); padding: 4px 12px; border-radius: 999px; font-size: 12px; transition: all .15s; }
.hero-hot a:hover { background: rgba(255,255,255,.28); }

/* ============ 首页三栏 ============ */
.home-grid { display: grid; grid-template-columns: 200px minmax(0,1fr) 280px; gap: 24px; padding: 24px 0 8px; align-items: start; }
.home-grid-noleft { grid-template-columns: minmax(0,1fr) 280px; }
@media (max-width: 1200px) { .home-grid { grid-template-columns: 200px minmax(0,1fr); } .home-grid-noleft { grid-template-columns: minmax(0,1fr); } .home-right { display: none; } }
@media (max-width: 900px) { .home-grid { grid-template-columns: minmax(0, 1fr); } .home-left { display: none; } }
/* 左分类栏 */
.home-left { position: sticky; top: 84px; }
.home-cats { display: flex; flex-direction: column; gap: 2px; }
.home-cats-title { padding: 4px 10px 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--muted-fg); }
.home-cat-item { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; padding: 8px 10px; border-radius: 10px; font-size: 14px; color: var(--muted-fg); cursor: pointer; text-align: left; transition: all .15s; }
.home-cat-item:hover { background: var(--accent); color: var(--foreground); }
.home-cat-item.active { background: rgba(47,111,237,.08); color: var(--ring); font-weight: 600; }
/* 类型胶囊 + 排序 */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.type-chip { padding: 6px 14px; border-radius: 999px; border: none; font-size: 13px; font-weight: 500; background: var(--secondary); color: var(--muted-fg); cursor: pointer; transition: all .15s; }
.type-chip:hover { background: var(--accent); }
.type-chip.active { background: var(--ring); color: #fff; font-weight: 600; }
.sort-pill { display: flex; gap: 2px; background: var(--secondary); border-radius: 999px; padding: 4px; }
.sort-pill a, .sort-pill button { padding: 5px 14px; border-radius: 999px; border: none; background: none; font-size: 13px; color: var(--muted-fg); cursor: pointer; transition: all .15s; }
.sort-pill a.active, .sort-pill button.active { background: #fff; font-weight: 600; color: var(--foreground); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.result-count { font-size: 13px; color: var(--muted-fg); margin-bottom: 14px; }
.result-count b { color: var(--foreground); font-weight: 600; }

/* ============ 文档卡片（DocCard） ============ */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
/* 封面方向：card-v = 竖版封面（高） / card-h = 横版封面（矮宽） */
.doc-grid[data-cover="portrait"] .type-thumb { height: auto; aspect-ratio: 3 / 4; }
.doc-grid[data-cover="landscape"] .type-thumb { height: auto; aspect-ratio: 16 / 9; }
@media (max-width: 768px) {
  .doc-grid[style*="grid-template-columns"] { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
}
.doc-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.doc-card:hover { border-color: rgba(47,111,237,.5); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.type-thumb { position: relative; display: flex; align-items: center; justify-content: center; height: 150px; overflow: hidden; }
.type-thumb img { width: 100%; height: 100%; object-fit: cover; }
.type-thumb .t-label { position: absolute; left: 12px; bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,.92); text-transform: uppercase; }
.type-thumb .t-badge { position: absolute; right: 8px; top: 8px; border-radius: 6px; padding: 2px 8px; font-size: 10px; font-weight: 700; }
.type-thumb .t-badge.free { background: rgba(255,255,255,.92); color: #dc2626; }
.type-thumb .t-badge.vip { background: rgba(0,0,0,.55); color: #fbbf24; }
/* 类型着色（无封面） */
/* 1.23.6：无封面时的类型底色，从「七组 135° 渐变」改成平涂。
   渐变本身没错，问题是七种色相各自渐变 —— 一屏十二张卡片就是十二块彩虹，
   这是整页「廉价感」的主要来源之一。现在色相仍区分类型，饱和度统一压下来，
   图标换成一枚白色细线，缩略图从"贴纸"变回"文档"。 */
.type-word, .type-doc, .type-docx { background: #3d5478; }
.type-ppt, .type-pptx { background: #7d4b2c; }
.type-pdf { background: #7b3636; }
.type-txt { background: #454b57; }
.type-excel, .type-xls, .type-xlsx { background: #35604a; }
.type-zip, .type-rar { background: #4a4438; }
.type-blank, .type-other { background: #414659; }
.t-ico { display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.94); }
.doc-card-body { display: flex; flex-direction: column; gap: 8px; padding: 14px; flex: 1; }
.doc-card-title { font-size: 15px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; transition: color .15s; }
.doc-card:hover .doc-card-title { color: var(--ring); }
.doc-card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-fg); }
.type-tag { border-radius: 4px; padding: 1px 7px; font-size: 11px; font-weight: 600; background: var(--secondary); }
.stars { color: #f59e0b; font-size: 12px; }
.stars .num { color: var(--muted-fg); }
.doc-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted-fg); border-top: 1px solid #f4f4f5; padding-top: 10px; }
/* 卡片右下角的浏览量（1.18.9）。三件事必须一起写，少一件就出问题：
   ① flex:none —— 否则左侧作者名一长（它带 min-width:0 + ellipsis），这一格被压到只剩一个字宽，
      图标和数字就断成上下两行；
   ② white-space:nowrap —— 断行就算不被压也会在窄卡片上发生；
   ③ inline-flex + align-items:center —— SVG 默认按 baseline 对齐，和 12px 文字摆一起会偏上，
      这里让图标与数字各自居中，视觉基线才对得齐。 */
.doc-card-views { flex: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.doc-card-views svg { flex: none; opacity: .9; }
.doc-card-author { display: flex; align-items: center; gap: 6px; min-width: 0; }
.avatar { border-radius: 999px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.doc-card-author .avatar { width: 22px; height: 22px; font-size: 10px; }
.doc-card-author span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-free { color: #16a34a; font-weight: 600; }
.price-paid { color: #d97706; font-weight: 600; }

/* ============ 行式文档（DocRow） ============ */
.doc-row { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.doc-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.doc-row .type-thumb { width: 130px; height: 100px; border-radius: 10px; flex-shrink: 0; }
.doc-row .t-ico { font-size: 32px; }
.doc-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-row-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.doc-row:hover .doc-row-title { color: var(--ring); }
.doc-row-desc { font-size: 12px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-fg); margin-top: auto; }
.doc-row-act { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 8px; flex-shrink: 0; }
.btn-read { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; background: var(--secondary); padding: 5px 12px; font-size: 12px; color: var(--muted-fg); }
.btn-dl { border-radius: 999px; padding: 5px 14px; font-size: 12px; font-weight: 600; color: #fff; }
.btn-dl.free { background: #16a34a; }
.btn-dl.vip { background: #f59e0b; }

/* ============ 右侧热门榜 / 推荐 ============ */
.home-right { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 20px; }
.side-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.side-card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.hot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hot-list a { display: flex; align-items: center; gap: 10px; border-radius: 8px; padding: 6px; transition: background .15s; }
.hot-list a:hover { background: var(--accent); }
.hot-rank { width: 24px; height: 24px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--secondary); color: var(--muted-fg); flex-shrink: 0; }
.hot-list a:nth-child(1) .hot-rank, .hot-list a:nth-child(2) .hot-rank, .hot-list a:nth-child(3) .hot-rank { background: var(--brand-grad); color: #fff; }
.hot-name { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-num { font-size: 12px; color: var(--muted-fg); flex-shrink: 0; }
.rec-card { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.rec-card-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.rec-card p { font-size: 13px; color: var(--muted-fg); line-height: 1.7; margin: 0 0 12px; }
.rec-card a.btn { display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand-grad); color: #fff; border-radius: 999px; padding: 9px 0; font-size: 13px; font-weight: 600; }

/* ============ 大宽幅：分类墙 + 横滑 ============ */
.wide-wall { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: linear-gradient(180deg, rgba(47,111,237,.04), transparent); margin-top: 24px; }
.wide-inner { max-width: 1400px; margin: 0 auto; padding: 36px 20px; }
.wide-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.wide-kicker { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--ring); margin-bottom: 4px; }
.wide-title { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.3px; }
.wide-more { border: 1px solid var(--border); border-radius: 999px; padding: 8px 18px; font-size: 13px; font-weight: 600; transition: all .15s; }
.wide-more:hover { border-color: rgba(47,111,237,.4); color: var(--ring); }
.cat-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cat-wall a { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); transition: all .2s; }
.cat-wall a:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(47,111,237,.4); }
.cat-wall .c-ico { width: 44px; height: 44px; border-radius: 12px; background: rgb(var(--brand)/.08); color: var(--ring); display: flex; align-items: center; justify-content: center; }
.cat-wall .c-name { font-size: 14px; font-weight: 600; }
.cat-wall .c-desc { font-size: 12px; color: var(--muted-fg); }
.carousel-sec { padding: 36px 0; }
.carousel-track { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; }
.carousel-item { flex: 0 0 240px; scroll-snap-align: start; }
.carousel-item .doc-card { height: 100%; }
.thin-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.thin-scroll::-webkit-scrollbar-thumb { background: rgba(120,120,140,.35); border-radius: 999px; }
.thin-scroll::-webkit-scrollbar-track { background: transparent; }

/* ============ 区块标题（常规） ============ */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 24px 0 16px; }
.sec-head h2 { font-family: var(--serif); font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.3px; }
.sec-head .sub { font-size: 13px; color: var(--muted-fg); margin-left: 10px; }
.sec-head .more { font-size: 13px; color: var(--muted-fg); transition: color .15s; }
.sec-head .more:hover { color: var(--ring); }

/* ============ 面包屑 ============ */
.breadcrumb { background: #fff; border-bottom: 1px solid var(--border); }
.breadcrumb-inner { display: flex; align-items: center; gap: 8px; height: 44px; font-size: 13px; color: var(--muted-fg); }
.breadcrumb a:hover { color: var(--ring); }
.breadcrumb .sep { color: #d4d4d8; }
.breadcrumb .current { color: var(--foreground); font-weight: 500; }

/* ============ 详情页（Detail） ============ */
.detail-grid { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 24px; padding: 24px 0 8px; align-items: start; }
/* 内容页侧栏左右可换（1.15.0，后台「布局 → 内容页 → 侧栏位置」）。
   不重排 DOM，只换 grid 列定义 + order：DOM 顺序恒为"aside 在前、main 在后"，
   Tab 顺序与读屏顺序不随版式跳来跳去。 */
.detail-grid.is-side-right { grid-template-columns: minmax(0,1fr) 300px; }
.detail-grid.is-side-right .detail-left { order: 2; }
.detail-grid.is-side-right .detail-main { order: 1; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }
/* 窄屏一律单列堆叠。这条必须写在 .is-side-right 之后：
   两条选择器权重不同（0,2,0 vs 0,1,0），只靠上面的单列规则压不住换边规则。 */
@media (max-width: 1000px) { .detail-grid.is-side-right { grid-template-columns: minmax(0, 1fr); } }
/* 侧栏一个模块都没有时（1.18.16）：模板里连 <aside> 都不输出，栅格必须跟着收成单列 ——
   否则第一列那 300px 会空在那里，主区被硬挤窄、右边一片留白，比"没有侧栏"更难看。
   必须写在 .is-side-right 之后：两条都是 0,2,0 权重，靠源码顺序决出胜负。 */
.detail-grid.is-no-side { grid-template-columns: minmax(0, 1fr); }
.detail-left { position: sticky; top: 84px; }
.info-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
/* ⚠️ 以下三条 .info-cover 规则对应的元素已于 1.18.4 从详情页移除（侧栏信息卡顶部的封面预览图），
   现为"按需求保留"的死规则 —— 万一要恢复那块封面图，把这些样式与模板里 doc-viewer.php 的
   注释一起捞回来即可，不必重写。 */
.info-cover { height: 176px; display: flex; align-items: center; justify-content: center; }
.info-cover .t-ico { font-size: 64px; }
.info-cover img { width: 100%; height: 100%; object-fit: cover; }
.info-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.btn-primary { background: var(--brand-grad); color: #fff; border: none; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: opacity .15s; }
.btn-primary:hover { opacity: .9; }
/* 1.24.1：三处 CTA 在「有下载权」形态下渲染成 `<a class="btn-primary">`。
   `body.cg-skin a { color: inherit }` 的特异性 (0,1,2) 高于 `.btn-primary` (0,1,0)，
   把白字压成继承的正文黑字 —— 蓝底黑字几乎读不出来。这里用双类 (0,2,1) 压回去；
   SVG 图标走 currentColor，跟着一起变白，hover 也不许掉回深色。 */
body.cg-skin a.btn-primary,
body.cg-skin a.lld-dlm-go { color: #fff; }
body.cg-skin a.btn-primary:hover,
body.cg-skin a.lld-dlm-go:hover { color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; font-size: 14px; color: var(--foreground); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: all .15s; }
.btn-outline:hover { border-color: var(--ring); color: var(--ring); }
.info-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* ============ 统一下载面板（1.21.0）============
   站长的诉求：「点击立即下载的时候能否弹出 oss 下载和网盘下载入口，同时出现」，
   以及针对 1.19/1.20 那版的截图反馈「不要这样的，看上去很丑」。
   那一版的病根是把「直连按钮 + 提示句 + 网盘按钮 + 提取码」四样东西塞进
   .info-actions / .preview-gate-btns 这两个 flex 容器：主按钮与次级入口同权并排、
   提取码裸挂、网盘一多就挤成一排小按钮。现在网盘整体收进面板，
   旧的 .lld-pan / -tip / -btn / -code 四条类已无任何引用，随之删除
   （后台的 .lld-pan-add / -del / -edit 在 admin.css，与这里无关、未动）。
   面板外壳复用 .lld-modal 骨架，只覆盖宽度与内部排版。 */
   ⚠️ 下面这条**必须是双类选择器 `.lld-modal .lld-dlm-panel`**，不能简写成 `.lld-dlm-panel`：
   本块写在文件前部，而复用的骨架 `.lld-modal-panel` 定义在**后面**（约 780 行，弹窗区）。
   CSS 层叠里同特异性是「后定义的赢」—— 单类选择器会让骨架反过来把这里全部覆盖掉，
   症状是"样式只生效一半"：骨架没声明的属性（如 bottom）生效，骨架声明过的
   （top / left / width / transform / border-radius / animation）统统被骨架赢回去，
   表现成「手机上媒体查询明明命中了，面板却还是桌面居中弹窗」。
   双类 = 特异性 (0,2,0) > 骨架的 (0,1,0)，与两者先后无关。 */
.lld-modal .lld-dlm-panel { width: 452px; padding: 24px; }
.lld-dlm-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--foreground); }
/* 文档标题：一行截断，长标题不许把面板撑高（它只是"下的是这份"的确认信息） */
.lld-dlm-doc { margin: 5px 0 0; font-size: 13px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lld-dlm-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.lld-dlm-chip { font-size: 12px; line-height: 1.5; padding: 3px 9px; border-radius: 999px; background: var(--secondary); color: var(--muted-fg); }
/* 方式卡片。主位只有一张 —— 用品牌色描边 + 极淡底色标出，比"加粗放大"安静，也不挑主色 */
.lld-dlm-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lld-dlm-card + .lld-dlm-card { margin-top: 10px; }
.lld-dlm-card.is-main { border-color: rgb(var(--brand) / .45); background: rgb(var(--brand) / .04); }
/* replace 形态下的直连卡：降级但仍可见（看见它、并看见为什么没有，比整块消失好懂） */
.lld-dlm-card.is-off { opacity: .6; }
.lld-dlm-ico { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: var(--secondary); color: var(--muted-fg); display: inline-flex; align-items: center; justify-content: center; }
.lld-dlm-ico.is-brand { background: rgb(var(--brand) / .12); color: rgb(var(--brand)); }
.lld-dlm-card-txt { flex: 1 1 55%; min-width: 0; display: flex; flex-direction: column; }
.lld-dlm-card-txt strong { font-size: 14.5px; font-weight: 600; color: var(--foreground); }
.lld-dlm-card-txt em { font-style: normal; font-size: 12.5px; line-height: 1.5; color: var(--muted-fg); margin-top: 1px; }
.lld-dlm-badge { flex: 0 0 auto; font-size: 11.5px; line-height: 1.5; padding: 2px 8px; border-radius: 999px; background: rgb(var(--brand) / .12); color: rgb(var(--brand)); font-weight: 600; }
.lld-dlm-go { flex: 1 1 100%; margin-top: 4px; text-decoration: none; background: var(--brand-grad); color: #fff; border-radius: 10px; padding: 10px 16px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; transition: opacity .15s; }
.lld-dlm-go:hover { opacity: .9; color: #fff; }
/* 网盘逐行列出（而不是一排并排按钮）：每行 = 名称 + 提取码 + 打开 */
.lld-dlm-pans { flex: 1 1 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.lld-dlm-pan { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--secondary); }
.lld-dlm-pan-name { flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 提取码：可点复制。以前是一段裸文本，手机上要长按选中再复制 —— 那一步最容易劝退人 */
.lld-dlm-code { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--border); background: var(--card); border-radius: 8px; padding: 4px 8px; font-size: 12px; color: var(--muted-fg); font-family: inherit; line-height: 1.4; cursor: pointer; transition: all .15s; }
.lld-dlm-code b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .5px; font-weight: 600; color: var(--foreground); }
.lld-dlm-code i { font-style: normal; color: rgb(var(--brand)); }
.lld-dlm-code:hover { border-color: rgb(var(--brand) / .5); color: var(--foreground); }
.lld-dlm-pan-go { flex: 0 0 auto; text-decoration: none; border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; font-size: 12.5px; line-height: 1.5; color: var(--foreground); background: var(--card); transition: all .15s; }
.lld-dlm-pan-go:hover { border-color: rgb(var(--brand)); color: rgb(var(--brand)); }
.lld-dlm-tip { margin: 14px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted-fg); }
/* ≤640px：居中弹窗在手机上离拇指太远 —— 改成从底部升起的抽屉，按钮全宽。
   base 的 translate(-50%,-50%) 必须一起清掉，否则面板会飞出屏幕。 */
@media (max-width: 640px) {
  .lld-modal .lld-dlm-panel { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: auto; max-width: none; border-radius: 18px 18px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 86vh; animation: lldDlmUp .24s ease; }
  .lld-dlm-pans { gap: 7px; }
}
@keyframes lldDlmUp { from { transform: translateY(26px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.info-actions .btn-primary { flex: 1; }
/* ============ 「单个购买 + 开通会员」双按钮（1.25.1）============
   对标站的形态：左描边「单个购买」、右实底「开通会员」、会员键右上角一枚角标。
   · 两个键等宽（flex 1 1 0），两行排版：上行动作词、下行说明（价格 / 权益）。
     侧栏只有 280px，一行塞不下「单个购买 ¥9.90」，分两行后字号不用缩到看不清。
   · 左键沿用 .btn-outline 底子，只把描边换成品牌色（比灰描边更像"可点的购买"，
     又不与右边的实底抢主位）；右键沿用 .btn-primary（含 1.24.1 的 a 标签白字修复）。
   · 角标色是刻意的暖色（#f43f5e）：它要压在蓝色实底上被一眼看到，跟主题色同色系会糊掉；
     白字对比 4.6:1，11px 加粗仍可读。 */
.lld-buy { flex: 1 1 100%; display: flex; gap: 8px; margin-top: 9px; }
.lld-buy-single, .lld-buy-vip { flex: 1 1 0; min-width: 0; height: 54px; padding: 0 8px; border-radius: 10px; flex-direction: column; gap: 2px; line-height: 1.2; position: relative; }
.lld-buy-single { background: transparent; border-color: rgb(var(--brand)); color: rgb(var(--brand)); font-weight: 600; }
.lld-buy-single:hover { background: rgb(var(--brand) / .06); border-color: rgb(var(--brand)); color: rgb(var(--brand)); }
.lld-buy-l1 { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.lld-buy-l2 { display: block; font-size: 11px; font-weight: 400; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lld-buy-tag { position: absolute; top: -9px; right: 8px; z-index: 1; padding: 1px 8px; border-radius: 999px; background: #f43f5e; color: #fff; font-size: 11px; font-weight: 700; line-height: 1.6; white-space: nowrap; box-shadow: 0 2px 6px rgba(244, 63, 94, .35); }
/* 已购权益提示（1.18.22）：剩余天数 / 已过期说明。都是按钮下方的一行小字 */
.info-valid { font-size: 12.5px; color: var(--muted-fg); }
.info-valid strong { color: var(--ring); }
.info-expired { font-size: 12.5px; line-height: 1.7; color: #b45309; background: rgba(180, 83, 9, .07); border: 1px solid rgba(180, 83, 9, .18); border-radius: 8px; padding: 8px 10px; }
/* 1.24.2：右侧元信息从「六行虚线对照表」改为浅底分组（对标站的间接呈现）。
   两列 grid + 小标签在上、值在下：不靠分隔线切数据，靠留白分组；
   值降到中等字重、字距归零，避免一行行粗体把侧栏压成报表。
   颜色全走 token，深色/暖阳等站点风格自动跟随；DOM 与六行顺序不变，
   后台 side_meta 开关、stat_ico() 图标与分类链链接均不受影响。 */
.info-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 14px;
  margin-top: 2px;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--secondary);
}
.info-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  padding: 0;
  border: 0;
}
.info-row:last-child { grid-column: 1 / -1; border: 0; }
.info-row .k { display: flex; align-items: center; gap: 5px; color: var(--muted-fg); font-size: 12px; }
/* 图标与 1.18.5 的 stat_ico() 同源，只降亮度让标签先被读到 */
.info-row .k svg { flex: none; width: 13px; height: 13px; opacity: .55; }
.info-row .v { font-weight: 500; color: var(--foreground); font-size: 13.5px; letter-spacing: 0; line-height: 1.5; overflow-wrap: anywhere; }
/* 1.18.17：链里的链接继承 --ring（原先写在模板内联 style 上，链一长就得三处同步改） */
.info-row .v a { font-weight: 500; color: var(--ring); }
/* 作者卡：名字加粗加大对齐 wenku */
.author-card { display: flex; align-items: center; gap: 12px; background: rgba(244,244,245,.6); border-radius: 12px; padding: 13px 12px; margin-top: 4px; }
.author-card .avatar { width: 42px; height: 42px; font-size: 15px; }
.author-card .a-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.author-card .a-sub { font-size: 12.5px; color: var(--muted-fg); }
.author-card { display: flex; align-items: center; gap: 12px; background: rgba(244,244,245,.6); border-radius: 12px; padding: 12px; margin-top: 4px; }
.author-card .avatar { width: 40px; height: 40px; font-size: 14px; }
.author-card .a-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.author-card .a-sub { font-size: 12px; color: var(--muted-fg); }
.detail-main { display: flex; flex-direction: column; gap: 20px; }
/* 标题上方的「格式 / VIP 文档」徽章行（.detail-head-tags + .tag-pill）于 1.18.5 从模板移除：
   格式与付费状态改由标题下方的数据栏承载（.doc-stat-type / .doc-stat-price）。
   下面这几条规则暂时保留——.tag-pill 是个通用的小徽章类，将来别处要复用可以直接捡；
   但**当前全库已无模板引用它们**，如果确认不再需要，连注释一起删掉即可。 */
.detail-head-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag-pill { border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.tag-free { background: #dcfce7; color: #15803d; }
.tag-vip { background: #fef3c7; color: #b45309; }
.detail-title { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.35; margin: 10px 0 8px; letter-spacing: -.3px; }
.hash-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.hash-tags span { border-radius: 999px; background: var(--secondary); padding: 4px 10px; font-size: 12px; color: var(--muted-fg); }
.detail-desc { font-size: 14px; color: var(--muted-fg); line-height: 1.8; }
/* ============================================================
   文档数据栏（1.18.4）：标题/简介下方一行元数据 + 行尾「侵权投诉」
   显示哪些项由后台「文库布局 → 内容页 → 文档数据栏」的 show_* 开关决定，
   隐藏逻辑在模板里（PHP 侧就不输出），这里只负责版式。
   窄屏靠 flex-wrap 换行；每一项 nowrap，所以不会在词语中间断行。
   ============================================================ */
.doc-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.doc-stats-list { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-width: 0; flex: 1 1 auto; }
.doc-stat { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted-fg); line-height: 1.6; white-space: nowrap; }
/* 图标是内联 SVG（见 LLD_Library::stat_ico）：无外部请求、颜色随文字、不动用字体 */
.doc-stat-ico { flex: none; opacity: .9; }
.doc-stat a { color: var(--ring); text-decoration: none; }
.doc-stat a:hover { text-decoration: underline; }
/* 文件类型角标：底色/文字色由模板按类型内联着色，这里只定形状 */
.doc-stat-type { padding: 1px 7px; border-radius: 4px; font-size: 12px; font-weight: 700; letter-spacing: .3px; }
/* 价格三档语义色，与侧栏按钮、门槛卡的说法一致：免费=绿 / VIP免费=琥珀 / 付费=品牌色 */
.doc-stat-price { font-weight: 700; font-size: 14px; }
.doc-stat-price.is-free { color: #15803d; }
.doc-stat-price.is-vipfree { color: #b45309; }
.doc-stat-price.is-paid { color: var(--ring); }
/* 已购买档（1.18.22）：与"免费"同为绿系，语义是"这篇已经归你了" */
.doc-stat-price.is-bought { color: #15803d; }
/* 侵权投诉：靠 list 的 flex:1 推到行尾；折行后自然回到新行左端 */
.doc-stat-report { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted-fg); text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: 3px 12px; white-space: nowrap; transition: color .15s, border-color .15s; }
.doc-stat-report:hover { color: var(--ring); border-color: var(--ring); }
.preview-sec { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: visible; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--border); padding: 12px 16px; }
.preview-head .t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
/* ============ 1.24.3 弹窗内左侧预览：只留「预览 + 文档图」（红线 87：只在内嵌态生效）============
   弹窗外面已经有标题，右栏已经有价格/格式/页数/分类 —— iframe 里再把大标题、
   数据栏、灰底工具头、页数角标重说一遍，就是在同一屏里把同一件事讲三遍。
   对标站的左侧只有一行小标题和文档图，所以这里把重复信息全部收起；
   独立文档页（无 .lld-embed）原样保留，SEO 标题与侵权投诉入口不受影响。 */
body.lld-embed .detail-title,
body.lld-embed .detail-desc,
body.lld-embed .doc-stats { display: none; }
body.lld-embed .preview-sec {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
body.lld-embed .preview-head {
  padding: 4px 16px 10px;
  border: 0;
  background: transparent;
}
body.lld-embed .preview-head .t {
  position: relative;
  align-self: flex-start;
  padding-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--foreground);
}
body.lld-embed .preview-head .t svg { display: none; }
body.lld-embed .preview-head .t::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 3px;
  border-radius: 999px;
  background: rgb(var(--brand));
}
body.lld-embed .preview-head-meta { display: none; }
body.lld-embed .preview-body { background: transparent; padding: 0 16px; }

/* ============ 1.24.8 弹窗内：预览列自己滚、右栏信息钉死（对齐对标站）============
   原来整个 iframe 文档一起滚：滚动条跑到弹窗最右边，右栏信息卡靠 sticky top:84px
   勉强撑着，滚到文档末尾还是跟着上移，且滚动条离预览内容很远。对标站是
   「预览区右缘一条滚动条 + 右侧信息从头到尾不动」。

   做法（红线 87：只在 body.lld-embed 生效，独立文档页整页滚照旧）：
     · 整页不滚：html/body 锁 100%，滚动条改由预览列 .detail-main 产生，
       正好落在预览区右缘、两栏之间 —— 用户视线不用跨过信息栏去找滚动条。
     · 预览列 overflow-y:auto 吃满视口高度；底部留 84px 给 fixed 工具条，
       否则翻到最后一页会被工具条压住。
     · 右栏 .detail-left 取消 sticky、列本身等高不滚（信息超长才自己滚），
       于是价格 / 格式 / 大小 / 购买按钮从头到尾钉在原地。

   ⚠️ 滚动宿主换了，doc-viewer.php 的 fullHost() 必须同步认 .detail-main，
      否则翻页 / 页码联动还在问 window（已不滚）→ 点了没反应且不报错。 */
html:has(body.lld-embed), body.lld-embed { height: 100%; overflow: hidden; }
body.lld-embed.cg-doc-page:has(.preview-bar) { padding-bottom: 0; }
body.lld-embed .detail-grid {
  height: 100vh;
  padding: 0;
  box-sizing: border-box;
  align-items: stretch;
}
/* 预览列贴顶（top≈0）：翻页脚本 topOf() 用「页相对视口位置 + 滚动量」算落点，
   只有容器贴顶时这个和才等于内容坐标。顶部留白交给 preview-head 自己，不影响几何。 */
body.lld-embed .detail-main {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 84px;
}
body.lld-embed .detail-left {
  position: static;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* 顶部留白 + 底部给 fixed 工具条让位：body 那笔 78px 已随整页锁滚清掉，
     两列各自补，否则翻到末尾时最后一张图 / 最后一张信息卡被工具条压住。 */
  padding: 12px 0 84px;
}
.zoom-ctrl { display: flex; align-items: center; gap: 6px; }
.zoom-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.zoom-btn:hover { border-color: var(--ring); color: var(--ring); }
.zoom-val { width: 48px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
/* ============================================================
   详情页预览（1.15.0）：连续滚读 + 底部悬浮工具条
   1.15.0 之前这里是"一次只显示一张"（除 .active 外全 display:none）+ 灰色凹槽里一张图；
   现在改成整页往下滚：预览区不再自己滚、由页面滚，每页是一张白纸卡片。
   所以 .active 从"控制显示"降级为"标记当前页"，只服务工具条的翻页与滚动联动
   —— 这几条规则要和 doc-viewer.php 里的脚本一起看，改一边必须改另一边。
   ============================================================ */
.preview-body { overflow: visible; background: var(--secondary); padding: 16px; }
#mldPages .doc-paper {
  display: block;
  position: relative;            /* 1.18.23：遮罩层与页码层的定位基准。原来缺这一条，
                                   .p-page-num 的 absolute 会一路往上找定位祖先 */
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;              /* 让圆角裁住图片的四个直角 */
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;              /* 页间距改由"相邻兄弟的 margin-top"承担（见下一条），不用两条边距相加 */
}
#mldPages .doc-paper + .doc-paper { margin-top: 12px; }
/* ===== 试读图「另存为」遮罩（1.18.23）=====
   透明层压在 <img> 之上：右键命中的是这层 <span> 而不是图片本身，
   浏览器的右键菜单因此不会出现「图片另存为」这一项。
   ⚠️ 这层**绝不能**写 pointer-events:none —— 那等于把右键又让回给 <img>，整层白加。
   z-index 取 2：在图片之上，同时挡住 pointer-events:none 的装饰水印层。 */
#mldPages .doc-paper .pv-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: default;
}
#mldPages .doc-paper img { width: 100%; height: auto; display: block; }
/* 当前页只描一道极淡的边。不做整块高亮：连续滚读时那一页本来就在眼前，
   再加高亮反而像"被选中"。这道边同时给"当前页跟上了吗"提供一个可断言的视觉信号。 */
#mldPages .doc-paper.active { border-color: rgb(var(--brand)/.3); }

.preview-head-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.preview-head-meta .pg-total { font-size: 12.5px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.preview-head-meta .pg-free-tip { font-size: 12px; color: var(--ring); background: rgb(var(--brand)/.1); padding: 3px 9px; border-radius: 999px; }
/* 1.18.8：.preview-full-link（预览标题栏的「展开全文阅读 ›」）随阅读器页一起下架。
   .btn-outline 本身仍被付费文档区的「开通 VIP 免费下载」等按钮使用，保留。 */

/* ===== 试读门槛卡（照 kms.kiivo.net 的 #outer_page_more）=====
   压在最后一张预览页之后。服务端只发前 N 张图，所以这里不需要任何"解锁/继续阅读"的交互
   —— 后面的页在页面里根本不存在，没有可绕过的东西。 */
.preview-gate {
  margin-top: 12px; padding: 26px 20px 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  text-align: center;
}
.preview-gate-tip { font-size: 15px; font-weight: 600; color: var(--foreground); }
.preview-gate-meta { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; font-size: 13px; }
.preview-gate-meta .gate-price { color: var(--destructive); font-weight: 700; }
.preview-gate-meta .gate-free { color: #16a34a; font-weight: 700; }
/* 已购买（1.18.22）：与"免费"同色 —— 对买家而言此刻确实是"不用再付" */
.preview-gate-meta .gate-bought { color: #16a34a; font-weight: 700; }
.preview-gate-meta .gate-dl { color: var(--muted-fg); }
.preview-gate-left { margin-top: 12px; font-size: 13px; color: var(--muted-fg); }
.preview-gate-left b { color: var(--destructive); font-size: 15px; }
.preview-gate-btns { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ============ 悬浮阅读工具条（照 kms.kiivo.net 底部那一条）============
   fixed 在视口底部。配色全走皮肤变量（--card / --border / --foreground / --secondary），
   明暗主题自动成立，不必再写一份 html.dark 覆盖。
   z-index 取 90：必须低于支付弹窗(320) / 抽屉(200) / 分享面板，否则弹窗会被工具条压住；
   同时要高于普通内容。 */
.preview-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15,23,42,.06);
}
.preview-bar-inner {
  max-width: 1280px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 12px;
}
.pb-group { display: flex; align-items: center; gap: 8px; }
.pb-nav { flex: 1 1 auto; min-width: 0; }   /* 吃掉剩余宽度 → 收藏/分享/下载自然靠右成组 */
.pb-actions { flex: 0 0 auto; }
.pb-dl { flex: 0 0 auto; }

/* 翻页按钮沿用 .pg-nav-btn，只把它压成方形图标钮（工具条里文字太多反而挤） */
.preview-bar .pg-nav-btn { width: 32px; height: 32px; padding: 0; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.pb-pager { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.pb-pg-input {
  width: 48px; height: 32px; padding: 0 4px; text-align: center;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--foreground);
  font-family: inherit; font-size: 13px; outline: none; transition: all .15s;
}
.pb-pg-input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(var(--brand)/.15); }
.pb-pg-sep { color: var(--border); }
.pb-pg-total { min-width: 18px; }
.pb-divider { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }

/* 收藏 / 分享 */
.pb-action {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--card); color: var(--muted-fg);
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.pb-action:hover { border-color: var(--ring); color: var(--ring); }
.pb-action.active { border-color: var(--ring); color: var(--ring); background: rgb(var(--brand)/.09); }
.pb-action-num { font-variant-numeric: tabular-nums; }
/* 分享面板在工具条里必须**向上**弹：工具条贴着视口底，往下弹会直接出屏 */
.pb-share .share-panel { top: auto; bottom: calc(100% + 10px); right: 0; }

/* 下载主按钮（与信息卡主 CTA 同一套判断、同一个类名，付费弹窗脚本自动一起绑定） */
.pb-dl-btn { height: 38px; padding: 0 18px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }

/* 屏幕阅读器专用。#mldPageInfo 的可见职责已交给"输入框 + 总数"，
   这个节点留下来做翻页播报 —— 脚本照旧往里写"第 X / Y 页"，不用改。 */
.pb-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 工具条是 fixed，会盖住页面最底部那一条 → 补一段等高留白。
   只在真的渲染了工具条时才补：:has() 已是所有现代浏览器的基线能力；
   万一不生效，代价也只是页脚被挡一部分，不会坏功能。 */
body.cg-doc-page:has(.preview-bar) { padding-bottom: 78px; }
/* 分享轻提示默认 bottom:44px，会被工具条盖住 → 抬到工具条上方 */
body.cg-doc-page .share-toast { bottom: 90px; }

/* ============ 全屏沉浸阅读（工具条的 ⛶）============
   进全屏的只是 .preview-sec（不是整个 document）：侧栏 / 页脚 / 推荐都不在，
   正好是"沉浸"要的效果，退出全屏也不用重排页面。
   全屏后页面滚动条不可用 → 必须让预览区自己成为滚动容器
   （脚本里的 fullHost() 就是为这件事存在的）。 */
.preview-sec:fullscreen, .preview-sec:-webkit-full-screen {
  border: 0; border-radius: 0; box-shadow: none;
  background: var(--secondary);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.preview-sec:fullscreen .preview-head,
.preview-sec:-webkit-full-screen .preview-head {
  position: sticky; top: 0; z-index: 5; flex: 0 0 auto; background: var(--card);
}
.preview-sec:fullscreen .preview-body,
.preview-sec:-webkit-full-screen .preview-body { flex: 0 0 auto; }
/* 全屏后屏幕很宽，把正文收窄一点才读得舒服（与阅读器阅读区同宽） */
.preview-sec:fullscreen .preview-center,
.preview-sec:-webkit-full-screen .preview-center { max-width: 1100px; margin: 0 auto; width: 100%; }

/* ===== 窄屏：工具条瘦身（"每一样都能点到"优先于"每一样都写出来"）===== */
@media (max-width: 760px) {
  /* "分享""立即下载"这些字样最占地方，窄屏只留图标 */
  .pb-action-txt { display: none; }
  .preview-bar-inner { padding: 8px 10px; gap: 8px; }
  .pb-nav { gap: 6px; }
  .pb-divider { display: none; }
  .pb-dl-btn { padding: 0 12px; }
  .zoom-val { width: 40px; font-size: 12px; }
  .preview-body { padding: 10px; }
  #mldPages .doc-paper + .doc-paper { margin-top: 8px; }
  .preview-head { padding: 10px 12px; }
  /* 总页数在工具条的 "/N" 里已经有了，标题栏不再重复占位 */
  .preview-head-meta .pg-total { display: none; }
  body.cg-doc-page:has(.preview-bar) { padding-bottom: 70px; }
}
@media (max-width: 420px) {
  /* 极窄屏：缩放先让位（系统双指缩放可用），翻页与页码是刚需，必须留在可视区 */
  .preview-bar .zoom-ctrl, .preview-bar #mldFullBtn { display: none; }
  .pb-pg-input { width: 42px; }
}
.preview-center { display: flex; flex-direction: column; align-items: center; }
.doc-paper { flex-shrink: 0; }
/* 预览页（整页图片直接铺开，无容器无描边） */
.doc-paper { background: transparent; width: 100%; max-width: 100%; padding: 0; text-align: center; position: relative; margin-bottom: 14px; }
.doc-paper img { width: 100%; display: block; border-radius: 4px; }
.pg-nav-btn { height: 30px; border-radius: 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: 13px; padding: 0 12px; color: var(--foreground); white-space: nowrap; transition: all .15s; }
.pg-nav-btn:hover { border-color: var(--ring); color: var(--ring); }
.pg-divider { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.pg-info { font-size: 12px; color: var(--muted-fg); white-space: nowrap; margin: 0 2px; font-variant-numeric: tabular-nums; }
.doc-paper .p-kicker { font-size: 12px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--muted-fg); margin-bottom: 8px; }
.doc-paper h1 { font-family: var(--serif); font-size: 30px; color: #1e293b; margin: 0 0 12px; }
.doc-paper p { font-size: 14px; color: #64748b; line-height: 1.8; margin: 0 auto 12px; max-width: 480px; }
.doc-paper .p-meta { display: flex; justify-content: center; gap: 12px; font-size: 12px; color: #94a3b8; }
.p-page-num { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 11px; color: #a1a1aa; }
.toc-sec, .review-sec { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.toc-sec h3, .review-sec h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 12px; }
.toc-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.toc-item { display: flex; align-items: center; gap: 10px; background: rgba(244,244,245,.5); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.toc-item .no { width: 24px; height: 24px; border-radius: 999px; background: rgba(47,111,237,.1); color: var(--ring); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.review-item { display: flex; gap: 12px; border-bottom: 1px solid #f4f4f5; padding: 10px 0; }
.review-item:last-child { border-bottom: none; padding-bottom: 0; }
.review-item .avatar { width: 36px; height: 36px; font-size: 13px; }
.review-item .r-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.review-item .r-txt { font-size: 13px; color: var(--muted-fg); margin-top: 2px; }

/* ============ 阅读器（Reader）· 已下架 ============
   1.18.8：独立阅读器页 /reader/{id}.html 整条移除，本段 24 条规则
   （.reader-* / .outline-*）随之全部删除 —— 它们只服务 templates/reader.php，
   该文件已一并移出（详见 class-viewer.php 顶部注释与 RW_VER）。
   这里只留这段说明，方便日后回溯"这些类名曾经存在"。 */

/* ============ 分类页（Category） ============ */
/* 左栏 + 右列表（1.18.15）：左栏三块（左侧分类树 / 推荐文档(左) / 热门标签(左)）此前
   只存在于后台配置里、前台没有 DOM —— 从首页点进分类后左栏整块消失。列宽与首页
   .home-grid 的左栏取同一量级，确保"首页 → 分类"跳转时视觉不跳变。 */
.cat-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.cat-layout-noleft { grid-template-columns: minmax(0, 1fr); }
.cat-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.cat-nav { display: flex; flex-direction: column; gap: 2px; }
.cat-tagwrap { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-tag { font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; color: var(--muted-fg); transition: all .15s; }
.cat-tag:hover { border-color: rgba(47,111,237,.4); color: var(--ring); }
/* ============ 分类层级（1.18.17） ============
   树是**平铺**的：子级不靠折叠藏起来，靠缩进 + └ 标记区分层级 —— 层级一眼看全，
   也不存在"忘了展开所以以为没有子分类"这种误会。
   同一套 lv1/lv2/lv3 同时给分类页左栏、首页左栏、以及两处导航下拉用，
   避免这个入口缩进 26px、那个入口 20px 的各自为政。 */
.home-cat-item.lv2 { padding-left: 26px; font-size: 13px; }
.home-cat-item.lv3 { padding-left: 42px; font-size: 13px; }
.home-cat-item .lv-mark { flex: 0 0 10px; width: 10px; text-align: center; font-size: 11px; color: var(--muted-fg); opacity: .6; }
.home-cat-item .cat-num { margin-left: auto; font-size: 11px; color: var(--muted-fg); }
.cg-nav-catmenu a.lv2, .cg-nav-dropdown-menu a.lv2 { padding-left: 26px; font-size: 13px; }
.cg-nav-catmenu a.lv3, .cg-nav-dropdown-menu a.lv3 { padding-left: 42px; font-size: 13px; }
.cg-nav-catmenu a .lv-mark, .cg-nav-dropdown-menu a .lv-mark { margin-right: 6px; color: var(--muted-fg); opacity: .6; }
/* 分类祖先链的分隔符 —— chain_links() 的输出，内容页面包屑 / 所属分类行 / 数据栏共用。
   原先把颜色写在模板的内联 style 上，链一变长就有三处要同步改，收到这里。 */
.cat-sep { margin: 0 4px; color: var(--muted-fg); opacity: .55; }
@media (max-width: 900px) {
  .cat-layout { grid-template-columns: minmax(0, 1fr); }
  .cat-side { display: none; }
}
.cat-grid-all { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 24px 0; }
.cat-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: all .2s; }
.cat-card:hover { border-color: rgba(47,111,237,.5); background: rgba(47,111,237,.03); }
.cat-card .c-ico { width: 48px; height: 48px; border-radius: 12px; background: rgb(var(--brand)/.08); color: var(--ring); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cat-card .c-name { font-weight: 600; font-size: 15px; }
.cat-card .c-desc { font-size: 12px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-card .c-count { font-size: 12px; color: var(--ring); margin-top: 2px; }
.row-list { display: flex; flex-direction: column; gap: 12px; }

/* ============ 分页 ============ */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 28px 0; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 14px; color: var(--muted-fg); transition: all .15s; }
.pagination a:hover { border-color: var(--ring); color: var(--ring); }
.pagination .current { background: var(--brand-bg); color: #fff; border-color: transparent; }

/* ============ 用户中心 / VIP 页通用 ============ */
.cg-uc-wrap { max-width: 900px; margin: 0 auto; padding: 28px 20px; }
.cg-uc-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.cg-uc-card-title { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.cg-uc-empty { text-align: center; padding: 36px 0; color: var(--muted-fg); }
.cg-uc-empty-icon { font-size: 40px; margin-bottom: 8px; color: var(--muted-fg); display: flex; justify-content: center; }

/* ============ 页脚 ============ */
.cg-footer { background: #18181b; color: #a1a1aa; padding: 28px 0 18px; text-align: center; font-size: 13px; margin-top: 32px; }
.cg-footer p { margin: 4px 0; }
.cg-footer a { color: #d4d4d8; }

/* ============ 通用按钮/徽标 ============ */
.cg-btn-primary { background: var(--brand-bg); color: #fff; border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.cg-btn-primary:hover { opacity: .9; }
.cg-empty-list { text-align: center; color: var(--muted-fg); padding: 40px 0; font-size: 14px; }

/* ============================================================
   风格系统（wenku-app StyleSwitcher）：玻璃 / 极简 / 极光 / 暖阳 / 松绿
   + 明暗主题切换（html.dark）
   ============================================================ */
/* ---------- 玻璃 glass：渐变紫 + 玻璃拟态 ---------- */
[data-style="glass"] {
  --brand: 109 94 252;    /* #6d5efc */
  --brand-2: 168 85 247;  /* #a855f7 */
  --hero-grad: linear-gradient(135deg, #6d5efc 0%, #a855f7 100%);
}
[data-style="glass"] .hero-banner::before { background: radial-gradient(60% 120% at 50% -20%, rgba(255,255,255,.25), transparent); }
[data-style="glass"] .app-bg { background: radial-gradient(1200px 600px at 10% -10%, rgba(109,94,252,.12), transparent 60%), radial-gradient(1000px 500px at 100% 0%, rgba(168,85,247,.10), transparent 55%), var(--background); }
[data-style="glass"] .cg-nav-bar { background: rgba(255,255,255,.7); }

/* ---------- 极光 aurora：青蓝 → 靛蓝 ---------- */
[data-style="aurora"] {
  --brand: 14 165 233;    /* #0ea5e9 */
  --brand-2: 99 102 241;  /* #6366f1 */
  --hero-grad: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}
[data-style="aurora"] .app-bg { background: radial-gradient(1200px 600px at 0% -10%, rgba(14,165,233,.12), transparent 60%), radial-gradient(1000px 500px at 100% 0%, rgba(99,102,241,.12), transparent 55%), var(--background); }

/* ---------- 暖阳 sunset：橙 → 品红 ---------- */
[data-style="sunset"] {
  --brand: 249 115 22;    /* #f97316 */
  --brand-2: 236 72 153;  /* #ec4899 */
  --hero-grad: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
}
[data-style="sunset"] .app-bg { background: radial-gradient(1200px 600px at 0% -10%, rgba(249,115,22,.12), transparent 60%), radial-gradient(1000px 500px at 100% 0%, rgba(236,72,153,.12), transparent 55%), var(--background); }

/* ---------- 松绿 emerald：翠绿 → 青 ---------- */
[data-style="emerald"] {
  --brand: 16 185 129;    /* #10b981 */
  --brand-2: 20 184 166;  /* #14b8a6 */
  --hero-grad: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
}
[data-style="emerald"] .app-bg { background: radial-gradient(1200px 600px at 0% -10%, rgba(16,185,129,.12), transparent 60%), radial-gradient(1000px 500px at 100% 0%, rgba(20,184,166,.12), transparent 55%), var(--background); }

/* ---------- 明暗主题 ---------- */
html.dark {
  --background: #18181b;
  --foreground: #fafafa;
  --card: #1f1f23;
  --border: #2e2e33;
  --secondary: #26262b;
  --secondary-fg: #fafafa;
  --muted: #26262b;
  --muted-fg: #a1a1aa;
  --accent: #26262b;
  --accent-fg: #fafafa;
}
html.dark body.cg-skin { background: var(--background); color: var(--foreground); }
html.dark .cg-nav-bar { background: rgba(24,24,27,.8); }
html.dark .doc-card, html.dark .doc-row, html.dark .side-card, html.dark .rec-card, html.dark .info-card, html.dark .preview-sec, html.dark .toc-sec, html.dark .review-sec, html.dark .cat-card, html.dark .cat-wall a { background: var(--card); }
html.dark .hero-search { background: #f4f4f5; }
html.dark .doc-paper { background: #fff; }
html.dark .breadcrumb { background: var(--card); }
html.dark .type-thumb img { filter: brightness(.92); }
html.dark .detail-desc, html.dark .doc-card-meta, html.dark .doc-row-meta, html.dark .hot-num, html.dark .result-count { color: var(--muted-fg); }
html.dark .pagination a { background: var(--card); border-color: var(--border); color: var(--muted-fg); }
html.dark .sort-pill a.active { background: var(--card); color: var(--foreground); }

/* 1.23.8：风格切换器已从前台移除 —— 风格由后台「文库布局 → 站点风格」统一设置。
   下方 [data-style] 配色规则保留：引导脚本仍会按后台设置注入 data-style。 */
.theme-btn { border: 1px solid var(--border); background: none; border-radius: 999px; width: 32px; height: 32px; cursor: pointer; font-size: 14px; color: var(--muted-fg); transition: all .15s; display: inline-flex; align-items: center; justify-content: center; }
.theme-btn:hover { border-color: var(--ring); }

/* 汉堡 + 移动端抽屉 */
.hamburger { display: none; border: 1px solid var(--border); background: none; border-radius: 10px; width: 36px; height: 36px; font-size: 16px; cursor: pointer; color: var(--muted-fg); }
@media (max-width: 1100px) { .hamburger { display: inline-flex; align-items: center; justify-content: center; } }
.wk-drawer { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.wk-drawer .wk-drawer-mask { position: absolute; inset: 0; background: rgba(0,0,0,.4); opacity: 0; transition: opacity .25s; }
.wk-drawer .wk-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 280px; background: var(--card); box-shadow: -8px 0 30px rgba(0,0,0,.12); padding: 20px; transform: translateX(100%); transition: transform .28s ease; overflow-y: auto; }
.wk-drawer.open { pointer-events: auto; }
.wk-drawer.open .wk-drawer-mask { opacity: 1; }
.wk-drawer.open .wk-drawer-panel { transform: translateX(0); }
.wk-drawer-head { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.wk-drawer-link { display: block; padding: 10px 4px; font-size: 15px; color: var(--foreground); border-bottom: 1px solid var(--border); }
.wk-drawer-link:hover { color: var(--ring); }
.nav-upload { color: var(--ring) !important; font-weight: 600; }

/* ============================================================
   登录 / 注册页（wenku 设计语言：品牌渐变背景 + 玻璃卡片）
   ============================================================ */
.cg-auth-page { min-height: 100vh; background: var(--background); display: flex; align-items: center; justify-content: center; padding: 32px 16px 104px; }
.cg-auth-page .app-bg { min-height: 100vh; }
/* 登录/注册页 body 是 flex 居中容器，页脚必须脱离文档流贴底，否则会与卡片横向并排 */
.cg-auth-page > .cg-footer { position: fixed; left: 0; right: 0; bottom: 0; margin-top: 0; padding: 20px 0 14px; z-index: 2; }
.cg-auth-wrap {
  width: 100%; max-width: 420px; margin: 0 auto;
  position: relative;
}
/* 背景装饰：品牌渐变光斑 */
.cg-auth-page::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgb(var(--brand)/.14), transparent 60%),
    radial-gradient(700px 420px at -10% 100%, rgb(var(--brand-2)/.12), transparent 55%);
}
.cg-auth-card {
  position: relative; z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15,23,42,.12);
  padding: 36px 32px 28px;
}
.cg-auth-logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--foreground);
}
.cg-auth-logo-img { height: 36px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.cg-auth-title { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 22px 0 6px; letter-spacing: -.3px; }
.cg-auth-sub { font-size: 13px; color: var(--muted-fg); margin: 0 0 22px; line-height: 1.6; }
.cg-auth-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
.cg-auth-field { margin-bottom: 14px; }
.cg-auth-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--foreground); }
.cg-auth-field input {
  width: 100%; height: 42px; border: 1px solid var(--input); border-radius: 10px;
  padding: 0 14px; font-size: 14px; background: var(--card); color: var(--foreground);
  outline: none; transition: all .15s;
}
.cg-auth-field input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(var(--brand)/.12); }
.cg-auth-field input::placeholder { color: var(--muted-fg); }
.cg-auth-btn {
  width: 100%; height: 44px; margin-top: 6px;
  background: var(--brand-grad); color: #fff; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; letter-spacing: 2px; cursor: pointer;
  box-shadow: 0 8px 20px -4px rgb(var(--brand)/.45); transition: all .15s;
}
.cg-auth-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.cg-auth-alt { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted-fg); }
.cg-auth-alt a { color: var(--ring); font-weight: 600; }
.cg-auth-alt a:hover { text-decoration: underline; }
.cg-auth-back { text-align: center; margin-top: 12px; font-size: 12px; }
.cg-auth-back a { color: var(--muted-fg); }
.cg-auth-back a:hover { color: var(--ring); }
/* 登录页社交提示 */
.cg-auth-tip { display: flex; align-items: center; gap: 12px; margin: 20px 0 4px; color: var(--muted-fg); font-size: 12px; }
.cg-auth-tip::before, .cg-auth-tip::after { content: ""; flex: 1; height: 1px; background: var(--border); }
html.dark .cg-auth-error { background: rgba(185,28,28,.15); border-color: rgba(185,28,28,.4); color: #fca5a5; }

/* ============================================================
   登录 / 注册 / VIP 弹窗（wenku 风格模态框）
   ============================================================ */
.lld-modal { position: fixed; inset: 0; z-index: 300; display: none; }
.lld-modal.open { display: block; }
/* 1.25.4 登录框必须压在「文档弹窗 / 会员弹窗」之上 —— 站长反馈的「点登录后开通没反应」就是这一条：
   从列表页点卡片开文档弹窗（z 100000）→ 里面点开通会员（vip 弹窗 z 100200）→ 点「登录后开通」，
   vip 弹窗关了、登录框确实也开了（open 类都在），但它还停在 300，被文档弹窗整个盖住 ——
   视觉上就是"什么都没发生"。层级三联：文档弹窗 100000 < 会员弹窗 100200 < 登录框 100300。
   用 id 选择器而不是加 !important：只在登录框这一处抬高，别把其它 .lld-modal 一起带上去。 */
#mldAuthModal { z-index: 100300; }
.lld-modal-mask { position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px); animation: mldFade .2s ease; }
.lld-modal-panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 400px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 32px 80px rgba(15,23,42,.3); padding: 28px; animation: mldPop .22s ease;
}
.lld-modal-x { position: absolute; right: 14px; top: 12px; width: 32px; height: 32px; border: none; background: var(--secondary); color: var(--muted-fg); border-radius: 50%; font-size: 18px; cursor: pointer; line-height: 1; transition: all .15s; }
.lld-modal-x:hover { background: var(--accent); color: var(--foreground); }
@keyframes mldFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mldPop { from { opacity: 0; transform: translate(-50%,-46%) scale(.97); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
/* 登录/注册 */
.lld-auth-logo { display: inline-flex; align-items: center; gap: 6px; font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--foreground); text-decoration: none; }
.lld-auth-logo-img { height: 28px; width: auto; max-width: 180px; object-fit: contain; display: block; }
.lld-auth-tabs { display: flex; gap: 4px; background: var(--secondary); border-radius: 999px; padding: 3px; margin: 18px 0 16px; }
.lld-auth-tab { flex: 1; border: none; background: none; border-radius: 999px; padding: 8px 0; font-size: 14px; font-weight: 600; color: var(--muted-fg); cursor: pointer; transition: all .15s; }
.lld-auth-tab.active { background: #fff; color: var(--foreground); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
html.dark .lld-auth-tab.active { background: var(--accent); color: var(--accent-fg); }
.lld-auth-err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
html.dark .lld-auth-err { background: rgba(185,28,28,.15); border-color: rgba(185,28,28,.4); color: #fca5a5; }
/* 弹窗上下文（1.18.18）：说明"为什么被拦下来、登录能得到什么"。
   与 .lld-auth-err 同为内嵌卡片，但语气是中性说明而不是报错，故用灰底不用红。 */
.lld-auth-ctx { background: var(--secondary); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.lld-auth-ctx-t { font-size: 14.5px; font-weight: 700; color: var(--foreground); line-height: 1.4; }
.lld-auth-ctx-s { font-size: 12.5px; line-height: 1.55; color: var(--muted-fg); margin-top: 4px; }
.lld-auth-field { margin-bottom: 12px; }
.lld-auth-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--foreground); }
.lld-auth-field input {
  width: 100%; height: 40px; border: 1px solid var(--input); border-radius: 10px;
  padding: 0 13px; font-size: 14px; background: var(--card); color: var(--foreground);
  outline: none; transition: all .15s;
}
.lld-auth-field input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(var(--brand)/.12); }
.lld-auth-field input::placeholder { color: var(--muted-fg); }
.lld-auth-row { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 14px; }
.lld-auth-check { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted-fg); cursor: pointer; }
.lld-auth-check input { width: auto; height: auto; }
.lld-auth-link { background: none; border: none; padding: 0; font-size: 13px; color: var(--ring); cursor: pointer; text-decoration: none; }
.lld-auth-link:hover { text-decoration: underline; }
.lld-auth-btn {
  width: 100%; height: 42px; border: none; border-radius: 12px;
  background: var(--brand-grad); color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 2px;
  cursor: pointer; box-shadow: 0 8px 20px -4px rgb(var(--brand)/.45); transition: all .15s;
}
.lld-auth-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.lld-auth-btn:disabled { opacity: .7; cursor: wait; }
/* VIP 卡 */
.lld-vip { text-align: center; }
.lld-vip-hero {
  display: inline-block; padding: 5px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: #b45309; color: #fff; box-shadow: 0 6px 16px -8px rgba(120,53,15,.45);
}
.lld-vip-title { font-family: var(--serif); font-size: 21px; font-weight: 700; margin: 16px 0 14px; letter-spacing: -.2px; }
.lld-vip-list { list-style: none; margin: 0 0 18px; padding: 0; text-align: left; }
.lld-vip-list li { display: flex; align-items: center; gap: 8px; padding: 7px 4px; font-size: 14px; color: var(--foreground); border-bottom: 1px dashed var(--border); }
.lld-vip-list li:last-child { border-bottom: none; }
.lld-vip-btn {
  display: block; width: 100%; padding: 12px 0; border-radius: 12px; text-align: center;
  background: #b45309; color: #fff; font-size: 15px; font-weight: 700;
  text-decoration: none; box-shadow: 0 8px 20px -10px rgba(120,53,15,.5); transition: all .15s;
}
.lld-vip-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.lld-vip-tip { margin-top: 14px; font-size: 13px; color: var(--muted-fg); }

/* 订单确认区：滚到此处时避开吸顶导航；新单/回到页面时高亮提示 */
.lld-order-panel { scroll-margin-top: 64px; }
.lld-order-card.is-flash { animation: lldOrderFlash 1.7s ease 2; }
@keyframes lldOrderFlash {
  0%   { box-shadow: 0 0 0 0 rgba(249,115,22,.62); }
  100% { box-shadow: 0 0 0 18px rgba(249,115,22,0); }
}
.lld-order-created {
  display: inline-block; margin: -4px 0 12px; padding: 5px 12px; border-radius: 999px;
  background: rgba(22,163,74,.12); color: #15803d; font-size: 12.5px; font-weight: 600;
}
html.dark .lld-order-created { background: rgba(34,197,94,.16); color: #4ade80; }

/* 订单卡片：支付方式选择 / 通道状态提示 */
.lld-pay-method {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 14px;
  background: var(--secondary); border: 1px solid var(--border); text-align: left;
}
.lld-pay-method-label { font-size: 12px; color: var(--muted-fg); margin-bottom: 8px; letter-spacing: .04em; }
.lld-pay-method-name { font-size: 14px; font-weight: 600; color: var(--foreground); }
.lld-pay-type-pick { display: flex; gap: 8px; }
.lld-pay-type-pick-btn {
  flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 6px; border: 1px solid var(--border); border-radius: 11px; background: var(--card);
  color: var(--muted-fg); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.lld-pay-type-pick-btn:hover { border-color: var(--ring); color: var(--foreground); }
.lld-pay-type-pick-btn.active {
  border-color: #f97316; color: #ea580c; background: rgba(249,115,22,.09);
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}
html.dark .lld-pay-type-pick-btn.active { color: #fb923c; background: rgba(249,115,22,.16); }
.lld-pay-type-ico { font-size: 15px; line-height: 1; }
.lld-pay-warn { font-size: 12.5px; line-height: 1.6; font-weight: 600; }
.lld-pay-warn.is-danger { color: #b91c1c; }
html.dark .lld-pay-warn.is-danger { color: #f87171; }
.lld-vip-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.lld-vip-btn:disabled:hover { filter: none; transform: none; }
/* 站内余额支付：与主支付按钮并列的次要入口（描边风格，不抢主按钮的视觉） */
.lld-pay-wallet-btn { margin-top: 10px; background: var(--card); color: var(--foreground); border: 1.5px solid rgb(var(--brand)/.4); box-shadow: none; }
.lld-pay-wallet-btn:hover:not(:disabled) { background: rgb(var(--brand)/.06); border-color: rgb(var(--brand)/.7); }
.lld-pay-wallet-btn:disabled { border-color: var(--border); }

/* ============================================================
   支付弹窗（扫码支付，wenku 风格）
   ============================================================ */
.cg-modal-overlay { position: fixed; inset: 0; z-index: 320; display: none; }
.cg-modal-overlay.open { display: flex; align-items: center; justify-content: center; }
.cg-modal-overlay::before { content: ""; position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px); }
.cg-modal.cg-pay-modal {
  position: relative; z-index: 1; width: 340px; max-width: calc(100vw - 32px);
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 32px 80px rgba(15,23,42,.3); padding: 28px 24px 22px; text-align: center;
}
.cg-modal-close {
  position: absolute; right: 12px; top: 10px; width: 32px; height: 32px; border: none;
  background: var(--secondary); color: var(--muted-fg); border-radius: 50%; font-size: 18px;
  cursor: pointer; line-height: 1; z-index: 2; transition: all .15s;
}
.cg-modal-close:hover { background: var(--accent); color: var(--foreground); }
.cg-modal-logo { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--muted-fg); margin-bottom: 6px; }
.cg-modal-title { font-family: var(--serif); font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.cg-modal-sub { font-size: 12.5px; color: var(--muted-fg); margin-bottom: 14px; }
.cg-pay-type { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.cg-pay-type-btn { border: 1px solid var(--border); background: none; border-radius: 999px; padding: 5px 14px; font-size: 12.5px; color: var(--muted-fg); cursor: pointer; transition: all .15s; }
.cg-pay-type-btn.active { border-color: var(--ring); color: var(--ring); font-weight: 600; background: rgb(var(--brand)/.06); }
.cg-pay-qrcode { display: flex; justify-content: center; margin-bottom: 12px; }
.cg-pay-qrcode img, .cg-pay-qrcode canvas { border-radius: 10px; border: 1px solid var(--border); }
.cg-pay-status { font-size: 13px; color: var(--muted-fg); margin-bottom: 6px; }
.cg-pay-amount { font-size: 22px; font-weight: 800; color: #f97316; }

/* ============================================================
   用户中心（wenku 风格：左菜单 + 右内容卡）
   ============================================================ */
.cg-uc-main { max-width: 1080px; margin: 0 auto; padding: 28px 20px; display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 20px; align-items: start; }
@media (max-width: 820px) { .cg-uc-main { grid-template-columns: 1fr; } .cg-uc-side { position: static !important; } }
.cg-uc-side { position: sticky; top: 84px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 12px; }
.cg-uc-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.cg-uc-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; flex-shrink: 0; }
.cg-uc-name { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-uc-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cg-uc-menu li a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14px; color: var(--muted-fg); text-decoration: none; transition: all .15s; }
.cg-uc-menu li a:hover { background: var(--accent); color: var(--foreground); }
.cg-uc-menu li.active a { background: rgb(var(--brand)/.08); color: var(--ring); font-weight: 600; }
.cg-uc-icon { font-size: 16px; display: flex; align-items: center; justify-content: center; width: 20px; flex: none; }
.cg-uc-content { min-width: 0; }
.cg-uc-hint { display: flex; align-items: center; gap: 8px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.cg-uc-info { display: flex; flex-direction: column; }
.cg-uc-info-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 10px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.cg-uc-info-row:last-child { border-bottom: none; }
.cg-uc-info-label { color: var(--muted-fg); flex-shrink: 0; }
.cg-uc-info-val { font-weight: 700; color: var(--foreground); text-align: right; }
.cg-uc-empty { text-align: center; padding: 40px 0; color: var(--muted-fg); }
.cg-uc-empty-icon { font-size: 42px; margin-bottom: 8px; color: var(--muted-fg); display: flex; justify-content: center; }
.cg-uc-empty p { margin: 0 0 4px; font-size: 14px; }
.cg-uc-empty small { font-size: 12.5px; }
.cg-uc-empty small a { color: var(--ring); }
/* 账号设置表单（昵称/前端昵称/密码） */
.cg-uc-card + .cg-uc-card { margin-top: 16px; }
.cg-uc-desc { margin: -6px 0 14px; font-size: 13px; line-height: 1.75; color: var(--muted-fg); }
.cg-uc-desc strong { color: var(--foreground); }
.cg-uc-form { display: flex; flex-direction: column; gap: 14px; }
.cg-uc-form-row { display: flex; flex-direction: column; gap: 7px; }
.cg-uc-form-row > label { font-size: 13px; font-weight: 600; color: var(--foreground); }
.cg-uc-form-row input[type="text"],
.cg-uc-form-row input[type="password"],
/* 1.18.13：补 tel —— 手机号输入框此前不在选择器里，掉回浏览器默认的 21px 小方框，
   和同卡片里其它 40px 输入框明显不齐（1.8.0 加手机号字段时就漏了）。 */
.cg-uc-form-row input[type="tel"] { width: 100%; max-width: 380px; height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 13px; font-size: 14px; background: var(--card); color: var(--foreground); outline: none; transition: border-color .15s, box-shadow .15s; }
.cg-uc-form-row input[type="text"]:focus,
.cg-uc-form-row input[type="password"]:focus,
.cg-uc-form-row input[type="tel"]:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(var(--brand)/.12); }

/* 1.18.13：绑号行的「获取验证码」按钮。它是 .cg-btn（次级按钮，默认只有 25px 高），
   必须手动抬到 40px 才和右边的验证码输入框齐平 —— 否则一个 40 一个 25，看着像坏了。 */
.cg-uc-form-row #lld-phone-send { flex: 0 0 auto; height: 40px; padding: 0 16px; font-size: 14px; white-space: nowrap; border-radius: 10px; }
.cg-uc-form-row #lld-phone-send:disabled { opacity: .6; cursor: not-allowed; }
.cg-uc-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--foreground); cursor: pointer; }
.cg-uc-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ring); cursor: pointer; }
.cg-uc-tip { font-size: 12.5px; line-height: 1.7; color: var(--muted-fg); }
.cg-uc-form-act { padding-top: 2px; }

/* ===== 分销中心 ===== */
.cg-dist-msg { border-radius: 10px; padding: 11px 15px; font-size: 13.5px; margin-bottom: 14px; }
.cg-dist-msg.is-ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.cg-dist-msg.is-err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

.cg-dist-hero {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(135deg, rgb(var(--brand)/.10), rgb(var(--brand)/.03));
  border: 1px solid rgb(var(--brand)/.18); border-radius: 12px; padding: 18px;
  margin-bottom: 16px;
}
.cg-dist-hero.is-wait { background: #fffbeb; border-color: #fde68a; }
.cg-dist-hero.is-ban { background: #fef2f2; border-color: #fecaca; }
.cg-dist-hero-ico { font-size: 28px; line-height: 1; flex-shrink: 0; }
.cg-dist-hero-title { font-size: 16px; font-weight: 700; color: var(--foreground); margin-bottom: 4px; }
.cg-dist-hero p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--muted-fg); }
.cg-dist-hero strong { color: var(--ring); }

.cg-dist-steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.cg-dist-steps li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted-fg); background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; }
.cg-dist-steps li span { width: 22px; height: 22px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-grad); color: #fff; font-size: 12px; font-weight: 700; }

.cg-dist-link-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cg-dist-link-row input { flex: 1; min-width: 240px; height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 0 13px; font-size: 13px; font-family: Consolas, Monaco, monospace; background: var(--card); color: var(--ring); }
.cg-dist-link-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--muted-fg); }
.cg-dist-link-meta b { color: var(--foreground); }
.cg-dist-qr { margin-top: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cg-dist-qr #cgDistQr { width: 132px; height: 132px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.cg-dist-qr small { font-size: 12px; color: var(--muted-fg); }

.cg-dist-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cg-dist-stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.cg-dist-stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-grad); }
.cg-dist-stat.is-warn::after { background: #f59e0b; }
.cg-dist-stat.is-info::after { background: #0ea5e9; }
.cg-dist-stat.is-ok::after { background: #10b981; }
.cg-dist-stat-val { font-size: 19px; font-weight: 700; color: var(--foreground); }
.cg-dist-stat.is-warn .cg-dist-stat-val { color: #b45309; }
.cg-dist-stat.is-ok .cg-dist-stat-val { color: #15803d; }
.cg-dist-stat-label { font-size: 12px; color: var(--muted-fg); margin-top: 3px; }

.cg-dist-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.cg-dist-form-grid .cg-uc-form-row input, .cg-dist-form-grid .cg-uc-form-row select { max-width: none; }

.cg-dist-table-wrap { overflow-x: auto; }
.cg-dist-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.cg-dist-table thead th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--muted-fg); padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.cg-dist-table tbody td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--foreground); white-space: nowrap; }
.cg-dist-table tbody tr:last-child td { border-bottom: 0; }
.cg-dist-table .is-amount { font-weight: 700; color: #15803d; }

.cg-dist-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.cg-dist-badge.is-frozen { background: #fef3c7; color: #b45309; }
.cg-dist-badge.is-ready { background: #e0f2fe; color: #0369a1; }
.cg-dist-badge.is-done { background: #dcfce7; color: #15803d; }
.cg-dist-badge.is-void { background: #fee2e2; color: #b91c1c; }

.cg-dist-referrals { list-style: none; margin: 0; padding: 0; }
.cg-dist-referrals li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.cg-dist-referrals li:last-child { border-bottom: 0; }
.cg-dist-ref-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.cg-dist-ref-name { font-weight: 600; color: var(--foreground); }
.cg-dist-ref-time { margin-left: auto; font-size: 12px; color: var(--muted-fg); }

.cg-dist-empty { text-align: center; padding: 34px 0; color: var(--muted-fg); }
.cg-dist-empty-ico { font-size: 38px; margin-bottom: 8px; }
.cg-dist-empty p { margin: 0 0 4px; font-size: 14px; }
.cg-dist-empty small { font-size: 12.5px; }

.cg-dist-notice { margin-top: 16px; background: var(--accent); border: 1px dashed var(--border); border-radius: 10px; padding: 13px 16px; font-size: 12.5px; line-height: 1.85; color: var(--muted-fg); }
html.dark .cg-dist-msg.is-ok { background: rgba(21,128,61,.15); border-color: rgba(21,128,61,.4); color: #4ade80; }
html.dark .cg-dist-msg.is-err { background: rgba(185,28,28,.15); border-color: rgba(185,28,28,.4); color: #fca5a5; }

/* 我的等级 */
.cg-dist-level { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 15px 16px; background: var(--card); overflow: hidden; }
.cg-dist-level::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--brand-grad); }
.cg-dist-level-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.cg-dist-level-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 700; background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.cg-dist-level-badge.is-none { background: #f4f4f5; color: #6b7280; border-color: #e4e4e7; }
.cg-dist-level-rate { margin-left: auto; font-size: 12.5px; color: var(--muted-fg); }
.cg-dist-level-rate b { font-size: 14px; color: #15803d; }
.cg-dist-level-sum { font-size: 12.5px; color: var(--muted-fg); }
.cg-dist-level-sum b { font-size: 15px; color: var(--foreground); }
.cg-dist-level-bar { position: relative; height: 7px; border-radius: 999px; background: var(--accent); overflow: hidden; margin: 10px 0 7px; }
.cg-dist-level-bar span { display: block; height: 100%; border-radius: 999px; background: var(--brand-grad); transition: width .4s ease; }
.cg-dist-level-tip { font-size: 12px; color: var(--muted-fg); line-height: 1.6; }
.cg-dist-level-tip b { color: #b45309; }
.cg-dist-level-tip.is-top { color: #15803d; font-weight: 600; }
html.dark .cg-dist-level-badge { background: rgba(146,64,14,.28); color: #fcd34d; border-color: rgba(252,211,77,.32); }
html.dark .cg-dist-level-badge.is-none { background: rgba(107,114,128,.25); color: #a1a1aa; border-color: rgba(161,161,170,.3); }
html.dark .cg-dist-level-rate b { color: #4ade80; }
html.dark .cg-dist-level-tip b { color: #fcd34d; }
html.dark .cg-dist-level-tip.is-top { color: #4ade80; }

/* 收藏/足迹列表 */
.cg-uc-fav-list { list-style: none; margin: 0; padding: 0; }
.cg-uc-fav-list li { display: flex; align-items: center; gap: 14px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.cg-uc-fav-list li:last-child { border-bottom: none; }
.cg-uc-fav-cover { flex-shrink: 0; width: 44px; display: flex; align-items: center; justify-content: center; }
.cg-uc-fav-body { flex: 1; min-width: 0; }
.cg-uc-fav-name { display: block; font-size: 14px; color: var(--foreground); font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-uc-fav-name:hover { color: var(--ring); }
.cg-uc-fav-meta { display: flex; gap: 10px; margin-top: 4px; font-size: 12px; color: var(--muted-fg); }
.cg-uc-fav-open { flex-shrink: 0; font-size: 13px; color: var(--ring); text-decoration: none; }
html.dark .cg-uc-hint { background: rgba(21,128,61,.15); border-color: rgba(21,128,61,.4); color: #4ade80; }

/* 我的订单 */
.cg-uc-hint-err { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
html.dark .cg-uc-hint-err { background: rgba(185,28,28,.15); border-color: rgba(185,28,28,.4); color: #fca5a5; }
.cg-uc-order-list { list-style: none; margin: 0; padding: 0; }
.cg-uc-order-list li { display: flex; align-items: flex-start; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.cg-uc-order-list li:last-child { border-bottom: none; }
.cg-uc-order-main { flex: 1; min-width: 0; }
.cg-uc-order-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cg-uc-order-name { font-size: 14px; font-weight: 600; color: var(--foreground); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-uc-order-badge { flex-shrink: 0; font-size: 11.5px; line-height: 1; padding: 4px 8px; border-radius: 999px; border: 1px solid transparent; }
.cg-uc-order-badge.is-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.cg-uc-order-badge.is-blue { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.cg-uc-order-badge.is-warn { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.cg-uc-order-badge.is-gray { background: #f4f4f5; color: #6b7280; border-color: #e4e4e7; }
html.dark .cg-uc-order-badge.is-ok { background: rgba(4,120,87,.18); color: #6ee7b7; border-color: rgba(110,231,183,.3); }
html.dark .cg-uc-order-badge.is-blue { background: rgba(29,78,216,.2); color: #93c5fd; border-color: rgba(147,197,253,.3); }
html.dark .cg-uc-order-badge.is-warn { background: rgba(180,83,9,.2); color: #fcd34d; border-color: rgba(252,211,77,.3); }
html.dark .cg-uc-order-badge.is-gray { background: rgba(107,114,128,.2); color: #d1d5db; border-color: rgba(209,213,219,.25); }
.cg-uc-order-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 5px; font-size: 12px; color: var(--muted-fg); }
.cg-uc-order-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.cg-uc-order-note { margin-top: 6px; font-size: 12.5px; color: #b45309; }
.cg-uc-order-side { flex-shrink: 0; width: 190px; text-align: right; }
.cg-uc-order-amt { font-size: 15px; font-weight: 700; color: var(--foreground); }
.cg-uc-order-orig { font-size: 12px; color: var(--muted-fg); margin-top: 2px; }
/* 待支付订单：整条卡片高亮 + 实心主按钮强引导
   （原来「去支付」只是一行 13px 蓝色文字，跟旁边的灰色说明文字份量差不多，用户直接划过去了） */
.cg-uc-order-list li.is-pending {
  background: linear-gradient(90deg, rgba(249,115,22,.10) 0%, rgba(249,115,22,.02) 68%, transparent 100%);
  border-left: 3px solid #f59e0b;
  border-radius: 0 10px 10px 0;
  margin: 0 -12px;
  padding-left: 12px;
  padding-right: 12px;
}
html.dark .cg-uc-order-list li.is-pending { background: linear-gradient(90deg, rgba(249,115,22,.17) 0%, rgba(249,115,22,.04) 68%, transparent 100%); }
.cg-uc-paybtn {
  display: block; margin-top: 10px; padding: 11px 6px; border-radius: 12px;
  background: #b45309; color: #fff;
  font-size: 15px; font-weight: 700; letter-spacing: .5px; line-height: 1.3;
  text-align: center; text-decoration: none;
  box-shadow: 0 8px 20px -6px rgba(249,115,22,.6);
  transition: transform .15s ease, filter .15s ease;
  animation: cgPayPulse 2.2s ease-in-out infinite;
}
.cg-uc-paybtn:hover, .cg-uc-paybtn:focus-visible { filter: brightness(1.07); transform: translateY(-1px); color: #fff; }
@keyframes cgPayPulse {
  0%, 100% { box-shadow: 0 8px 20px -6px rgba(249,115,22,.6), 0 0 0 0 rgba(249,115,22,.42); }
  55%      { box-shadow: 0 8px 20px -6px rgba(249,115,22,.6), 0 0 0 8px rgba(249,115,22,0); }
}
@media (prefers-reduced-motion: reduce) { .cg-uc-paybtn { animation: none; } }
.cg-uc-paysub { margin-top: 6px; font-size: 12px; color: var(--muted-fg); text-align: center; }

/* 用户中心顶部「有待支付订单」提醒条（非订单页才出现，一键进订单页） */
.cg-uc-payalert {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(135deg, #fff7ed, #ffedd5); border: 1px solid #fdba74;
  border-radius: 12px; padding: 12px 16px; margin-bottom: 14px;
}
/* 圆形图标底：不依赖 emoji 字体渲染，任何环境都是橙色实心圆 */
.cg-uc-payalert-icon {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: #b45309; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; line-height: 1;
  box-shadow: 0 5px 14px -5px rgba(249,115,22,.85);
}
.cg-uc-payalert-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cg-uc-payalert-text strong { font-size: 14px; color: #9a3412; }
.cg-uc-payalert-text span { font-size: 12.5px; color: #b45309; }
.cg-uc-payalert-btn {
  flex-shrink: 0; padding: 9px 20px; border-radius: 999px; text-decoration: none;
  background: #b45309; color: #fff;
  font-size: 13.5px; font-weight: 700; box-shadow: 0 6px 16px -10px rgba(120,53,15,.55);
  transition: filter .15s ease, transform .15s ease;
}
.cg-uc-payalert-btn:hover { filter: brightness(1.06); transform: translateY(-1px); color: #fff; }
html.dark .cg-uc-payalert { background: rgba(249,115,22,.12); border-color: rgba(249,115,22,.38); }
html.dark .cg-uc-payalert-text strong { color: #fdba74; }
html.dark .cg-uc-payalert-text span { color: #fcd34d; }
/* 订单直达入口（查看文档 / 我的会员）—— 与「申请退款」这类破坏性操作区分开，做成胶囊次要按钮 */
.cg-uc-order-link { display: inline-block; margin-top: 8px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--ring); border: 1px solid var(--ring); border-radius: 999px; text-decoration: none; transition: background .15s ease, color .15s ease; }
.cg-uc-order-link:hover { background: var(--ring); color: #fff; }
html.dark .cg-uc-order-link:hover { color: #0b0b0f; }
.cg-uc-order-none { display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--muted-fg); }
.cg-uc-order-form { margin-top: 8px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cg-uc-order-form input[type="text"] { width: 100%; max-width: 190px; padding: 6px 10px; font-size: 12.5px; border: 1px solid var(--border); border-radius: 8px; background: var(--background); color: var(--foreground); }
.cg-uc-order-form button { padding: 6px 14px; font-size: 12.5px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: #b91c1c; cursor: pointer; }
.cg-uc-order-form button:hover { background: #fef2f2; border-color: #fecaca; }
html.dark .cg-uc-order-form button { background: transparent; }
/* 待支付订单旁的「取消订单」：次要操作，不能跟「立即支付」抢视觉重心 */
.cg-uc-cancel-form { margin-top: 6px; display: flex; justify-content: flex-end; }
.cg-uc-cancel-form button { padding: 4px 12px; font-size: 12.5px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--muted-fg); cursor: pointer; transition: color .15s, border-color .15s; }
.cg-uc-cancel-form button:hover { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
html.dark .cg-uc-cancel-form button:hover { background: rgba(185, 28, 28, .12); }
@media (max-width: 640px) {
  .cg-uc-order-list li { flex-direction: column; gap: 8px; }
  .cg-uc-order-side { width: 100%; text-align: left; }
  .cg-uc-order-form { align-items: flex-start; }
  .cg-uc-cancel-form { justify-content: flex-start; }
}

/* ===== 移动端适配优化 ===== */
@media (max-width: 760px) {
  .cg-nav-link { display: none; }              /* 首页/分类移入汉堡抽屉 */
  .cg-nav-search { min-width: 0; }             /* 允许收缩 */
  .cg-nav-search input { min-width: 0; }
  .cg-nav-logo-name { font-size: 16px; }
  .doc-paper { padding: 6px 0 !important; }    /* 移动端纸张去大内边距 */
  .doc-paper h1 { font-size: 22px; }
  .preview-body { padding: 12px; }
  .hero-title { font-size: 30px; }
  .home-grid, .detail-grid, .cg-uc-main { padding-left: 14px; padding-right: 14px; }
  .doc-card-body { padding: 12px; }
}
@media (max-width: 560px) {
  .cg-nav-search { max-width: 120px; }
  .hero-inner { padding: 36px 0 44px; }
  .hero-title { font-size: 26px; }
  .hero-search { padding: 6px 6px 6px 14px; }
  .hero-search button { padding: 8px 14px; font-size: 13px; }
  .carousel-item { flex-basis: 210px; }
  .info-card .info-cover { height: 140px; }
}

/* ===== 窄屏图层修复：禁用 sticky 悬浮，防止滚动时信息卡/封面漂浮遮挡 ===== */
@media (max-width: 1200px) {
  .home-right { display: none !important; }
}
@media (max-width: 900px) {
  .home-left, .home-right, .detail-left, .cg-uc-side { position: static !important; }
  .detail-left { margin-bottom: 16px; }
  .home-grid, .detail-grid { align-items: stretch; }
}
/* 单列（≤1000px）时详情页信息卡封面完整显示（contain），避免被 object-fit:cover 裁成一条导致"只显示一半"
   ⚠️ 该封面图已于 1.18.4 从详情页移除，本条与其上的 140px 那条同为保留规则（见 .info-cover 处的说明）。 */
@media (max-width: 1000px) {
  .info-card .info-cover { height: 300px; background: var(--secondary); }
  .info-card .info-cover img { object-fit: contain; width: 100%; height: 100%; }
}
@media (max-width: 760px) {
  .cg-nav-bar { position: static; } /* 移动端导航不吸附，避免遮内容 */
}

/* ===== 账号头像悬停下拉菜单 ===== */
.cg-nav-user-wrap { position: relative; }
.cg-nav-dropdown {
  position: absolute; right: 0; top: calc(100% + 12px); width: 228px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15,23,42,.16); padding: 8px; z-index: 120;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .18s ease;
}
.cg-nav-user-wrap:hover .cg-nav-dropdown, .cg-nav-user-wrap:focus-within .cg-nav-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.cg-nav-dd-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.cg-nav-dd-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; flex-shrink: 0; }
.cg-nav-dd-info { min-width: 0; }
.cg-nav-dd-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-nav-dd-mail { font-size: 11.5px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cg-nav-dd-menu { display: flex; flex-direction: column; gap: 2px; }
.cg-nav-dd-menu a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; font-size: 13.5px; color: var(--foreground); text-decoration: none; transition: all .15s; }
.cg-nav-dd-menu a span { font-size: 14px; }
.cg-nav-dd-menu a:hover { background: var(--accent); color: var(--ring); }
.cg-nav-dd-menu a.cg-nav-dd-logout { color: #dc2626; border-top: 1px solid var(--border); margin-top: 4px; border-radius: 9px; }
.cg-nav-dd-menu a.cg-nav-dd-logout:hover { background: rgba(220,38,38,.08); color: #dc2626; }
@media (max-width: 900px) { .cg-nav-dropdown { position: fixed; right: 12px; top: 64px; } }

/* ===== Banner 轮播（后台开关） ===== */
.wk-banner { margin: 22px 0 0; }
.wk-banner .cg-container { position: relative; }
.wk-banner-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 700px) { .wk-banner-track { grid-template-columns: 1fr; } .wk-banner-dots { display: none; } }
.wk-banner-slide { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm); transition: all .18s; text-decoration: none; }
.wk-banner-slide:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(47,111,237,.4); }
.wk-banner-cover { width: 96px; height: 72px; border-radius: 10px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--secondary); }
.wk-banner-cover img { width: 100%; height: 100%; object-fit: cover; }
.wk-banner-info { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.wk-banner-title { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-banner-meta { font-size: 12px; color: var(--muted-fg); }
.wk-banner-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.wk-banner-dots i { width: 8px; height: 8px; border-radius: 999px; background: var(--border); cursor: pointer; transition: all .2s; }
.wk-banner-dots i.active { width: 20px; background: var(--ring); }
/* ===== 公告栏 ===== */
.wk-notice { background: linear-gradient(90deg, rgb(var(--brand)/.08), transparent); border-bottom: 1px solid rgb(var(--brand)/.12); }
.wk-notice .cg-container { padding: 10px 20px; font-size: 13.5px; color: var(--foreground); display: flex; align-items: center; gap: 8px; }

/* ===== 导航栏深色风格（后台导航设置：蓝紫渐变底） ===== */
.cg-nav-bar.cg-nav-dark {
  background: #2456b8;
  border-bottom-color: rgba(255,255,255,.14);
}
.cg-nav-bar.cg-nav-dark .cg-nav-logo-name { color: #fff; }
.cg-nav-bar.cg-nav-dark .cg-nav-logo-badge { background: rgba(255,255,255,.22); box-shadow: none; }
.cg-nav-bar.cg-nav-dark .cg-nav-link { color: rgba(255,255,255,.88); }
.cg-nav-bar.cg-nav-dark .cg-nav-link:hover,
.cg-nav-bar.cg-nav-dark .cg-nav-link.active { color: #fff; background: rgba(255,255,255,.16); }
.cg-nav-bar.cg-nav-dark .cg-nav-search input { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
.cg-nav-bar.cg-nav-dark .cg-nav-search input::placeholder { color: rgba(255,255,255,.72); }
.cg-nav-bar.cg-nav-dark .cg-nav-search input:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.cg-nav-bar.cg-nav-dark .cg-nav-vip { background: rgba(255,255,255,.2); box-shadow: none; }
.cg-nav-bar.cg-nav-dark .cg-nav-login { color: rgba(255,255,255,.9); }
.cg-nav-bar.cg-nav-dark .cg-nav-login:hover { color: #fff; }
.cg-nav-bar.cg-nav-dark .theme-btn { color: rgba(255,255,255,.9); }
.cg-nav-bar.cg-nav-dark .hamburger { color: #fff; }
html.dark .cg-nav-bar.cg-nav-dark { background: #1f4a9e; }
/* Logo 图片（后台导航设置上传） */
.cg-nav-logo-img { height: 40px; width: auto; max-width: 210px; object-fit: contain; display: block; }
/* 导航「文档分类」下拉 */
.cg-nav-catwrap { position: relative; }
.cg-nav-catmenu {
  position: absolute; left: 0; top: calc(100% + 10px); min-width: 190px; max-height: 380px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15,23,42,.14); padding: 6px; z-index: 120;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .18s ease;
}
.cg-nav-catwrap:hover .cg-nav-catmenu, .cg-nav-catwrap:focus-within .cg-nav-catmenu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.cg-nav-catmenu a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; color: var(--foreground); text-decoration: none; }
.cg-nav-catmenu a:hover { background: var(--accent); color: var(--ring); }
@media (max-width: 900px) { .cg-nav-catmenu { position: fixed; left: 12px; top: 64px; max-height: 60vh; } }

.cg-legal-wrap { max-width: 880px; margin: 0 auto; padding: 32px 20px 56px; }
.cg-legal-head h1 { font-size: 26px; margin: 0 0 6px; }
.cg-legal-head .sub { font-size: 13px; color: var(--muted-fg, #6b7280); margin-bottom: 22px; }
.cg-legal-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px 26px; margin-bottom: 18px; }
.cg-legal-card h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.cg-legal-card p, .cg-legal-card li { font-size: 14px; line-height: 1.9; color: var(--foreground); }
.cg-legal-card ol, .cg-legal-card ul { padding-left: 22px; margin: 8px 0; }
.cg-legal-card li { margin-bottom: 4px; }
.cg-legal-note { background: #fff8e6; border: 1px solid #f0d68a; border-radius: 10px; padding: 14px 18px; font-size: 13px; line-height: 1.8; color: #7a5a12; }
.cg-legal-steps { counter-reset: cs; list-style: none; padding-left: 0; }
.cg-legal-steps li { position: relative; padding-left: 36px; margin-bottom: 12px; }
.cg-legal-steps li::before { counter-increment: cs; content: counter(cs); position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--ring, #2f6fed); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.cg-legal-foot { text-align: center; font-size: 13px; color: var(--muted-fg, #6b7280); padding-top: 8px; }
.cg-legal-foot a { color: var(--ring, #2f6fed); }
.cg-legal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.cg-legal-btn { display: inline-block; padding: 9px 20px; border-radius: 8px; font-size: 14px; text-decoration: none; background: var(--ring, #2f6fed); color: #fff; }
.cg-legal-btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--foreground); }
/* 列表项内的注释（正文里以 "> " 开头的行） */
.cg-legal-card .cg-legal-inline-note { display: block; margin-top: 4px; color: var(--muted-fg, #6b7280); font-size: 13px; line-height: 1.8; }

/* 页脚：版权声明 / 侵权投诉入口 */
.cg-footer-links { margin-top: 6px; font-size: 12px; }
.cg-footer-links a { color: #a1a1aa; }
.cg-footer-links a:hover { color: #fff; }
.cg-footer-links .sep { margin: 0 10px; opacity: .45; }

/* ===== 我的消息（通知中心）===== */
.cg-uc-menu-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--destructive); color: #fff; font-size: 11px; font-style: normal;
  font-weight: 700; line-height: 18px; text-align: center;
}
/* 待支付订单徽标：用橙色跟消息红点区分（红=消息，橙=待付款） */
.cg-uc-menu-badge.is-pay { background: #b45309; }
.cg-uc-msg-head-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cg-uc-msg-count {
  margin-left: 8px; padding: 2px 9px; border-radius: 20px; background: rgb(var(--brand)/.1);
  color: var(--ring); font-family: var(--sans); font-size: 12px; font-style: normal; font-weight: 600;
}
.cg-uc-msg-allread { font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--muted-fg); text-decoration: none; }
.cg-uc-msg-allread:hover { color: var(--ring); }
.cg-uc-msg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cg-uc-msg-item {
  position: relative; padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--card); transition: all .15s;
}
.cg-uc-msg-item:hover { border-color: rgb(var(--brand)/.35); box-shadow: var(--shadow-sm); }
.cg-uc-msg-item.is-unread { background: rgb(var(--brand)/.04); border-color: rgb(var(--brand)/.22); }
.cg-uc-msg-item.is-unread::before {
  content: ""; position: absolute; left: 0; top: 16px; width: 3px; height: 18px;
  border-radius: 0 3px 3px 0; background: var(--ring);
}
.cg-uc-msg-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cg-uc-msg-title { font-size: 14.5px; font-weight: 600; color: var(--foreground); }
.cg-uc-msg-item:not(.is-unread) .cg-uc-msg-title { font-weight: 400; color: var(--muted-fg); }
.cg-uc-msg-time { flex-shrink: 0; font-size: 12px; color: var(--muted-fg); }
.cg-uc-msg-body { margin-top: 6px; font-size: 13.5px; line-height: 1.75; color: var(--muted-fg); }
.cg-uc-msg-acts { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.cg-uc-msg-btn {
  display: inline-block; padding: 5px 14px; border-radius: 8px; background: var(--brand-grad);
  color: #fff; font-size: 12.5px; text-decoration: none;
}
.cg-uc-msg-read { font-size: 12.5px; color: var(--muted-fg); text-decoration: none; }
.cg-uc-msg-read:hover { color: var(--ring); }
html.dark .cg-uc-msg-btn { color: #fff; }


/* ============ 分享面板（1.11.0） ============
   文档预览页「分享」按钮的渠道选择面板。
   所有颜色走皮肤变量（--card / --border / --foreground / --secondary / --muted-fg），
   这样明暗主题两边都自动成立，不需要再单独写一套 html.dark 覆盖 —— 新增组件容易漏掉暗色，
   所以这里刻意不用任何写死的 #fff。 */
.share-wrap { position: relative; display: inline-flex; }

.share-panel {
  position: absolute; z-index: 60; top: calc(100% + 8px); right: 0;
  width: 236px; padding: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: none;
}
.share-panel.is-open { display: block; }

.share-panel-title { font-size: 12px; color: var(--muted-fg); margin: 2px 0 8px; padding: 0 4px; }
.share-panel-note {
  font-size: 11.5px; line-height: 1.55; color: var(--muted-fg);
  margin: 9px 0 0; padding: 8px 4px 0; border-top: 1px dashed var(--border);
}

.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.share-item {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 8px 9px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--secondary); color: var(--foreground);
  font-size: 13px; font-family: inherit; line-height: 1.2;
  cursor: pointer; text-align: left; transition: all .15s;
}
.share-item:hover { border-color: var(--ring); color: var(--ring); }
.share-item.is-busy { opacity: .5; pointer-events: none; }

/* 轻提示：分享完用户还要继续浏览，alert 会打断操作，toast 不阻塞 */
.share-toast {
  position: fixed; left: 50%; bottom: 44px; z-index: 9999;
  transform: translateX(-50%) translateY(10px);
  background: rgba(24, 24, 27, .93); color: #fff;
  font-size: 13px; line-height: 1.4; padding: 10px 20px;
  border-radius: 999px; box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
}
.share-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   游客取件页（1.16.0 免登录购买）
   ⚠️ 变量纪律：这个皮肤里 --muted 是「浅灰底」（#f4f4f5 / 暗色 #26262b），
      **不是**次级文字色。次级文字一律 --muted-fg（#71717a / #a1a1aa）。
      把 --muted 当 color 用，明暗两个主题下都会糊成一片看不见（不是报错，是静默糊掉）。
      同理没有 --bg / --fg 这两个变量，底色用 --background / --card / --secondary，
      文字用 --foreground。
   ============================================================ */
.cg-pickup-wrap { max-width: 640px; margin: 0 auto; padding: 40px 16px 64px; }
.cg-pickup-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.cg-pickup-ico { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.cg-pickup-h1 { font-size: 20px; margin: 0 0 10px; }
.cg-pickup-p { color: var(--muted-fg); font-size: 13.5px; line-height: 1.8; }
.cg-pickup-sub { color: var(--muted-fg); font-size: 12.5px; }
.cg-pickup-k { color: var(--muted-fg); padding: 4px 0; width: 88px; }
.cg-pickup-doc { font-size: 15px; font-weight: 600; margin-bottom: 12px; word-break: break-word; }
.cg-pickup-amount { color: #e11d48; font-weight: 600; }
.cg-pickup-save { color: #16a34a; }
.cg-pickup-ok {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: #dcfce7; color: #16a34a;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
html.dark .cg-pickup-ok { background: rgba(22, 163, 74, .18); color: #4ade80; }
.cg-pickup-box { background: var(--secondary); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.cg-pickup-warn { background: #fef3c7; border: 1px solid #fde68a; border-radius: 10px; padding: 14px; font-size: 13px; line-height: 1.7; color: #92400e; }
html.dark .cg-pickup-warn { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .35); color: #fbbf24; }
.cg-pickup-btn { display: block; text-align: center; padding: 13px; font-size: 15px; }
.cg-pickup-tip { color: var(--muted-fg); font-size: 12.5px; line-height: 1.7; margin: 14px 0 0; text-align: center; }
.cg-pickup-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.cg-pickup-url { word-break: break-all; }

/* ===== 1.17.0 关注发布者：作者页 hero + 关注按钮 =====
   按钮是"一个组件、多个位置"（作者页 / 详情页作者卡 / 用户中心关注列表），
   所以样式写在这里一处；模板里不写内联样式，改一次三处一致。
   ⚠️ 颜色一律用皮肤变量（--card/--border/--brand…），别写死 #fff —— 皮肤有明暗两套，
      写死的白底在暗色下会变成"白板糊在深色页面上"。 */
.lld-author-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.lld-author-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; font-weight: 700;
}
.lld-author-info { min-width: 0; flex: 1 1 auto; }
.lld-author-name { font-size: 26px; font-weight: 700; margin: 0 0 6px; color: #fff; word-break: break-word; }
.lld-author-sub { font-size: 13.5px; color: rgba(255, 255, 255, .82); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lld-author-sub b { color: #fff; font-weight: 600; }
.lld-author-sub .lld-dot { opacity: .5; }

.lld-follow-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 106px; padding: 10px 20px; font-size: 14px; font-weight: 600;
  border-radius: 999px; cursor: pointer; text-decoration: none; line-height: 1.2;
  background: var(--brand-grad); color: #fff; border: 1px solid transparent;
  transition: opacity .15s, background .15s, color .15s, border-color .15s;
}
.lld-follow-btn:hover { opacity: .9; }
.lld-follow-btn:disabled { opacity: .6; cursor: default; }
.lld-follow-btn.is-following {
  background: transparent; color: rgba(255, 255, 255, .9); border-color: rgba(255, 255, 255, .55);
}
.lld-follow-btn.is-following:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.lld-follow-btn.is-self { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .35); }

/* 详情页作者卡里的按钮：卡片是浅底（--card），配色要反过来 —— 白底白字 = 看不见 */
.author-card .lld-follow-btn {
  background: var(--brand-bg); color: #fff; border-color: transparent;
  min-width: 0; padding: 6px 14px; font-size: 12.5px; margin-top: 8px;
}
.author-card .lld-follow-btn.is-following {
  background: transparent; color: var(--muted-fg); border-color: var(--border);
}
.author-card .lld-follow-btn.is-following:hover { border-color: var(--ring); color: var(--ring); background: transparent; }

/* 用户中心「我的关注」列表 */
.lld-follow-list { list-style: none; margin: 0; padding: 0; }
.lld-follow-list > li {
  display: flex; align-items: center; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.lld-follow-list > li:last-child { border-bottom: none; }
.lld-follow-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 700;
}
.lld-follow-body { min-width: 0; flex: 1 1 auto; }
.lld-follow-name { font-size: 14.5px; font-weight: 600; color: var(--foreground); text-decoration: none; }
.lld-follow-name:hover { color: var(--ring); }
.lld-follow-meta { font-size: 12.5px; color: var(--muted-fg); margin-top: 3px; }
.lld-follow-list .lld-follow-btn { min-width: 0; padding: 6px 14px; font-size: 12.5px; background: transparent; color: var(--muted-fg); border-color: var(--border); }
.lld-follow-list .lld-follow-btn:hover { border-color: var(--ring); color: var(--ring); opacity: 1; }

/* ============================================================
   前台提示层（1.18.18）· LLD_UI
   替代浏览器原生 alert / confirm。三个分工：
     .lld-toast  纯通知，不阻塞、自动消失
     .lld-dlg    要用户确认或做决定的（单按钮 = alert，双按钮 = confirm）
   配色一律走变量，明暗两个主题自动成立；不再各写一套 html.dark。
   ============================================================ */

/* ---- 轻提示 toast ---- */
.lld-toast-box {
  position: fixed; left: 50%; bottom: 34px; z-index: 10001;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
}
.lld-toast {
  background: rgba(24, 24, 27, .93); color: #fff;
  font-size: 13.5px; line-height: 1.45; padding: 10px 20px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  max-width: 100%; text-align: center;
  opacity: 0; transform: translateY(10px);
  transition: opacity .22s, transform .22s;
}
.lld-toast.is-show { opacity: 1; transform: translateY(0); }
/* 失败用红色：同一套提示里"没做成"和"做成了"必须一眼能分开 */
.lld-toast.is-err { background: rgba(185, 28, 28, .95); border-color: rgba(255, 255, 255, .16); }
.lld-toast.is-ok { background: rgba(15, 110, 86, .95); border-color: rgba(255, 255, 255, .16); }

/* ---- 对话框（alert / confirm 共用）---- */
.lld-dlg { position: fixed; inset: 0; z-index: 10000; opacity: 0; transition: opacity .2s ease; }
.lld-dlg.is-show { opacity: 1; }
.lld-dlg-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); }
.lld-dlg-panel {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -46%) scale(.97);
  width: 372px; max-width: calc(100vw - 40px);
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 24px 24px 18px;
  transition: transform .2s ease;
}
.lld-dlg.is-show .lld-dlg-panel { transform: translate(-50%, -50%) scale(1); }
.lld-dlg-title { font-size: 16.5px; font-weight: 700; color: var(--foreground); margin-bottom: 8px; }
.lld-dlg-body { font-size: 14px; line-height: 1.65; color: var(--muted-fg); word-break: break-word; white-space: pre-line; }
.lld-dlg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.lld-dlg-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--foreground);
  border-radius: 10px; padding: 9px 20px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s; font-family: inherit; line-height: 1.2;
}
.lld-dlg-btn:hover { border-color: var(--ring); color: var(--ring); }
.lld-dlg-btn.is-primary { background: var(--brand-bg); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgb(var(--brand) / .28); }
.lld-dlg-btn.is-primary:hover { color: #fff; opacity: .9; }
/* 破坏性动作（删除 / 清空）用红：和普通"确定"区分开，防误点 */
.lld-dlg-btn.is-primary.is-danger { background: var(--destructive); box-shadow: 0 4px 12px rgba(239, 68, 68, .28); }
.lld-dlg-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

@media (max-width: 480px) {
  .lld-dlg-panel { padding: 20px 18px 14px; border-radius: 16px; }
  .lld-dlg-foot { gap: 8px; }
  .lld-dlg-btn { flex: 1; padding: 10px 12px; }
}

/* ===== 1.18.19 · 选项列表（LLD_UI.pick）=====
   给「支付方式」这类"多选一"用：一片单选行 + 底部一个确认按钮。
   ⚠️ .lld-dlg-body 默认是 white-space: pre-line（为上传页的多行文件名留的），
   选项模式下必须复位成 normal —— 否则行与行之间拼接出来的空白会被当成换行，
   flex 子元素之间冒出莫名其妙的空隙。 */
.lld-dlg-body.is-pick { white-space: normal; }
.lld-dlg-opts { display: flex; flex-direction: column; gap: 8px; }
.lld-dlg-opt {
  display: flex; align-items: center; gap: 10px;
  width: 100%; box-sizing: border-box; text-align: left;
  padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--card); color: var(--foreground);
  font-size: 14px; font-family: inherit; line-height: 1.3;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.lld-dlg-opt:hover:not(:disabled) { border-color: rgb(var(--brand) / .55); }
.lld-dlg-opt.is-on { border-color: rgb(var(--brand) / .85); background: rgb(var(--brand) / .06); }
.lld-dlg-opt:disabled { opacity: .55; cursor: not-allowed; }
.lld-dlg-opt:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.lld-dlg-opt-dot {
  flex: none; width: 16px; height: 16px; box-sizing: border-box;
  border: 1.5px solid var(--border); border-radius: 50%;
  transition: border-width .15s, border-color .15s;
}
.lld-dlg-opt.is-on .lld-dlg-opt-dot { border: 5px solid rgb(var(--brand) / .85); }
.lld-dlg-opt-txt { flex: 1 1 auto; min-width: 0; }
.lld-dlg-opt-sub { flex: none; font-size: 12.5px; color: var(--muted-fg); }
.lld-dlg-note { margin-top: 10px; font-size: 12.5px; line-height: 1.65; color: var(--muted-fg); }
/* 选项全不可选时主按钮会被置 disabled —— 不给样式的话它看着还能点 */
.lld-dlg-btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 480px) {
  .lld-dlg-opt { padding: 12px; }
  .lld-dlg-opt-sub { font-size: 12px; }
}

/* ============================================================
   统一图标集（1.23.6）
   ------------------------------------------------------------
   全套图形来自 includes/class-icons.php：24 网格 / 1.7 描边 /
   fill=none / stroke=currentColor。这里只负责「摆放」，不碰图形本身。
   改动纪律：不要给 .lld-i 加 min-width 或固定字号 —— SVG 的宽高由 PHP
   按场景传入（14/15/16/18/24/40），由 CSS 再改一次就会出现两套尺寸同时生效。
   ============================================================ */
.lld-i { flex: none; vertical-align: -0.16em; }

/* 按钮里的前置图标：右留 6px，替代以前在文案里手打的空格 */
.lld-i.btn-i { margin-right: 6px; }

/* 图标已经处在一个居中的 flex 容器里，就别再走基线对齐 */
.c-ico .lld-i,
.t-ico .lld-i,
.cg-uc-empty-icon .lld-i,
.zoom-btn .lld-i,
.pb-action .lld-i,
.share-item .lld-i,
.theme-btn .lld-i { vertical-align: 0; }

/* 明暗切换：两个图标互斥显示。
   以前是 JS 用 textContent 写 '☀️'/'🌙' —— 那样会把 SVG 冲掉，所以 JS 里
   对应的赋值已经删了，状态只剩 html.dark 一个判据（红线 87）。 */
.theme-btn .i-sun { display: none; }
html.dark .theme-btn .i-sun { display: block; }
html.dark .theme-btn .i-moon { display: none; }
.wk-theme-txt { margin-left: 6px; }

/* VIP 权益勾 */
.lld-tick { display: inline-flex; align-items: center; flex: none; color: #16a34a; }

/* 用户中心提示条：成败由图标表达，不再是文案里的 ✅/❌ */
.cg-uc-hint .is-ok { color: #16a34a; }
.cg-uc-hint .is-bad { color: #b91c1c; }
html.dark .cg-uc-hint .is-bad { color: #fca5a5; }

/* 行内说明图标（例如「支付完成后自动开通」前面那个） */
.lld-i.i-inline { margin-right: 5px; }

/* 文字 + 图标的横排项：靠 gap 控制间距，模板里不再手打空格 */
.cg-uc-quick-item,
.cg-nav-vip,
.cg-nav-action,
.cg-nav-login { display: inline-flex; align-items: center; gap: 6px; }

/* 已失效文件的灰图标 */
.i-gone { display: inline-flex; color: var(--muted-fg); }

/* 暗色下缩略图底色略提亮，否则四种深色在深背景上糊成一片 */
html.dark .type-word, html.dark .type-doc, html.dark .type-docx { background: #465f88; }
html.dark .type-ppt, html.dark .type-pptx { background: #8a5533; }
html.dark .type-pdf { background: #8a3f3f; }
html.dark .type-txt { background: #4f5664; }
html.dark .type-excel, html.dark .type-xls, html.dark .type-xlsx { background: #3d6b53; }
html.dark .type-zip, html.dark .type-rar { background: #564e40; }
html.dark .type-blank, html.dark .type-other { background: #4a4f63; }
