/*
  易象研书斋 · 移动端优先样式
  多套皮肤通过 data-theme 切换 CSS 变量实现
*/

/* ============ 皮肤变量 ============ */
:root {
  --bg:            #f7f7f6;
  --bg-alt:        #efefee;
  --surface:       #ffffff;
  --surface-2:     #fbfbfb;
  --text:          #232323;
  --muted:         #838383;
  --line:          #e2e2e0;
  --line-soft:     #eeeeec;
  --accent:        #2f2f2f;
  --yin:           #2f6f9e;
  --accent-2:      #a33a2e;
  --accent-soft:   rgba(0, 0, 0, .05);
  --seal-bg:       #a33a2e;
  --seal-text:     #fff;
  --shadow:        0 4px 18px rgba(0, 0, 0, .06);
  --shadow-lg:     0 12px 34px rgba(0, 0, 0, .10);
  --grain:         .18;
  --seal-face:     #ffffff;
  --seal-shade:    rgba(0, 0, 0, .10);
  /* 篆书字体栈：系统装有篆体时自动命中，否则优雅回退到宋体 */
  --font-seal:     "FZXiaoZhuanTi-M04S", "方正小篆体", "FZXiaoZhuanTi", "汉仪篆书繁",
                   "HYZhuanShuF", "汉仪篆书简", "金文大篆体", "JinWenDaZhuan",
                   "篆体", "ZhuanShu", "STZhuan", "迷你篆体",
                   "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --nav-bg:        rgba(255, 255, 255, .92);
  --radius:        12px;
  --mark-color:    #a33a2e;
}

[data-theme="mo"] {
  --bg:            #2b3036;
  --bg-alt:        #333a41;
  --surface:       #353c44;
  --surface-2:     #3c444c;
  --text:          #ece6da;
  --muted:         #a89e92;
  --line:          #4a535c;
  --line-soft:     #3d454d;
  --accent:        #d8b54a;
  --yin:           #5fa8e0;
  --accent-2:      #b89476;
  --accent-soft:   rgba(216, 181, 74, .14);
  --seal-bg:       #c8a032;
  --seal-text:     #1c1f23;
  --shadow:        0 6px 22px rgba(0, 0, 0, .35);
  --shadow-lg:     0 14px 40px rgba(0, 0, 0, .45);
  --grain:         .25;
  --seal-face:     #3a424b;
  --seal-shade:    rgba(0, 0, 0, .40);
  --nav-bg:        rgba(43, 48, 54, .9);
  --radius:        14px;
  --mark-color:    #d8b54a;
}

[data-theme="qing"] {
  --bg:            #eaf1ed;
  --bg-alt:        #e1ebe6;
  --surface:       #ffffff;
  --surface-2:     #f4f9f6;
  --text:          #22322c;
  --muted:         #6c8078;
  --line:          #cfe0d8;
  --line-soft:     #e2ede8;
  --accent:        #2f6f5e;
  --yin:           #2f6fa0;
  --accent-2:      #c0a86b;
  --accent-soft:   rgba(47, 111, 94, .10);
  --seal-bg:       #2f6f5e;
  --seal-text:     #f2f9f5;
  --shadow:        0 6px 22px rgba(45, 90, 75, .10);
  --shadow-lg:     0 14px 40px rgba(45, 90, 75, .18);
  --grain:         .40;
  --seal-face:     #ffffff;
  --seal-shade:    rgba(45, 90, 75, .18);
  --nav-bg:        rgba(255, 255, 255, .9);
  --radius:        16px;
  --mark-color:    #2f6f5e;
}

[data-theme="zhu"] {
  --bg:            #f0f4fd;
  --bg-alt:        #e6edfb;
  --surface:       #ffffff;
  --surface-2:     #f2f6fe;
  --text:          #24344f;
  --muted:         #6d7f9d;
  --line:          #ccd9f1;
  --line-soft:     #e2eaf8;
  --accent:        #3478f6;
  --yin:           #4fb3d9;
  --accent-2:      #5f93f8;
  --accent-soft:   rgba(52, 120, 246, .12);
  --seal-bg:       #3478f6;
  --seal-text:     #f2f7ff;
  --shadow:        0 6px 22px rgba(52, 120, 246, .14);
  --shadow-lg:     0 14px 40px rgba(52, 120, 246, .20);
  --grain:         .55;
  --seal-face:     #eaf1fe;
  --seal-shade:    rgba(52, 120, 246, .20);
  --nav-bg:        rgba(242, 246, 253, .92);
  --radius:        16px;
  --mark-color:    #3478f6;
}

[data-theme="song"] {
  --bg:            #28323f;
  --bg-alt:        #303c4b;
  --surface:       #323f4f;
  --surface-2:     #3a4a5c;
  --text:          #e3ebf3;
  --muted:         #a6b6c8;
  --line:          #45566b;
  --line-soft:     #38465a;
  --accent:        #9fc0e3;
  --yin:           #4fb3d9;
  --accent-2:      #d2b277;
  --accent-soft:   rgba(159, 192, 227, .16);
  --seal-bg:       #9fc0e3;
  --seal-text:     #1a222c;
  --shadow:        0 6px 22px rgba(0, 0, 0, .40);
  --shadow-lg:     0 14px 40px rgba(0, 0, 0, .50);
  --grain:         .24;
  --seal-face:     #3a4a5c;
  --seal-shade:    rgba(0, 0, 0, .44);
  --nav-bg:        rgba(40, 50, 63, .9);
  --radius:        14px;
  --mark-color:    #9fc0e3;
}

[data-theme="su"] {
  --bg:            #f7f7f6;
  --bg-alt:        #efefee;
  --surface:       #ffffff;
  --surface-2:     #fbfbfb;
  --text:          #232323;
  --muted:         #838383;
  --line:          #e2e2e0;
  --line-soft:     #eeeeec;
  --accent:        #2f2f2f;
  --yin:           #2f6f9e;
  --accent-2:      #a33a2e;
  --accent-soft:   rgba(0, 0, 0, .05);
  --seal-bg:       #a33a2e;
  --seal-text:     #fff;
  --shadow:        0 4px 18px rgba(0, 0, 0, .06);
  --shadow-lg:     0 12px 34px rgba(0, 0, 0, .10);
  --grain:         .18;
  --seal-face:     #ffffff;
  --seal-shade:    rgba(0, 0, 0, .10);
  --nav-bg:        rgba(255, 255, 255, .92);
  --radius:        12px;
  --mark-color:    #a33a2e;
}

[data-theme="ye"] {
  --bg:            #1a1d23;
  --bg-alt:        #23272f;
  --surface:       #24282f;
  --surface-2:     #2c313a;
  --text:          #d9dbe0;
  --muted:         #8b909a;
  --line:          #333a44;
  --line-soft:     #2b313b;
  --accent:        #e0b341;
  --yin:           #7fb0e0;
  --accent-2:      #b8893a;
  --accent-soft:   rgba(224, 179, 65, .14);
  --seal-bg:       #e0b341;
  --seal-text:     #1a1d23;
  --shadow:        0 6px 22px rgba(0, 0, 0, .45);
  --shadow-lg:     0 14px 40px rgba(0, 0, 0, .55);
  --grain:         .20;
  --seal-face:     #24282f;
  --seal-shade:    rgba(0, 0, 0, .45);
  --nav-bg:        rgba(26, 29, 35, .92);
  --radius:        14px;
  --mark-color:    #e0b341;
}

/* ============ 基础 ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

/* 纸纹质感：极淡的斜纹叠加（强度由 --grain 控制） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--grain);
  background-image:
    repeating-linear-gradient(45deg, rgba(120, 100, 70, .035) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-45deg, rgba(120, 100, 70, .03) 0 3px, transparent 3px 7px);
}
/* ===== 主框架背景光晕（Vibe Coding 风）：霓虹渐变网格 + 漂移光斑 + 极光扫光 =====
   替换原 5 个静态朱砂/蓝绿圆斑；与主页 newhome.php 内联样式同构同参，改动请两处同步。
   DOM 保持 .hero-glow > i.g1~g5（templates/header.php 输出），手机端由下方媒体查询隐藏。
   注：html/body 均设不透明背景，故用 z-index:0 置于 body 背景之上、.app(z-index:1) 之下。 */
.hero-glow{position:fixed;inset:0;pointer-events:none;z-index:0;opacity:.6;overflow:hidden;
  --vibe-op:.26;--vibe-grid:rgba(99,102,241,.085);--vibe-sweep:.10;
  -webkit-mask-image:linear-gradient(180deg,#000 0,#000 86%,transparent 100%);
  mask-image:linear-gradient(180deg,#000 0,#000 86%,transparent 100%)}
/* 细坐标网格：AI / IDE 风格底纹，中心清晰、四周淡出 */
.hero-glow::before{content:"";position:absolute;inset:0;
  background-image:linear-gradient(var(--vibe-grid) 1px,transparent 1px),linear-gradient(90deg,var(--vibe-grid) 1px,transparent 1px);
  background-size:48px 48px;
  -webkit-mask-image:radial-gradient(ellipse 78% 68% at 50% 44%,#000 0,transparent 100%);
  mask-image:radial-gradient(ellipse 78% 68% at 50% 44%,#000 0,transparent 100%)}
/* 极光扫光：缓慢旋转的锥形渐变，制造「生成中」的流动感 */
.hero-glow::after{content:"";position:absolute;left:50%;top:46%;width:140vmax;height:140vmax;
  transform:translate(-50%,-50%);
  background:conic-gradient(from 0deg,transparent 0deg,rgba(139,92,246,.22) 60deg,transparent 130deg,rgba(34,211,238,.20) 210deg,transparent 280deg,rgba(34,197,94,.16) 330deg,transparent 360deg);
  opacity:var(--vibe-sweep);
  -webkit-mask-image:radial-gradient(circle,#000 0,transparent 62%);
  mask-image:radial-gradient(circle,#000 0,transparent 62%);
  animation:vibeSweep 26s linear infinite}
@keyframes vibeSweep{to{transform:translate(-50%,-50%) rotate(360deg)}}
.hero-glow i{position:absolute;border-radius:50%;filter:blur(80px);opacity:var(--vibe-op);will-change:transform;animation:glowFloat 16s ease-in-out infinite alternate}
.hero-glow .g1{width:82vmax;height:82vmax;left:calc(10px - 41vmax);top:calc(10px - 41vmax);background:radial-gradient(circle,#8b5cf6 0%,transparent 70%);animation-name:glowFloatG1}
.hero-glow .g2{width:min(520px,62vw);height:min(520px,62vw);right:10%;top:2%;background:radial-gradient(circle,#22d3ee 0%,transparent 70%);animation-delay:-5s;--vibe-op:.20}
.hero-glow .g3{width:min(360px,54vw);height:min(360px,54vw);left:30%;bottom:0%;background:radial-gradient(circle,#22c55e 0%,transparent 70%);animation-delay:-9s;--vibe-op:.18}
.hero-glow .g4{width:min(380px,50vw);height:min(380px,50vw);left:-2%;bottom:6%;background:radial-gradient(circle,#ec4899 0%,transparent 70%);animation-delay:-12s;--vibe-op:.18}
.hero-glow .g5{width:min(480px,60vw);height:min(480px,60vw);right:0%;bottom:6%;background:radial-gradient(circle,#6366f1 0%,transparent 70%);animation-delay:-3s;--vibe-op:.24}
@keyframes glowFloat{from{transform:translate(0,0) scale(1)}to{transform:translate(28px,18px) scale(1.06)}}
@keyframes glowFloatG1{from{transform:scale(1)}to{transform:scale(1.04)}}
@media (prefers-reduced-motion:reduce){.hero-glow i,.hero-glow::after{animation:none}}
/* 深色三套皮肤：霓虹提亮、网格略清晰；浅色皮肤保持低饱和不抢正文 */
[data-theme="mo"] .hero-glow,
[data-theme="song"] .hero-glow,
[data-theme="ye"] .hero-glow{--vibe-grid:rgba(148,163,255,.15);--vibe-sweep:.18}
[data-theme="mo"] .hero-glow i,
[data-theme="song"] .hero-glow i,
[data-theme="ye"] .hero-glow i{--vibe-op:.42}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.serif {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC",
               "SimSun", "STZhongsong", Georgia, serif;
}

.hide { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ============ 骨架布局 ============ */
.app {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 78px;
}

/* ===== 顶部悬浮胶囊导航（与主页一致） ===== */
.topnav{position:sticky;top:14px;z-index:20;padding:0 16px}
.nav-pill{max-width:1080px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;min-height:58px;padding:6px 12px 6px 22px;background:var(--nav-bg);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid var(--line-soft);border-radius:14px;box-shadow:var(--shadow);transition:background .25s,border-color .25s}
.brand{display:flex;align-items:center;gap:11px}
.topnav nav{display:flex;gap:4px;align-items:center;min-width:0;white-space:nowrap;overflow-x:auto;scrollbar-width:none}
.topnav nav::-webkit-scrollbar{display:none}
.topnav nav a{position:relative;flex:0 0 auto;font-size:13.5px;color:var(--muted);padding:7px 13px;border-radius:999px;transition:color .15s,background .15s}
.topnav nav a:hover{color:var(--text);background:var(--surface-2)}
.topnav nav a.on{color:var(--accent);font-weight:600}
.topnav nav a.on::after{content:'';position:absolute;left:50%;transform:translateX(-50%);bottom:0;width:18px;height:3px;border-radius:2px;background:var(--accent)}
.topnav .cmd{cursor:pointer;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;border:1px solid var(--line);padding:5px 10px;border-radius:999px;color:var(--muted);text-decoration:none}
.topnav .cmd:hover{color:var(--text);border-color:var(--accent)}
.nav-tools{position:relative;display:flex;gap:8px;align-items:center;flex:0 0 auto;margin-left:10px}
.nav-ico{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:none;background:none;border-radius:50%;color:var(--muted);cursor:pointer;transition:color .15s,background .15s}
.nav-ico svg{width:17px;height:17px;display:block}
.nav-ico:hover{color:var(--accent);background:var(--accent-soft)}
.brand-text{display:flex;flex-direction:column;line-height:1.28;min-width:0}
.brand-name{font-family:"Kaiti SC","STKaiti","KaiTi","楷体","DFKai-SB","Noto Serif SC",serif;font-size:18px;letter-spacing:1.5px;font-weight:700;white-space:nowrap}
.brand-sub{display:block;font-size:10.5px;color:var(--muted);letter-spacing:1px;margin-top:4px;white-space:nowrap}
@media (max-width:760px){
  .topnav{top:10px;padding:0 10px}
  .topnav nav{gap:2px}
  .topnav nav a:not(.cmd){display:none}
  .topnav .nav-tools{display:none}
  .nav-pill{max-width:none;width:100%;margin:0;border-radius:14px}
  .brand-text{line-height:1.28}
  .brand-sub{margin-top:4px}
}
/* 悬浮工具按钮组（六爻/八字/紫微/黄历） */
.tool-fab{position:fixed;right:16px;top:50%;transform:translateY(-50%);z-index:55;display:flex;flex-direction:column;gap:9px}
.tool-fab a{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:13px;background:var(--nav-bg);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid var(--line-soft);box-shadow:var(--shadow);color:var(--text);font-size:13px;font-weight:600;text-decoration:none;transition:color .15s,border-color .15s,transform .15s}
.tool-fab a:hover{color:var(--accent);border-color:var(--accent);transform:translateY(-1px)}
@media (max-width:760px){.tool-fab{left:auto;right:0;top:50%;bottom:auto;transform:translateY(-50%);flex-direction:column;gap:6px}.tool-fab a{width:40px;height:40px;font-size:12px;border-radius:10px 0 0 10px;border-right:none}}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px calc(10px) 14px;
  background: var(--nav-bg);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.top-link {
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 2px 4px;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

/* 印章 Logo：白文印（红底白字）+ 小篆笔画 + 印泥做旧 */
.seal-mark {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 4px;
  background: var(--seal-bg);
  color: var(--seal-text);
  font-family: var(--font-seal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--seal-shade);
  transform: rotate(-3deg);
  letter-spacing: 0;
}
/* 印边：取字色（--seal-text），随皮肤自动翻转明暗，深色皮肤不再死白 */
.seal-mark::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid currentColor;
  border-radius: 3px;
  opacity: .22;
  pointer-events: none;
}
/* 做旧：细密噪点模拟印泥不匀与石面斑驳 */
.seal-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='64' height='64' filter='url(%23g)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 64px 64px;
  mix-blend-mode: soft-light;
  opacity: .7;
}
.seal-zhuan {
  width: 100%;
  height: 100%;
  display: block;
}

/* 朱文（阳文）：纸底朱字 + 双边印框，笔画收细，气息比白文秀劲 */
.seal-mark.zhu {
  padding: 2px;
  background: var(--seal-face);            /* 印面纸色，深色皮肤自动转深 */
  color: var(--seal-bg);
  border: 1.6px solid var(--seal-bg);
  border-width: 1.7px 1.4px 1.5px 1.6px;   /* 四边略不匀，模拟刻痕 */
  box-shadow: 0 1px 5px var(--seal-shade);
}
.seal-mark.zhu .seal-zhuan { stroke-width: 5.2; }
.seal-mark.zhu::before {
  inset: 3px;
  border-color: currentColor;
  opacity: .40;                            /* 内侧细边，成“双边朱文” */
}
.seal-mark.zhu::after {
  mix-blend-mode: multiply;
  opacity: .28;                            /* 纸面剥蚀感 */
}

/* 后台开关：可选卡片（radio + 预览） */
.opt-group { display: grid; gap: 8px; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt-body {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color .15s, background .15s;
}
.opt input:checked + .opt-body {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.opt input:focus-visible + .opt-body { outline: 2px solid var(--accent); outline-offset: 1px; }
.opt-body b { display: block; font-size: 14px; font-weight: 600; }
.opt-body em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }

.brand-name {
  font-family: var(--font-seal);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  white-space: nowrap;
  display: inline-block;
  transform: scaleY(1.08);
  transform-origin: left center;
  text-shadow: 0 0 .5px currentColor;
}
.seal-font { font-family: var(--font-seal); letter-spacing: 2px; }

.brand-sub {
  display: block;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}

.topbar .spacer { flex: 1 1 auto; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: transform .15s ease, background .2s ease;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }

.page { padding: 90px 14px 14px; }
.page-wide { padding: 14px 0; }
@media (max-width: 760px) {
  .page { padding-top: 52px; }
}

/* 六爻/八字 iframe 容器 */
.tool-frame { margin: 0; }
.liuyao-frame,
.bazi-frame {
  width: 100%;
  border: 0;
  display: block;
  /* 只做加载前的占位，不能用 vh：vh 会随手机地址栏折叠变化，并与
     内层页面的 min-height:100vh 互相喂养，导致底部持续长出空白。 */
  min-height: 320px;
  /* 背景透明，交由子页面自身背景填充，避免深色子页面外露浅色底 */
  background: transparent;
  border-radius: var(--radius);
  overflow: hidden;
}

/* ============ 通用组件 ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.card-flat {
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 2px 10px;
}

.section-title h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 17px;
  letter-spacing: 1px;
  position: relative;
  padding-left: 12px;
}

.section-title h2::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 15px;
  border-radius: 2px;
  background: var(--accent);
}

.section-title .more {
  font-size: 12px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--surface);
  font-size: 14px;
  cursor: pointer;
  transition: opacity .2s ease, transform .12s ease;
}
.btn:active { transform: scale(.97); }
/* 后台管理页：所有 .btn（保存并发布 / 保 存 等）与 mini-btn（预览）统一为 30px 高 */
#xs-content.admin-page .btn { height: 30px; padding: 0 14px; font-size: 13px; }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.btn-block { display: flex; width: 100%; }
.btn svg { width: 16px; height: 16px; }

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  border: 1px solid transparent;
}

/* ===== 会员等级标签 ===== */
.chip-vip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #9e9e9e, #757575); /* 0 匿名 灰 */
}
.chip-vip svg { width: 12px; height: 12px; }
.chip-vip.lvl-1 { background: linear-gradient(135deg, #5b8def, #3f6fd1); } /* 普通用户 蓝 */
.chip-vip.lvl-2 { background: linear-gradient(135deg, #cd7f32, #a85e1f); } /* 铜卡 */
.chip-vip.lvl-3 { background: linear-gradient(135deg, #b0b0b8, #8a8a93); } /* 银卡 */
.chip-vip.lvl-4 { background: linear-gradient(135deg, #e6c069, #c99a2e); } /* 金卡 */
.chip-vip.locked { opacity: .55; filter: grayscale(.4); }
.chip-vip.locked svg { color: #fff; }

/* ===== 文章锁定面板 ===== */
.vip-lock {
  text-align: center;
  padding: 30px 18px;
  margin-top: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.vip-lock-icon svg { width: 40px; height: 40px; color: var(--accent); }
.vip-lock h2 { font-size: 17px; margin: 10px 0 8px; }
.vip-lock p { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 4px 0; }
.vip-lock .btn { max-width: 240px; margin: 14px auto 0; }

/* 列表项锁定态：整条置灰不可点 */
.list-item.locked .li-main h3 { color: var(--muted); }
.list-item.locked .li-main .fi-meta { color: var(--muted); }
.file-item.locked .fi-name { color: var(--muted); }


.tag-line {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.form-row { margin-bottom: 12px; }
.form-row label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 5px;
}

input[type="text"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  outline: none;
  font-size: 15px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 120px; line-height: 1.7; }
#p-summary { min-height: 68px; height: 68px; padding: 8px 12px; font-size: 14px; line-height: 1.6; resize: vertical; }

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.alert-ok    { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
.alert-error { border-color: #d9736e; background: rgba(180, 60, 50, .1); color: var(--mark-color); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 34px 12px;
  font-size: 14px;
}
.empty svg { width: 44px; height: 44px; opacity: .35; margin-bottom: 8px; }

/* ============ 首屏 ============ */
.hero {
  position: relative;
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 14px;
  overflow: hidden;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--line-soft);
  pointer-events: none;   /* 装饰层不拦截点击（此前会盖住 hero 右上角的返回按钮） */
}
/* 裸首屏：去掉卡片底/描边/阴影与装饰圆，仅保留文字（经典聚合页用） */
.hero.hero-bare{background:none;border:none;box-shadow:none;overflow:visible;padding:24px 18px}
.hero.hero-bare::after{display:none}
/* 裸首屏字体层级：小 eyebrow → 大标题（粗黑体） → 单行描述 */
.hero-eyebrow{font-size:12.5px;font-weight:700;letter-spacing:4px;color:var(--accent);text-transform:uppercase;margin-bottom:8px}
.hero.hero-bare .hero-title{font-family:inherit;font-size:44px;letter-spacing:2px;font-weight:800;line-height:1.15}
.hero.hero-bare .hero-sub{font-size:15px;line-height:1.8;color:var(--muted);max-width:720px;margin-top:10px}
@media (max-width:760px){
  .hero.hero-bare .hero-title{font-size:30px;letter-spacing:2px}
}
/* PC 端：首屏保留充足留白，层级之间拉开间距 */
@media (min-width:761px){
  .hero.hero-bare{padding:64px 24px 40px}
  .hero-eyebrow{margin-bottom:14px}
  .hero.hero-bare .hero-sub{margin-top:16px}
  .seg-bar{margin-top:34px}
}
.hero-title {
  font-family: var(--font-seal);
  font-size: 26px;
  letter-spacing: 4px;
  line-height: 1.2;
  margin: 0;
}
.hero-sub {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 1px;
}
.hero-tools {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 2;
}
.hero-tools .tool-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-tools a {
  font-size: 12.5px;
  line-height: 1;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  white-space: nowrap;
}
@media (max-width: 400px) {
  .hero-tools { top: 12px; right: 12px; gap: 6px; }
  .hero-tools a { font-size: 11.5px; }
}
.hero-line {
  margin-top: 10px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 12px;
}
.notice svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 3px; }

/* 板块入口 */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quick-item {
  display: block;
  padding: 14px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .2s ease;
  position: relative;
  overflow: hidden;
}
.quick-item:active { transform: translateY(2px); }
.quick-item .qi-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 9px;
}
.quick-item .qi-icon svg { width: 20px; height: 20px; }
.quick-item h3 {
  margin: 0 0 2px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  letter-spacing: 2px;
}
.quick-item p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.quick-item .qi-count {
  position: absolute;
  top: 9px;
  right: 11px;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}
.quick-item .qi-count.at-bottom { top: auto; bottom: 8px; right: 10px; }
.quick-item .qi-count b {
  font-family: "Songti SC", "STSong", serif;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
}
.quick-item .qi-count i {
  font-style: normal;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 1px;
}

/* 今日一卦 */
.gua-card { display: flex; gap: 14px; align-items: center; }
.gua-symbol { flex: 0 0 auto; }
.gua-meta { min-width: 0; }
.gua-meta h3 {
  margin: 0 0 3px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 18px;
  letter-spacing: 2px;
}
.gua-meta .gua-judg {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.gua-meta .gua-gist {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

/* 六爻符号 */
.yao { display: flex; flex-direction: column-reverse; gap: 5px; }
.yao span {
  display: block;
  width: 54px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}
.yao span.yin {
  background: transparent;
  position: relative;
}
.yao span.yin::before,
.yao span.yin::after {
  content: "";
  position: absolute;
  top: 0;
  width: 22px;
  height: 7px;
  border-radius: 2px;
  background: var(--yin);
}
.yao span.yin::before { left: 0; }
.yao span.yin::after  { right: 0; }
.yao.small span { width: 34px; height: 5px; }
.yao.small span.yin::before, .yao.small span.yin::after { width: 13px; height: 5px; }

/* 卦宫列表 */
.gua-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.gua-panel {
  display: none;
  animation: guaFade .2s ease;
}
.gua-panel.open { display: block; }
@keyframes guaFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.gua-cell {
  text-align: center;
  padding: 10px 4px 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .14s ease, border-color .14s ease;
}
.gua-cell:hover { border-color: var(--accent); }
.gua-cell:active { transform: scale(.96); }
.gua-cell .gc-num {
  font-size: 10px;
  color: var(--muted);
}
.gua-cell .gc-name {
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  margin-top: 4px;
  letter-spacing: 1px;
}
.gua-cell .yao {
  align-items: center;
  margin-top: 6px;
}
.gua-cell .yao span { width: 30px; height: 4px; }
.gua-cell .yao span.yin::before, .gua-cell .yao span.yin::after { width: 11px; height: 4px; }

.more-btn {
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  cursor: pointer;
  font-family: inherit;
}
.more-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ============ 列表 ============ */
.list { display: block; }
.list-item {
  display: flex;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start;
}
.list-item:last-child { border-bottom: none; }
.list-item .li-main { flex: 1 1 auto; min-width: 0; }
.list-item h3 {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
  font-family: "Songti SC", "STSong", serif;
  letter-spacing: .5px;
}
.list-item p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.list-item .li-side {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--muted);
  padding-top: 3px;
}
/* 文章列表项封面缩略图（图文模式） */
.list-item .li-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--line-soft);
}
.list-item .li-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 文章详情页封面大图 */
.post-cover {
  margin-top: 14px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--line-soft);
}
.post-cover img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}
/* 后台：未启用 GD 时的封面提示 */
.cover-warn {
  font-size: 12.5px;
  line-height: 1.6;
  color: #8a5a00;
  background: #fff7e6;
  border: 1px solid #ffe1a8;
  border-radius: 8px;
  padding: 7px 10px;
  margin: 0 0 8px;
}
/* 篇目管理：卡片竖排，标题在上、操作按钮整排置底 */
#post-list .list-item {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
#post-list .list-item .li-side {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-soft);
}

/* ============ 文章已读 / 未读色阶 ============ */
/* 已读：整体下沉、标题转灰、缩略图降饱和 */
.list-item.is-read { opacity: .66; }
.list-item.is-read .li-main h3 { color: var(--muted); font-weight: 500; }
.list-item.is-read .li-main p,
.list-item.is-read .fi-meta { color: var(--muted); }
.list-item.is-read .li-thumb { filter: grayscale(.35) opacity(.9); }
/* 未读：左侧 accent 色条 + 标题加粗，突出“还没看过” */
.list-item.is-unread { box-shadow: inset 3px 0 0 var(--accent); border-radius: 4px; }
.list-item.is-unread .li-main h3 { font-weight: 700; }

/* 后台篇目管理：仅用标题色阶区分，避免淡化操作按钮 */
#post-list .list-item.is-read { opacity: 1; }
#post-list .list-item.is-read .li-main h3 { color: var(--muted); }
#post-list .list-item.is-unread { box-shadow: none; }
#post-list .list-item.is-unread .li-main h3 { font-weight: 500; }

/* 所有频道统一：分类按钮底边 → 正文顶边 24px（手机端 16px，见下方媒体查询） */
.cat-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 0;
  margin-bottom: 24px;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-bar a {
  flex: 0 0 auto;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  white-space: nowrap;
}
.cat-bar a.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}
/* 板块切换按钮（经典聚合页）：与分类胶囊同款，可点击切换面板 */
.cat-bar button {
  flex: 0 0 auto;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.cat-bar button:hover { border-color: var(--accent); color: var(--accent); }
.cat-bar button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}
/* 经典聚合页：板块切换合并为单一面板（分段控件），不再各自独立成胶囊 */
.seg-bar {
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 6px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.seg-bar button {
  flex: 0 0 auto;
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg-bar button:hover { background: var(--surface-2); color: var(--accent); }
.seg-bar button.on {
  background: var(--accent);
  color: #fffdf6;
  box-shadow: 0 2px 8px var(--accent-soft);
}
/* 手机端：压缩分段面板与分类胶囊的纵向高度；按钮到正文统一 16px */
@media (max-width: 760px) {
  .cat-bar { margin-bottom: 16px; }
  .seg-bar { gap: 3px; padding: 4px; border-radius: 12px; margin-bottom: 12px; }
  .seg-bar button { padding: 5px 12px; border-radius: 8px; font-size: 12.5px; line-height: 1.5; }
  .cat-bar:not(.seg-bar) { gap: 6px; padding: 3px 0 0; }
  .cat-bar:not(.seg-bar) a { padding: 4px 11px; font-size: 12px; line-height: 1.45; }
}
.seg-desc { margin: 0 0 12px; font-size: 13px; color: var(--muted); }

/* ============ 相册 / 作品 / 视频频道：动态分类胶囊 + 图片网格 ============ */
.dyn-cats {
  flex-wrap: wrap;
  overflow: visible;
  gap: 10px;
  padding: 18px 0 0;
}
.dyn-cats button {
  padding: 9px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.dyn-cats button:hover { background: var(--line); border-color: var(--line); color: var(--text); transform: translateY(-1px); }
.dyn-cats button.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.album-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.album-card[hidden], .list-item[hidden], .video-card[hidden] { display: none !important; }
.album-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.album-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-card .album-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 16px 14px;
  background: linear-gradient(transparent, rgba(20, 16, 12, .68));
  color: #fffdf6;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 14px;
  letter-spacing: 1px;
}
.album-card .album-cap small {
  display: block; margin-top: 3px;
  font-family: inherit; font-size: 12px; letter-spacing: 0; opacity: .82;
}

/* 瀑布流（masonry）：相册多图按列排布，卡片高度随图片比例自适应 */
.album-grid.masonry {
  display: block;
  columns: 3 220px;
  column-gap: 12px;
}
.album-grid.masonry .album-card {
  aspect-ratio: auto;
  width: 100%;
  margin: 0 0 12px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.album-grid.masonry .album-card img { width: 100%; height: auto; object-fit: contain; }

@media (max-width: 760px) {
  .cat-bar.dyn-cats { gap: 8px; padding: 4px 0 0; }
  .dyn-cats button { padding: 6px 15px; font-size: 13px; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .album-grid.masonry { columns: 2; column-gap: 10px; }
  .album-grid.masonry .album-card { margin: 0 0 10px; }
  .album-card { border-radius: 12px; }
  .album-card .album-cap { padding: 22px 11px 11px; font-size: 12.5px; }
}

/* ============ 视频频道：横幅缩略图卡片 ============ */
.video-list { display: flex; flex-direction: column; gap: 14px; margin: 26px 0 16px; }
/* 融入为主、留一丝边界：极淡描边 + 大模糊低对比阴影，不铺底色色块 */
.video-card { display: block; border: 1px solid var(--line-soft); border-color: color-mix(in srgb, var(--line) 70%, transparent); border-radius: 14px; background: transparent; overflow: hidden; color: inherit; text-decoration: none; box-shadow: 0 8px 30px -22px rgba(0,0,0,.18); transition: transform .22s ease, border-color .2s ease, box-shadow .22s ease, background .2s ease; }
.video-card:hover { background: color-mix(in srgb, var(--surface) 22%, transparent); border-color: color-mix(in srgb, var(--line) 90%, transparent); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.video-card.locked { opacity: .82; }
/* 左上角横幅缩略图：有封面用图，没封面用视频首帧 */
.vc-thumb { position: relative; width: clamp(118px, 19%, 165px); aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.vc-thumb img, .vc-thumb video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.vc-thumb video { background: #10131a; }
.vc-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.52); pointer-events: none; }
.vc-play::after { content: ''; position: absolute; left: 9px; top: 7px; width: 0; height: 0; border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.vc-body { padding: 16px 18px 18px; }
.vc-body h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; line-height: 1.5; letter-spacing: .3px; }
.vc-body p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vc-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.vc-cat { display: inline-block; padding: 3px 12px; border: 1px solid var(--line); border-color: color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; color: var(--accent); font-size: 12px; line-height: 1.6; }
.vc-meta time { font-size: 12.5px; color: var(--muted); }
@media (max-width: 600px) {
  .video-list { margin-top: 20px; }
  .vc-thumb { width: 118px; }
  .vc-body { padding: 14px 16px 16px; }
  .vc-body h3 { font-size: 15.5px; }
}

/* ============ 文章详情 ============ */
.post-head { margin-bottom: 4px; }
.post-head h1 {
  margin: 6px 0 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  line-height: 1.45;
  letter-spacing: 1px;
}
.post-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.post-body .post-fig { margin: 16px 0; text-align: center; }
.post-body .post-fig img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.06); }

/* 视频帖：详情页播放器 */
.post-video { margin: 0 0 18px; }
.post-video video { display: block; width: 100%; border-radius: 12px; background: #000; box-shadow: var(--shadow); }

/* 相册帖：详情页图集两列排布 */
.post-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.post-gallery .post-fig { margin: 0; }
@media (max-width: 760px) { .post-gallery { gap: 8px; } }

/* ============ 后台图片 / 视频管理：素材库式网格 ============ */
.mg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mg-dragging { outline: 2px dashed var(--accent-2, #b48b3c); outline-offset: 6px; border-radius: 10px; }
#img-list > .empty, #vid-list > .empty { border: 1px dashed var(--line); border-radius: 12px; padding: 28px; }
.mg-item { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.mg-item[hidden] { display: none !important; }
.mg-thumb { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--line); cursor: pointer; }
.mg-thumb img, .mg-thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
.mg-thumb video { background: #000; }
.mg-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.5); pointer-events: none; }
.mg-play::after { content: ''; position: absolute; left: 13px; top: 10px; width: 0; height: 0; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.mg-thumb input[type=checkbox] { position: absolute; top: 6px; left: 6px; z-index: 2; margin: 0; }
.mg-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: .55; font-size: 12px; }
.mg-cap { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 2px; font-size: 12.5px; min-width: 0; }
.mg-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-meta { font-size: 11.5px; }
.mg-ops { display: flex; gap: 6px; padding: 6px 10px 10px; }
.mg-ops .mini-btn { padding: 3px 9px; font-size: 12px; line-height: 1.5; text-align: center; }

/* 图片 / 视频编辑独立弹窗 */
.mg-modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; z-index: 10003; padding: 16px; overflow-y: auto; }
.mg-modal-box { width: min(560px, 100%); max-height: 88vh; margin: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.mg-modal-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
/* body 必须能收缩：否则内容一高，底部操作栏会被 overflow:hidden 裁掉（保存按钮看不见） */
.mg-modal-body { flex: 1 1 auto; min-height: 0; display: flex; gap: 14px; flex-wrap: wrap; padding: 14px 16px; overflow: auto; }
.mg-modal-preview { flex: 0 0 160px; display: flex; flex-direction: column; gap: 6px; }
.mg-modal-preview img, .mg-modal-preview video { width: 160px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.mg-modal-preview video { background: #000; }
.mg-modal-fields { flex: 1; min-width: 220px; }
.mg-modal-fields .form-row { margin-bottom: 8px; }
.mg-modal-fields textarea.mg-m-summary { min-height: 68px; height: 68px; padding: 8px 10px; font-size: 13px; line-height: 1.6; resize: vertical; }
.mg-modal-msg { flex: 0 0 auto; padding: 0 16px; min-height: 18px; font-size: 12px; color: var(--accent-2); }
/* 操作栏固定在弹窗底部，不随内容滚动 */
.mg-modal-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.mg-modal-foot .btn { width: auto; }

/* 图片管理紧凑工具栏：类别 → 选择图片 → 批量操作（右侧） */
.mg-tb-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mg-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.mg-toolbar .mg-tb-label { font-size: 12.5px; white-space: nowrap; opacity: .75; }
.mg-toolbar select, .mg-tb-bulk select { width: auto; height: 30px; padding: 3px 8px; font-size: 12.5px; }
.mg-toolbar .mini-btn, .mg-tb-bulk .mini-btn { height: 30px; padding: 0 12px; font-size: 12.5px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.mg-toolbar .mg-tb-bulk { gap: 6px; margin: 0 0 0 auto; }
.mg-tb-sep { flex: 0 0 1px; width: 1px; height: 20px; background: var(--line); }
@media (max-width: 600px) {
  .mg-toolbar .mg-tb-bulk { margin-left: 0; width: 100%; }
  .mg-tb-sep { display: none; }
}

/* 待上传列表 + 上传进度条 */
.mg-pending { border: 1px dashed var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; background: var(--surface-2); }
.mg-pending-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.mg-progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.mg-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2, #d8b26a)); transition: width .15s linear; }
.mg-pending-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.mg-pending-item { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); padding-bottom: 5px; }
.mg-pending-item img, .mg-pending-item video { display: block; width: 100%; height: 74px; object-fit: cover; background: #000; }
.mg-p-file { padding: 4px 22px 0 6px; font-size: 11px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-p-fields { padding: 4px 6px 0; }
.mg-p-row { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.mg-p-row > span { flex: 0 0 28px; font-size: 11px; opacity: .7; }
.mg-p-row input[type=text], .mg-p-row select { flex: 1; min-width: 0; width: 100%; height: 24px; padding: 2px 5px; font-size: 11.5px; }
.mg-p-row textarea { flex: 1; min-width: 0; width: 100%; min-height: 46px; height: 46px; padding: 4px 6px; font-size: 11.5px; line-height: 1.45; resize: vertical; }
.mg-p-check { display: flex; align-items: center; gap: 4px; font-size: 11.5px; cursor: pointer; }
.mg-p-check input { margin: 0; }
.mg-pending-rm { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; line-height: 16px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 11px; padding: 0; }
.mg-pending-rm:hover { background: #c0392b; }

/* 上传结果弹窗 */
.mg-result-box { width: min(440px, 100%); }
.mg-result-ok { font-size: 15px; color: #4caf7d; margin-bottom: 4px; }
.mg-result-bad { font-size: 15px; color: #d9705d; margin-bottom: 8px; }
.mg-result-list { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.8; max-height: 180px; overflow: auto; }
@media (max-width: 600px) {
  .mg-modal-preview { flex: 1 1 100%; }
  .mg-modal-preview img, .mg-modal-preview video { width: 100%; height: 120px; }
}
@media (max-width: 760px) { .mg-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; } }

/* 正文框拖拽插图高亮 */
#p-content.drag-over { outline: 2px dashed var(--accent); outline-offset: 2px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }

/* 文章图库弹窗 */
[hidden] { display: none !important; } /* hidden 优先级最高，防止 display:flex 覆盖导致弹窗直接显示 */
.imglib-mask { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 10002; padding: 16px; }
.imglib-box { width: min(720px, 100%); max-height: 82vh; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.imglib-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.imglib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding: 14px; overflow: auto; }

/* ===== 后台正文编辑：图片可视化条 + 展开编辑框 ===== */

.img-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 2px; }
.thumb-hint { width: 100%; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.thumb-card { position: relative; width: 100px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.thumb-card img { width: 100%; height: 78px; object-fit: cover; display: block; background: var(--line-soft); }
.thumb-cap { display: block; font-size: 11px; color: var(--muted); text-align: center; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-ops { display: flex; flex-direction: row; flex-wrap: nowrap; width: 100%; align-items: stretch; }
.thumb-ops button { flex: 1 1 0; min-width: 0; border: 0; padding: 6px 0; font-size: 11px; cursor: pointer; }
.thumb-rep { background: var(--accent-2); color: #fff; }
.thumb-rep:hover { filter: brightness(1.05); }
.thumb-del { background: var(--surface); color: var(--accent); border-left: 1px solid var(--line); }
.thumb-del:hover { background: var(--accent-soft); }

/* 替换图片浮层：本地上传 / 从图库选择 横向自动排列 */
.thumb-reppop { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 10001; padding: 16px; }
.thumb-reppop[hidden] { display: none; }
.trp-box { width: min(320px, 92%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.trp-title { font-size: 14px; font-weight: 700; color: var(--accent); margin-bottom: 12px; text-align: center; }
.trp-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.trp-btns button { flex: 1 1 120px; padding: 12px 0; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; background: var(--surface-2); color: var(--text); }
.trp-local { background: var(--accent-2) !important; color: #fff !important; border-color: var(--accent-2) !important; }
.trp-close { width: 100%; margin-top: 10px; padding: 8px 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.imglib-cell { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, transform .15s; }
.imglib-cell:hover { border-color: var(--accent); transform: translateY(-2px); }
.imglib-cell img { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; background: #fff; }
.imglib-cell span { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imglib-del { margin-top: 2px; font-size: 11px; color: #fff; background: #c0392b; border: 0; border-radius: 6px; padding: 3px 0; cursor: pointer; }
.imglib-del:hover { background: #a93226; }
.imglib-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.post-body { font-size: 15.5px; line-height: 1.95; }
.post-body .md-block { margin-bottom: 6px; }
.post-body .md-p { margin: 0 0 12px; text-indent: 2em; text-align: justify; }
.post-body .md-sub {
  margin: 18px 0 10px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 1px;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
  text-indent: 0;
}
.post-body .md-note {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--muted);
  background: var(--surface-2);
  padding: 8px 10px;
  border-radius: 8px;
  text-indent: 0;
}

.post-nav { display: flex; gap: 12px; margin-top: 16px; }
.post-nav .pn-btn { flex: 1 1 0; min-width: 0; }
.post-nav .pn-btn.pn-right { text-align: right; }
.post-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); text-decoration: none;
  transition: .15s; min-height: 46px;
}
.post-nav .pn-right a { flex-direction: row-reverse; text-align: right; }
.post-nav a:hover { border-color: var(--accent); color: var(--accent); }
.post-nav a svg { width: 18px; height: 18px; flex: none; }
.post-nav .pn-title { font-size: 13.5px; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.post-nav .pn-empty { display: flex; align-items: center; min-height: 46px; padding: 0 4px; color: var(--muted); font-size: 13px; }

/* ============ 易经 ============ */
.gua-detail {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.gua-detail .gd-copy { flex: 1 1 auto; min-width: 0; }
.gua-detail h1 {
  margin: 0 0 6px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 24px;
  letter-spacing: 3px;
}
.gua-trigram {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.field {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.field .f-label {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 4px;
  font-weight: 600;
}
.field .f-body {
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  line-height: 1.9;
  text-align: justify;
}

.divine-box { text-align: center; }
.divine-result {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  text-align: left;
}
.coin-anim {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 4px;
}
.coin {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-family: "Songti SC", "STSong", serif;
  background: var(--surface-2);
}

/* ============ 资料 / 文件 ============ */
.file-item {
  display: flex;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}
.file-item:last-child { border-bottom: none; }
.fi-icon {
  width: 42px; height: 42px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
}
.fi-icon svg { width: 20px; height: 20px; }
.fi-main { flex: 1 1 auto; min-width: 0; }
.fi-name {
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.45;
}
.fi-desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}
.fi-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.fi-act { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
.mini-btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.mini-btn.danger { color: var(--mark-color); border-color: color-mix(in srgb, var(--mark-color) 40%, var(--line)); }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.gallery a {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.gallery img { width: 100%; height: 100%; object-fit: cover; }

.drop-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 22px 14px;
  text-align: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}
.drop-zone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.drop-zone input[type="file"] { display: none; }

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
  margin-top: 10px;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s ease;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}
.stat-grid .st-num {
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  color: var(--accent);
}
.stat-grid .st-label { font-size: 11px; color: var(--muted); }

/* ============ 免责声明 ============ */
.legal h3 {
  font-family: "Songti SC", "STSong", serif;
  font-size: 15px;
  color: var(--accent);
  margin: 16px 0 6px;
  letter-spacing: .5px;
}
.legal p, .legal li {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--text);
  text-align: justify;
}
.legal ul { padding-left: 20px; margin: 6px 0; }

/* ============ 底部导航 ============ */
.bottombar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-top: 1px solid var(--line-soft);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottombar a {
  flex: 1 1 0;
  padding: 7px 0 6px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  display: block;
  transition: color .15s;
}
.bottombar a svg { width: 20px; height: 20px; display: block; margin: 0 auto 2px; }
.bottombar a.on { color: var(--accent); font-weight: 600; }
.bottombar a.on svg { stroke: var(--accent); }

/* PC 宽屏：底部导航变为底部居中的圆角悬浮“码头”，不占满整行 */
@media (min-width: 768px) {
  .bottombar {
    left: 50%;
    right: auto;
    bottom: 20px;
    transform: translateX(-50%);
    width: auto;
    max-width: 92vw;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    box-shadow: var(--shadow);
    padding: 6px 8px;
  }
  .bottombar a {
    flex: 0 0 auto;
    min-width: 80px;
    padding: 8px 16px;
    border-radius: 999px;
    white-space: nowrap;
  }
  .bottombar a.on { background: var(--accent-soft); }
}

/* ============ PC 主页（参考 leerui.cn：大留白 + 多列卡片网格 + 克制分隔线） ============ */
@media (min-width: 768px) {
  .home .hero {
    min-height: 82vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px 48px;
    margin-bottom: 22px;
  }
  .home .home-hero-full .hero-title { font-size: 46px; letter-spacing: 8px; }
  .home .hero-cli {
    display: block;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 13px; color: var(--muted); margin-top: 20px; line-height: 1.7;
  }
  .home .hero-cli .prompt { color: var(--accent); margin-right: 6px; }
  .home .hero-cli .cli-out { opacity: .8; }
  .home .hero-scroll {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
    font-size: 12px; color: var(--muted);
    animation: hintBounce 1.8s ease-in-out infinite;
  }
  .home .hero-scroll svg { width: 18px; height: 18px; }
  @keyframes hintBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(6px); }
  }
  .home .hero-title {
    font-size: 40px;
    letter-spacing: 6px;
  }
  .home .hero-line {
    font-size: 16px;
    max-width: 640px;
  }
  .home .section-title {
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 8px;
    margin: 30px 2px 14px;
  }
  .home .list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .home .home-guide .guide-intro { font-size: 15.5px; max-width: 760px; }
  .home .guide-links a { min-width: 150px; }
}

/* 主页：关于本站 / 栏目引导（仿 leerui 的 About/引导） */
@media (max-width: 767px) {
  .home .hero-cli, .home .hero-scroll { display: none; }
}
.home-guide .guide-intro { margin: 0 0 12px; font-size: 14px; line-height: 1.9; color: var(--text); }
.guide-links { display: flex; flex-wrap: wrap; gap: 10px; }
.guide-links a {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); text-decoration: none; color: var(--text);
  min-width: 130px; transition: border-color .15s, color .15s;
}
.guide-links a b { font-family: "Songti SC", "STSong", serif; font-size: 15px; letter-spacing: 1px; }
.guide-links a span { font-size: 11.5px; color: var(--muted); }
.guide-links a:hover { border-color: var(--accent); color: var(--accent); }

/* ============ 抽屉 / 皮肤面板 ============ */
.mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.mask.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateY(calc(100% + 40px));
  transition: transform .3s cubic-bezier(.22, .9, .3, 1);
  padding: 14px 16px calc(28px + env(safe-area-inset-bottom));
  max-height: 82vh;
  overflow-y: auto;
}
.sheet.on { transform: translateY(0); }
@media (min-width: 761px) {
  .sheet { margin-bottom: 28px; }
}
.sheet-handle {
  width: 42px; height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 0 auto 12px;
}
.sheet h3 {
  margin: 0 0 12px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  letter-spacing: 1px;
}
.sheet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet-back {
  flex: none;
  margin: 0;
  padding: 0 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sheet-back:hover { color: var(--text); }

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.switch-grid .switch-row {
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-2, transparent);
}
.switch-grid .switch-row.wide { grid-column: 1 / -1; }
.switch-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ============ 后台：分层导航与折叠分组 ============ */
.card[hidden] { display: none !important; }
.adm-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.adm-tabs button {
  flex: 1 1 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.adm-tabs button:hover { background: var(--surface-2); color: var(--text); }
.adm-tabs button.on { background: var(--accent); color: #fffdf6; }
.adm-group {
  margin: 0 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-2, transparent);
}
.adm-group > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.adm-group > summary::-webkit-details-marker { display: none; }
.adm-group > summary::before {
  content: '▸';
  color: var(--muted);
  font-size: 12px;
  transition: transform .15s ease;
}
.adm-group[open] > summary::before { transform: rotate(90deg); }
.adm-group-body { padding: 2px 14px 12px; }
.adm-danger > summary { color: var(--accent); }

/* 后台各频道卡片：标题行右上角折叠按钮（按钮由 admin.php 注入） */
/* 首屏防闪烁：默认折叠，末尾脚本就位后移除 xs-fold-init */
#xs-content.admin-page.xs-fold-init section.card > :not(.section-title):not(.pe-head) { display: none !important; }
.admin-page .section-title,
.admin-page .pe-head { gap: 8px; }
.admin-page .section-title > .more,
.admin-page .pe-head > .pe-head-side { margin-left: auto; }
.admin-page .card-fold {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.admin-page .card-fold:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.admin-page .card-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.admin-page .card-fold svg { width: 16px; height: 16px; display: block; transition: transform .18s ease; }
.admin-page section.card.is-collapsed > [data-fold-head] { margin-bottom: 0; }
.admin-page section.card.is-collapsed { padding-bottom: 12px; }
.admin-page section.card.is-collapsed > :not([data-fold-head]) { display: none !important; }
.admin-page #post-edit.is-collapsed { padding-bottom: 0; }
.admin-page #post-edit.is-collapsed > .pe-head { border-bottom: 0; border-radius: var(--radius); }
/* 收起后箭头指向右侧，与 .adm-group 的 ▸ 语义一致 */
.admin-page section.card.is-collapsed .card-fold svg { transform: rotate(-90deg); }

.adm-channels { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.adm-channels th, .adm-channels td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.adm-channels th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.adm-cat-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.adm-cat-chips .chip { font-size: 11.5px; padding: 2px 8px; }
.adm-ch > summary { flex-wrap: wrap; }
.adm-ch .ch-name { font-weight: 600; min-width: 72px; }
.adm-ch .chip { font-size: 11.5px; padding: 2px 8px; margin-right: 4px; }
.adm-ch .btn[disabled], .adm-ch .mini-btn[disabled] { opacity: .42; cursor: not-allowed; }
@media (max-width: 760px) {
  .adm-tabs button { padding: 8px 6px; font-size: 13px; }
  .adm-channels { font-size: 12.5px; }
}

.menu-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.menu-list a svg { width: 18px; height: 18px; color: var(--muted); }
.menu-list a span.grow { flex: 1 1 auto; }
.menu-list a small { color: var(--muted); font-size: 11.5px; }

/* 技术支持面板 */
.support-list { margin: 4px 0 14px; }
.support-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--surface-2); border-radius: 10px; margin-bottom: 10px; }
.support-item:last-child { margin-bottom: 0; }
.support-ico { font-size: 20px; width: 24px; text-align: center; flex: none; }
.support-label { font-size: 11px; color: var(--muted); line-height: 1.4; }
.support-val { font-size: 14px; color: var(--accent); font-weight: 600; }

/* 转发面板：渠道网格 */
.share-grid { display: grid; grid-template-columns: repeat(6, minmax(60px, 1fr)); gap: 10px 6px; padding: 8px 2px 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--muted) transparent; }
.share-grid::-webkit-scrollbar { height: 6px; }
.share-grid::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 999px; }
.share-grid::-webkit-scrollbar-track { background: transparent; }
.share-opt { display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; border: 0; cursor: pointer; color: var(--text); font-size: 12.5px; padding: 4px 2px; line-height: 1.2; }
.share-opt .share-ico { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--line); font-size: 18px; font-weight: 700; }
.share-opt:active .share-ico { transform: scale(.93); }

/* 我的账号面板 */
.account-form { display: flex; flex-direction: column; gap: 12px; padding: 4px 0 2px; }
.account-form .fld { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.account-form .fld > span { flex: none; width: auto; text-align: left; }
.account-form .fld input,
.account-form .fld select,
.account-form .fld textarea { flex: 1 1 auto; min-width: 0; }
.account-form .fld textarea { align-self: stretch; }
.account-form .fld input {
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  -webkit-appearance: none;
  appearance: none;
}
.account-form .fld input:focus { outline: none; border-color: var(--accent); }
.account-form .fld input:disabled { opacity: .6; background: var(--bg); }
.account-form .account-hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* 界面风格面板 */
.theme-list { margin-top: 4px; }
.theme-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 2px;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  background: none;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.theme-opt:last-child { border-bottom: none; }
.theme-opt .sw { display: flex; flex: 0 0 auto; gap: 3px; }
.theme-opt .sw i { width: 14px; height: 14px; border-radius: 4px; display: block; }
.theme-opt .t-grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.theme-opt .t-name { font-family: var(--font-seal); font-size: 16px; line-height: 1.1; }
.theme-opt .t-desc { font-size: 12px; color: var(--muted); }
.theme-opt .tick { width: 18px; height: 18px; flex: 0 0 auto; color: var(--accent); opacity: 0; }
.theme-opt.on { color: var(--accent); }
.theme-opt.on .tick { opacity: 1; }

/* ============ 页脚 ============ */
.footer {
  padding: 18px 14px 26px;
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.9;
}
.footer a { color: var(--accent); }
.footer .f-links { display: flex; justify-content: center; gap: 14px; margin-bottom: 6px; }
.footer .icp { margin-top: 4px; }

/* ============ 动画 ============ */
/* 频道切换要"点即到"：入场动画压到 .18s，分级延迟同步缩短 */
.fade-in { animation: fadeIn .18s ease both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
/* 首屏 hero：仅淡入、不纵向位移，避免每次刷新"向上缩"一下 */
.hero.fade-in { animation-name: heroFade; }
@keyframes heroFade { from { opacity: 0; } to { opacity: 1; } }
.fade-in.d1 { animation-delay: .02s; }
.fade-in.d2 { animation-delay: .04s; }
.fade-in.d3 { animation-delay: .06s; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(14px);
  background: rgba(30, 26, 22, .92);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  max-width: 86vw;
  text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 大屏优化 ============ */
@media (min-width: 700px) {
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .gua-grid { grid-template-columns: repeat(8, 1fr); }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  body { font-size: 15.5px; }
  .hero-title { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 手机端：导航点击不再等待双击缩放判定，消除切频道时的迟滞感 */
@media (max-width: 680px) {
  .topnav nav a, .bottombar a { touch-action: manipulation; }
  .bottombar a:active { background: var(--surface-2); color: var(--accent); }
}

/* 无刷新切页：点击立即出现顶部进度条，避免"点了没反应"的迟滞感 */
body.xs-pjax-loading::after{content:'';position:fixed;left:0;top:0;height:2px;width:32%;background:var(--accent);z-index:999;box-shadow:0 0 8px var(--accent);animation:xsPjaxBar .7s ease-in-out infinite alternate}
@keyframes xsPjaxBar{from{transform:translateX(-100%)}to{transform:translateX(410%)}}

/* 手机端：滚动到整页 20%~75% 区间时，顶部栏与底部栏同步收起；开头/结尾常驻。
   PC 端(>=768px)不做任何隐藏处理。 */
@media (max-width: 767px) {
  /* 手机端不显示背景光晕；PC 端保持原样 */
  .hero-glow { display: none; }
  .topnav, .bottombar, .tool-fab { transition: opacity .25s ease, transform .25s ease; }
  body.xs-bars-hidden .topnav { opacity: 0; transform: translateY(-140%); pointer-events: none; }
  body.xs-bars-hidden .bottombar { opacity: 0; transform: translateY(140%); pointer-events: none; }
  /* 右侧排盘工具悬浮条与顶栏同步收起/恢复；保留 translateY(-50%) 的垂直居中 */
  body.xs-bars-hidden .tool-fab { opacity: 0; transform: translateY(-50%) translateX(120%); pointer-events: none; }
}

/* ============ 栏目更新红点 ============ */
.bottombar a { position: relative; }
.bottombar a.has-update::after {
  content: '';
  position: absolute;
  top: 2px;
  right: calc(50% - 15px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e23b3b;
  box-shadow: 0 0 0 2px var(--surface);
  pointer-events: none;
}
/* 暗色皮肤（墨韵 / 松烟 / 夜阑）下用更亮的红点并加发光，保证在深色背景上清晰可见 */
[data-theme="mo"] .bottombar a.has-update::after,
[data-theme="song"] .bottombar a.has-update::after,
[data-theme="ye"] .bottombar a.has-update::after {
  background: #ff6b6b;
  box-shadow: 0 0 0 2px var(--surface), 0 0 6px 1px rgba(255, 107, 107, .75);
}

/* ============ 首页动态走马灯 ============ */
.marquee {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.marquee-track {
  display: flex;
  gap: 12px;
  width: max-content;
  padding: 2px 0;
  animation: marquee-x 30s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track.no-scroll { animation: none; }
.marquee-track.dyn-carousel {
  width: 100%;
  gap: 0;
  animation: none;
  transition: transform .55s ease;
  will-change: transform;
}
.marquee-track.dyn-carousel .dyn-card { flex: 0 0 100%; width: 100%; }
@keyframes marquee-x {
  0%   { transform: translateX(100%); }
  8%   { transform: translateX(100%); }
  92%  { transform: translateX(-100%); }
  100% { transform: translateX(-100%); }
}

.dyn-card {
  flex: 0 0 auto;
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.dyn-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}
.dyn-cover {
  width: 100%;
  height: 112px;
  background-size: cover;
  background-position: center;
  background-color: var(--seal-bg);
}
.dyn-body { padding: 10px 12px 12px; }
.dyn-body h3 { font-size: 14.5px; margin: 0 0 6px; line-height: 1.35; }
.dyn-body p { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.6; }

.li-cover {
  width: 44px; height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
}
.dyn-detail-cover {
  width: 100%;
  border-radius: 12px;
  margin: 4px 0 14px;
  display: block;
}
.dyn-detail-text {
  font-size: 15px;
  line-height: 1.95;
  color: var(--text);
}
/* 动态正文配图：去掉浏览器默认的左右 40px 缩进，宽度撑满与正文对齐，并加微圆角 */
.dyn-detail-text .post-fig { margin: 16px 0; text-align: center; }
.dyn-detail-text .post-fig img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.06); }

/* ============ 点赞 / 转发 ============ */
/* 详情页底部操作行：点赞 / 转发 / 返回 同一行，均无边框 */
.post-foot { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.post-actions { display: flex; gap: 14px; align-items: center; margin: 0; }
.act-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 10px; border-radius: 999px; cursor: pointer;
  background: none; border: 0; color: var(--text); font-size: 14px; line-height: 1; transition: .15s;
}
.act-btn svg { width: 18px; height: 18px; display: block; }
.act-btn .txt { font-weight: 500; }
.act-btn .cnt { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 1em; text-align: center; }
.act-btn.btn-like.on { color: var(--accent); }
.act-btn.btn-like.on svg { fill: var(--accent); stroke: var(--accent); }
.act-btn.btn-share:hover, .act-btn.btn-like:hover { color: var(--accent); }
.act-btn:active { transform: scale(.95); }
.foot-back { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 8px 6px; color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: none; }
.foot-back:hover { color: var(--accent); }
.foot-back svg { width: 18px; height: 18px; display: block; }

/* 列表卡片：紧凑图标按钮 */
.act-ico {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; line-height: 1; transition: .15s;
}
.act-ico svg { width: 16px; height: 16px; display: block; }
.act-ico .cnt { font-variant-numeric: tabular-nums; }
.act-ico.btn-like.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.act-ico.btn-like.on svg { fill: var(--accent); stroke: var(--accent); }
.act-ico.btn-share:hover { color: var(--accent); border-color: var(--accent); }
.act-ico:active { transform: scale(.95); }

/* 排盘入口页：转发浮动按钮（圆形图标） */
.fab-share {
  position: fixed; right: 16px; bottom: 72px; z-index: 60;
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; background: var(--accent); color: #fff; border: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.fab-share svg { width: 22px; height: 22px; display: block; }
.fab-share:active { transform: scale(.94); }

/* ============ 手机端：频道页配色与主页文章信息块对齐 ============
   与 newhome.php 手机端同款：卡片底色向主框架靠拢、边框与阴影淡化、左右融入背景。
   全部由主题变量派生，6 套皮肤自动适配；PC 端不受影响。 */
@media (max-width: 767px) {
  .card:not(.card-flat) {
    /* WebKit(iOS Safari) 会把「上下半透明边框 + 左右实色边框 + 圆角」在四角
       画出连接弧线，Android 不会；故四边 border 置透明，上下细线改用背景
       渐变绘制（颜色与原上下边框一致），两端渲染统一。 */
    --card-line: color-mix(in srgb, var(--line) 14%, transparent);
    border-color: transparent;
    background-color: color-mix(in srgb, var(--surface) 50%, var(--bg));
    background-image:
      linear-gradient(var(--card-line), var(--card-line)),
      linear-gradient(var(--card-line), var(--card-line)),
      linear-gradient(90deg, var(--bg) 0, transparent 14px, transparent calc(100% - 14px), var(--bg) 100%);
    background-repeat: no-repeat;
    background-origin: border-box;
    background-position: top left, bottom left, top left;
    background-size: 100% 1px, 100% 1px, 100% 100%;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--seal-shade, rgba(90,66,40,.20)) 22%, transparent);
  }
  /* 移动端空状态卡片（仅含 .empty 提示）：去掉上下细线与投影，避免「无内容却有边框线」 */
  .card:not(.card-flat):has(.empty){
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }
  .card-flat { border-color: color-mix(in srgb, var(--line) 14%, transparent); }
  /* 行式文章 / 资料列表：只淡化分隔线，保持原有行布局 */
  .list-item, .file-item { border-bottom-color: color-mix(in srgb, var(--line) 14%, transparent); }
  /* 分类胶囊 / 分段控件 / 更多按钮：同款淡底淡线淡阴影；.on 选中态保持原样 */
  .cat-bar:not(.seg-bar) a:not(.on),
  .cat-bar:not(.seg-bar) button:not(.on),
  .dyn-cats button:not(.on),
  .more-btn,
  .seg-bar {
    background-color: color-mix(in srgb, var(--surface) 50%, var(--bg));
    border-color: color-mix(in srgb, var(--line) 30%, transparent);
    box-shadow: 0 1px 6px color-mix(in srgb, var(--seal-shade, rgba(90,66,40,.20)) 18%, transparent);
  }
  /* 图片网格卡片 */
  .album-card {
    background-color: color-mix(in srgb, var(--surface-2) 50%, var(--bg));
    box-shadow: 0 2px 10px color-mix(in srgb, var(--seal-shade, rgba(90,66,40,.20)) 22%, transparent);
  }
  /* 选中态（含「全部」）：不用实色块，改淡强调底 + 强调色文字，避免过深过跳 */
  .cat-bar a.on,
  .cat-bar button.on,
  .seg-bar button.on,
  .dyn-cats button.on {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--accent);
    font-weight: 600;
    box-shadow: none;
  }
}

/* ============ 前台频道 / 经典子面板 / 文章卡片：与视频页一致的融入感边界 ============ */
/* 后台管理页由 XS_MAIN_CLASS 标记 .admin-page，保留原有清晰分组，不受本节影响 */
#xs-content:not(.admin-page) .card {
  background: transparent;
  border: 1px solid var(--line-soft);
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  box-shadow: 0 8px 30px -22px rgba(0,0,0,.18);
}
#xs-content:not(.admin-page) .card-flat { box-shadow: none; }
#xs-content:not(.admin-page) .album-card {
  border: 1px solid var(--line-soft);
  border-color: color-mix(in srgb, var(--line) 55%, transparent);
  box-shadow: 0 8px 30px -22px rgba(0,0,0,.18);
}
#xs-content:not(.admin-page) .album-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
/* ============ 前台文章列表：每篇独立成卡片（对齐首页「最近更新」的行式排布） ============ */
#xs-content:not(.admin-page) .list { display: flex; flex-direction: column; gap: 12px; }
#xs-content:not(.admin-page) .list-item {
  padding: 14px 18px;
  border: 1px solid var(--line-soft);
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 14px;
  background: transparent;
  box-shadow: 0 8px 30px -22px rgba(0,0,0,.18);
  transition: transform .22s ease, border-color .2s ease, box-shadow .22s ease, background .2s ease;
}
#xs-content:not(.admin-page) .list-item:hover {
  background: color-mix(in srgb, var(--surface) 22%, transparent);
  border-color: color-mix(in srgb, var(--line) 90%, transparent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
/* 未读色条与独立卡片的圆角、阴影叠加 */
#xs-content:not(.admin-page) .list-item.is-unread {
  border-radius: 14px;
  box-shadow: inset 3px 0 0 var(--accent), 0 8px 30px -22px rgba(0,0,0,.18);
}
#xs-content:not(.admin-page) .list-item.is-unread:hover {
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow-lg);
}
/* 外层容器退为纯布局，避免大框套小卡片的双层边框 */
#xs-content:not(.admin-page) .card:has(> .list) {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* 频道分类 / 板块切换按钮：悬停时浮起，已选中项再加重一档 */
#xs-content:not(.admin-page) .cat-bar a,
#xs-content:not(.admin-page) .cat-bar button,
#xs-content:not(.admin-page) .dyn-cats button,
#xs-content:not(.admin-page) .seg-bar button {
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
#xs-content:not(.admin-page) .cat-bar a:hover,
#xs-content:not(.admin-page) .cat-bar button:hover,
#xs-content:not(.admin-page) .dyn-cats button:hover,
#xs-content:not(.admin-page) .seg-bar button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
#xs-content:not(.admin-page) .cat-bar a.on:hover,
#xs-content:not(.admin-page) .cat-bar button.on:hover,
#xs-content:not(.admin-page) .dyn-cats button.on:hover,
#xs-content:not(.admin-page) .seg-bar button.on:hover {
  box-shadow: var(--shadow-lg);
}

/* ============ 相册灯箱：点击照片后融入式全屏看图 ============ */
.xs-lightbox {
  position: fixed; inset: 0; z-index: 10020;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(8, 9, 11, .82);
  -webkit-tap-highlight-color: transparent;
}
.xs-lightbox.is-open { display: flex; }
.xs-lightbox .lb-stage {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center;
}
.xs-lightbox .lb-img {
  display: block; width: auto; height: auto;
  max-width: min(88vw, 980px);
  max-height: 76vh;
  object-fit: contain;
  background: #141416;
}
.xs-lightbox .lb-img.is-in { animation: lbIn .22s ease both; }
@keyframes lbIn {
  from { opacity: 0; transform: scale(.985); }
  to   { opacity: 1; transform: none; }
}
.xs-lightbox .lb-cap-wrap {
  margin-top: 12px; max-width: min(88vw, 980px); text-align: center;
}
.xs-lightbox .lb-cap {
  color: rgba(255, 253, 246, .88);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 12.5px; letter-spacing: 1px; line-height: 1.6;
  text-decoration: none; cursor: pointer;
}
.xs-lightbox .lb-cap:hover { color: #fffdf6; text-decoration: underline; text-underline-offset: 3px; }
.xs-lightbox .lb-nav,
.xs-lightbox .lb-close {
  position: absolute; display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(28, 28, 30, .42);
  color: rgba(255, 255, 255, .78);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.xs-lightbox .lb-nav:hover,
.xs-lightbox .lb-close:hover {
  background: rgba(60, 60, 64, .7);
  border-color: rgba(255, 255, 255, .55);
  color: #fff;
}
.xs-lightbox .lb-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.xs-lightbox .lb-next { right: 22px; top: 50%; transform: translateY(-50%); }
.xs-lightbox .lb-close { right: 22px; top: 22px; }
.xs-lightbox .lb-nav svg,
.xs-lightbox .lb-close svg { display: block; width: 20px; height: 20px; }
@media (max-width: 760px) {
  .xs-lightbox { padding: 12px; }
  .xs-lightbox .lb-img { max-width: 92vw; max-height: 70vh; }
  .xs-lightbox .lb-cap-wrap { max-width: 92vw; }
  .xs-lightbox .lb-nav, .xs-lightbox .lb-close { width: 34px; height: 34px; }
  .xs-lightbox .lb-prev { left: 10px; }
  .xs-lightbox .lb-next { right: 10px; }
  .xs-lightbox .lb-close { right: 12px; top: 12px; }
}

/* ============ 后台图文编辑器：公众号式双栏布局 ============ */
#post-edit.pe-editor { padding: 0; }
#post-edit .pe-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; border-bottom: 1px solid var(--line-soft);
  border-radius: var(--radius) var(--radius) 0 0;
}
#post-edit .pe-eyebrow {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
  letter-spacing: 2px; color: var(--accent); margin-bottom: 6px;
}
#post-edit .pe-head h2 { margin: 0; font-size: 20px; }
#post-edit .pe-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }
#post-edit .pe-head-ops { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#post-edit .pe-head-ops:empty { display: none; }
/* 标题字数/提示行移到页头标题右侧，与卡片右边缘对齐 */
#post-edit .pe-head .pe-title-meta { margin: 0; text-align: right; }
#post-edit .pe-foot-ops { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; }
#post-edit .pe-alert { margin: 14px 24px 0; }
#post-edit .pe-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
#post-edit .pe-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: stretch; position: relative; }
/* 侧栏收起/展开开关 */
#post-edit .pe-side-toggle {
  position: absolute; top: 50%; right: 302px; transform: translateY(-50%);
  width: 18px; height: 56px; padding: 0; z-index: 6; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line-soft); border-left: 0;
  border-radius: 0 8px 8px 0; box-shadow: 2px 0 6px rgba(0,0,0,.04);
}
#post-edit .pe-side-toggle:hover { color: var(--accent); background: var(--surface); }
#post-edit .pe-side-toggle svg { width: 13px; height: 13px; display: block; pointer-events: none; }
#post-edit .pe-side-toggle .ic-closed { display: none; }
#post-edit .pe-layout.side-hidden { grid-template-columns: minmax(0, 1fr) 0; }
#post-edit .pe-layout.side-hidden .pe-side { display: none; }
#post-edit .pe-layout.side-hidden .pe-side-toggle { right: 0; border-left: 1px solid var(--line-soft); border-right: 0; border-radius: 8px 0 0 8px; box-shadow: -2px 0 6px rgba(0,0,0,.04); }
#post-edit .pe-layout.side-hidden .pe-side-toggle .ic-open { display: none; }
#post-edit .pe-layout.side-hidden .pe-side-toggle .ic-closed { display: block; }
#post-edit .pe-main { min-width: 0; padding: 14px 24px 24px; display: flex; flex-direction: column; }
#post-edit .pe-side {
  padding: 20px; border-left: 1px solid var(--line-soft);
  background: var(--surface-2); border-radius: 0 0 var(--radius) 0;
  display: flex; flex-direction: column; min-height: 0;
}
/* 保存按钮自动落到侧栏底部：侧栏随主栏拉伸（pe-layout 已 stretch），剩余空间留给按钮上边距 */
#post-edit .pe-side > .btn { margin-top: auto; }
#post-edit .pe-title-input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0;
  background: transparent; font: inherit; font-size: 22px; font-weight: 600;
  padding: 2px 0 6px; color: var(--text);
}
#post-edit .pe-title-input:focus { outline: none; border-bottom-color: var(--accent); }
#post-edit .pe-title-wrap { margin-bottom: 14px; }
#post-edit .pe-title-meta { font-size: 12px; color: var(--muted); margin: 3px 0 8px; line-height: 1.4; }
#post-edit .pe-field > label,
#post-edit .pe-body-head label,
#post-edit .pe-attach > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
#post-edit .pe-opt { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 6px; }
#post-edit .pe-body { margin-top: 8px; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; background: var(--surface); flex: 1; display: flex; flex-direction: column; min-height: 0; }
#post-edit .pe-body-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
#post-edit .pe-body-head label { margin: 0; }
#post-edit .pe-count { font-size: 12px; color: var(--muted); }
#post-edit .pe-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); background: var(--surface-2); }
#post-edit .pe-tool {
  border: 1px solid transparent; background: transparent; color: var(--text);
  font: inherit; font-size: 12.5px; padding: 5px 9px; border-radius: 7px;
  cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease;
}
#post-edit .pe-tool:hover { background: var(--surface); border-color: var(--line); color: var(--accent); }
#post-edit .pe-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#post-edit .pe-tool-primary { color: var(--accent); font-weight: 600; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
#post-edit .pe-sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
/* 封面图：标题下独立一行（标签 + 选择文件 + 地址输入 同行放得下） */
#post-edit .pe-cover-block { margin: 4px 0 0; }
#post-edit .pe-cover-row { display: flex; align-items: center; gap: 8px; line-height: 1.2; }
#post-edit .pe-cover-row > label { flex: 0 0 auto; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: var(--text); }
/* 封面组合控件：地址输入框内嵌「上传」按钮 */
#post-edit .pe-cover-combo {
  flex: 1 1 auto; min-width: 140px; height: 32px;
  display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); overflow: hidden;
}
#post-edit .pe-cover-combo input[type="text"] {
  flex: 1 1 auto; min-width: 0; width: auto; height: 30px;
  border: 0; border-radius: 0; background: transparent;
  box-shadow: none; padding: 0 10px; font-size: 13px;
}
#post-edit .pe-cover-combo input[type="text"]:focus { outline: none; box-shadow: none; }
#post-edit .pe-cover-combo input[type="text"].is-file { color: var(--accent); }
#post-edit .pe-cover-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 10px; font: inherit; font-size: 12.5px;
  border: 0; border-left: 1px solid var(--line-soft); border-radius: 0;
  background: var(--surface); color: var(--muted); cursor: pointer;
  transition: color .18s ease, background .18s ease;
}
#post-edit .pe-cover-btn:hover { color: var(--accent); background: var(--accent-soft); }
#post-edit .pe-cover-btn svg { width: 13px; height: 13px; display: block; pointer-events: none; }
#post-edit .pe-cover-clear { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 6px; }
/* 格式栏：紧凑图标按钮（参考 WPS 式工具栏） */
#post-edit .pe-fmt-bar { gap: 2px; padding: 5px 8px; }
#post-edit #pe-fmtbar .pe-tool.pe-ico {
  width: 26px; height: 26px; padding: 0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
#post-edit #pe-fmtbar .pe-ico svg { width: 15px; height: 15px; display: block; pointer-events: none; }
#post-edit #pe-fmtbar .pe-sep { height: 16px; margin: 0 4px; }
#post-edit #pe-fmtbar .pe-size { width: auto; flex: 0 0 auto; height: 26px; font-size: 12px; padding: 0 2px; min-width: 0; border-radius: 6px; }
#post-edit #pe-fmtbar .pe-color { width: 26px; height: 26px; padding: 2px; }
#post-edit .pe-content {
  display: block; width: 100%; flex: 1 1 auto; min-height: 300px; max-height: 65vh; border: 0; border-radius: 0;
  padding: 12px 14px; font: inherit; font-size: 14.5px; line-height: 1.75;
  overflow-y: auto; background: transparent; color: var(--text);
}
#post-edit .pe-content:focus { outline: none; }
#post-edit .pe-content.drag-over { background: var(--accent-soft); }
#post-edit .pe-content:empty:before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
#post-edit .pe-content img.pe-img {
  max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; display: block;
  box-shadow: var(--shadow); border: 1px solid var(--line-soft);
}
#post-edit .pe-content h3.md-sub { font-size: 18px; font-weight: 600; margin: 18px 0 10px; color: var(--text); }
#post-edit .pe-content div.md-p { margin: 0 0 10px; line-height: 1.9; }
#post-edit .pe-content div.md-note { color: var(--muted); font-size: 13px; border-left: 2px solid var(--accent); padding-left: 10px; margin: 10px 0; }
#post-edit .pe-content:focus { outline: none; }
#post-edit .pe-status { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 12px; border-top: 1px dashed var(--line-soft); font-size: 12px; color: var(--muted); }
/* 格式工具栏（仿公众号）：字重/斜体/下划线按钮样式、字号下拉、取色器 */
#post-edit .pe-fmt-bar { border-top: 0; }
#post-edit .pe-size { height: 26px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; padding: 0 4px; cursor: pointer; }
#post-edit .pe-color { width: 26px; height: 26px; padding: 2px; border: 1px solid var(--line-soft); border-radius: 7px; background: var(--surface); cursor: pointer; }
/* 编辑器内引用块（保存为行首 》 标记） */
#post-edit .pe-content .md-quote { border-left: 3px solid var(--line); padding: 2px 10px; margin: 8px 0; color: var(--muted); }
/* 编辑器内列表与分割线 */
#post-edit .pe-content ul, #post-edit .pe-content ol { margin: 8px 0; padding-left: 26px; }
#post-edit .pe-content li { margin: 3px 0; }
#post-edit .pe-content hr.md-hr { border: 0; border-top: 1px dashed var(--line); margin: 14px 0; }
#post-edit .pe-content a { color: var(--accent); text-decoration: underline; }
#post-edit .pe-content table.md-table { width: 100%; border-collapse: collapse; margin: 10px 0; }
#post-edit .pe-content table.md-table th, #post-edit .pe-content table.md-table td { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
#post-edit .pe-content img.pe-img.img-round { border-radius: 10px; }
#post-edit .pe-content img.pe-img.img-shadow { box-shadow: 0 4px 14px rgba(0,0,0,.18); }
#post-edit .pe-attach { margin-top: 16px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 10px; }
#post-edit .pe-attach-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#post-edit .pe-attach-row input[type=file] { flex: 1; min-width: 200px; font-size: 12.5px; }
#post-edit .pe-tip { font-size: 12px; margin-top: 8px; line-height: 1.7; }
#post-edit .pe-panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
#post-edit .pe-panel-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line-soft); }
#post-edit .pe-panel .form-row:last-child { margin-bottom: 0; }
/* 发布侧栏紧凑布局：缩小行距、标签间距与输入框内边距 */
#post-edit .pe-side .form-row { margin-bottom: 8px; }
#post-edit .pe-side .form-row label { margin-bottom: 3px; }
#post-edit .pe-side input[type="text"], #post-edit .pe-side input[type="password"], #post-edit .pe-side select, #post-edit .pe-side textarea { padding: 7px 10px; font-size: 14px; border-radius: 8px; }
#post-edit .pe-side .pe-cover-preview { margin-bottom: 6px; }
#post-edit .pe-cover-preview { margin-bottom: 8px; }
#post-edit .pe-cover-preview img { max-width: 100%; max-height: 120px; border-radius: 8px; border: 1px solid var(--line); }
#post-edit .pe-preview-mask { position: fixed; inset: 0; z-index: 10004; background: rgba(0,0,0,.5); display: flex; align-items: flex-start; justify-content: center; padding: 24px; overflow-y: auto; }
#post-edit .pe-preview-mask[hidden] { display: none; }
#post-edit .pe-preview-box { width: min(760px, 100%); background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-lg); }
#post-edit .pe-preview-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
#post-edit .pe-preview-body { padding: 28px 32px; max-height: 70vh; overflow-y: auto; }
#post-edit .pe-pv-title { font-family: "Songti SC", "STSong", serif; font-size: 26px; margin: 0 0 12px; }
#post-edit .pe-pv-summary { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
#post-edit .pe-pv-body img { max-width: 100%; height: auto; border-radius: 8px; }
#post-edit .pe-pv-body .post-fig { margin: 16px 0; text-align: center; }
#post-edit .pe-pv-body .md-sub { margin: 24px 0 10px; font-size: 18px; }
#post-edit .pe-pv-body .md-p { margin: 0 0 10px; line-height: 1.9; }
#post-edit .pe-pv-body .md-note { color: var(--muted); font-size: 13px; border-left: 2px solid var(--accent); padding-left: 10px; }
@media (max-width: 980px) {
  #post-edit .pe-layout { grid-template-columns: 1fr; }
  #post-edit .pe-side { border-left: 0; border-top: 1px solid var(--line-soft); border-radius: 0; }
  #post-edit .pe-preview-body { padding: 20px; }
}
@media (max-width: 600px) {
  #post-edit .pe-head { flex-wrap: wrap; }
  #post-edit .pe-head-side { align-items: flex-start; width: 100%; }
  #post-edit .pe-head .pe-title-meta { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  #post-edit .pe-tool { transition: none; }
}

