:root {
  /* 主题「宣纸·艾烟·朱砂印」：宣纸为底、赭褐为骨、艾绿点睛、朱砂落印。
     纪律：颜色只做语义与分类，不做装饰色块；文字令牌一律过 4.5:1（WCAG 2.2 SC 1.4.3）。 */
  /* 主色：赭褐（当归/赭石），比上一版暖肤棕更深一档，纸面上 5.6~7.2:1 */
  --primary: #7c4a24;
  --primary-hover: #5f3718;
  --primary-light: #9c6a3f;

  /* 强调：姜金。只用于描边、指示条与图形；当文字用必须走 --gold-ink */
  --gold: #a8762a;
  --gold-light: #dcae6a;
  --gold-ink: #7a5a1e;

  /* 印记：朱砂。只给品牌方印与最终确认态 */
  --seal: #b23a2f;
  --seal-ink: #8f2c24;

  /* 功能色：艾绿 / 陈皮 / 朱砂 */
  --success: #3f6b4a;
  --warning: #7d4f0e;
  --danger: #a8322c;

  /* 纸：宣纸四档 ladder。取代此前散在用户侧的十几个近重复米色 */
  --paper-0: #fffdf8;   /* 卡面、输入底 */
  --paper-1: #f5eee0;   /* 页底 */
  --paper-2: #ece0cb;   /* 分段控件底、进度槽、占位图 */
  --paper-3: #e3d3ba;   /* 描边 */
  --wash-hover: #f0e5d2;
  --line-divider: #eee2cd;
  --line-input: #8a6f55;   /* 表单控件边界按 SC 1.4.11 的 3:1 取，故是一条墨线 */

  /* 状态底与边 */
  --success-wash: #e9f2e8;
  --success-line: #c3ddc6;
  --warning-wash: #f9edd8;
  --warning-line: #ecd9bd;
  --danger-wash: #f9e6e3;
  --danger-line: #f0c7c1;
  --water-wash: #e6eef1;
  --water-line: #c2d5dc;
  --water-ink: #2f5666;   /* 水色族里可读的那一档（白平衡 chip 用） */

  /* 经穴图与经络总图：深褐底上的发光金与青玉尺。
     图内那一串亮金/亮青的阶梯不做合并——它靠亮度分层次（核、晕、选中），并成一档就看不出状态。 */
  --map-bg: #2a180a;
  --map-frame: #5a3a26;
  --map-gold: #f2c879;
  --map-acu: #ffe3ad;
  --map-jade: #86e0c2;

  /* 墨与文字 */
  --ink: #2b1c12;
  --ink-topbar: #33200f;
  --text: #3b2a1e;
  --text-secondary: #6b5340;
  --text-muted: #6f5946;   /* 上一版 #a58d76 在宣纸上只有 3.0:1，抬到 6.5:1；再深就和次级字撞了 */
  --on-primary: #fbf6ec;
  --on-ink: #f7f0e4;

  --bg: #f5eee0;
  --bg-gradient: linear-gradient(160deg, #fbf6ec 0%, #f2e6d3 52%, #ead9bf 100%);
  --card: #fffdf8;
  --border: #e3d3ba;

  /* 形状与动效 */
  --radius: 14px;
  --r-xs: 5px;
  --r-sm: 7px;
  --r-md: 9px;
  --r-lg: 12px;
  --r-pill: 999px;
  --shadow: 0 3px 14px rgba(74, 47, 22, .06);
  --shadow-lg: 0 14px 40px rgba(74, 47, 22, .13);
  --transition: all .2s cubic-bezier(.4, 0, .2, 1);

  /* 字体：正文仍系统无衬线；标题、品牌与数字走系统 CJK 衬线（宋体族）出医案质感。
     不引网络字体——本项目无构建步骤、静态直出，境外字体源在目标用户侧不可靠。 */
  --font-ui: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  --font-song: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  --font-num: Georgia, "Songti SC", "STSong", serif;

  /* 宣纸纤维：内联 SVG 噪点，零网络依赖，作为 body 背景的一层铺底 */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='.05'/%3E%3C/svg%3E");

  /* 顶栏 sticky 的实测高度：分段导航吸顶时要按它下移，否则被顶栏盖住一行 */
  --topbar-h: 68px;
  /* 吸底栏的下限高度：内距 9+9 + 顶部描边 1 + 内容那一排（图标格 39、带描边的按钮 40）。
     栏自己按这个数撑住，页脚按同一个数让位，两处共用一个数才不会各说一半；
     内容比它高时栏自己长高，页脚那 12px 富余吸收掉，不会盖到那句免责声明。 */
  --buybar-h: 58px;
  --card-pad: 18px;
  /* 前台内容列的宽度口径：main#app 与吸底操作栏共用同一对令牌，两者才能量出同一个宽 */
  --app-max: 520px;
  --app-pad: 16px;
}

/* 后台管理维持原「深海青 + 哑金」主题（本次仅用户侧前端换暖肤色） */
#view-admin {
  --primary: #163c4c;
  --primary-hover: #102c39;
  --primary-light: #1d4a5e;
  --gold: #b49a68;
  --gold-light: #d4c198;
  --success: #23766b;
  --border: #dfe6e9;
  --text: #24353e;
  --text-secondary: #61737e;
  --text-muted: #8c9aa4;
  --shadow: 0 3px 14px rgba(22, 43, 54, .035);
  --shadow-lg: 0 14px 40px rgba(22, 43, 54, .09);
  /* App Shell 专用：深色侧栏 + 中性画布 */
  --adm-side: #0f2b36;
  --adm-side-2: #163847;
  --adm-side-text: #a4bcc6;
  --adm-side-dim: #6c8794;
  --adm-hover: rgba(255, 255, 255, .06);
  --adm-active: #163c4c;
  --adm-canvas: #eff2f3;
  --adm-ok: #3fa77c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-ui);
  /* 宣纸纤维铺在渐变之上（背景层序：先写的在上），一层 180px 内联噪点、零网络请求 */
  background: var(--grain) repeat, var(--bg-gradient);
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
::selection { background: var(--gold-light); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--ink-topbar);
  color: var(--on-primary);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-lg);
}
.topbar-inner {
  /* 页头内容行与正文同一列：宽度与左右留白都取那两个令牌，而不是各写一个 520/16 */
  max-width: var(--app-max);
  margin: 0 auto;
  padding: 12px var(--app-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* 顶栏下沿那一节金线：整站唯一一条横贯的强调，用来替代大面积色块 */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 14%, var(--gold-light) 50%, var(--gold) 86%, transparent 100%);
  opacity: .85;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-text { min-width: 0; }
.brand-mark {
  /* 朱砂方印：印面走印泥深红（--seal 只给环与点，做底色时压不住纸上的米字），
     内嵌一道印泥白环，字走宋体族——顶栏唯一一枚高饱和色块 */
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--seal-ink);
  border: 1px solid rgba(251, 246, 236, .42);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(43, 28, 18, .3);
  color: var(--paper-0);
  font-family: var(--font-song);
  font-size: 17px; font-weight: 700;
  letter-spacing: 0;
}
/* 站名运营可改、上限 40 字，而页头右侧还挂着登录态那一串：让它截断，别把右边挤下去 */
.brand-name { font-family: var(--font-song); font-size: 15px; font-weight: 700; letter-spacing: 3px; color: var(--on-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { font-size: 10px; letter-spacing: 2.5px; color: rgba(247, 240, 228, .72); }
/* 字标取的是站名第一个字；站名整体为空时这个圆圈什么都不装，就别占这个位 */
.site-mark:empty { display: none; }
.top-user {
  font-size: 12.5px; color: rgba(247, 240, 228, .92);
  /* 一行保证：CJK 里「/」与字间都是可断行点，窄屏被 flex 挤压时「登录/注册」会折成两行。
     右簇整体不参与收缩（.top-actions flex:none），挤压由站名那一侧吸收——
     那边有 min-width:0 + 省略号，是这份契约里唯一设计来让步的部位。 */
  flex: none; white-space: nowrap;
  /* 昵称上限 32 字（auth.py 的 max_length）：链接本体也要有上限，
     长昵称截断出省略号，而不是把整条顶栏撑变形 */
  max-width: 9em; overflow: hidden; text-overflow: ellipsis;
}

/* 全局功能导航：与 hero card 同风格的白色卡片，置于 main 顶部，所有页面常驻 */
.tabbar { padding: 8px 10px 6px; }
.tabbar-inner { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 4px 8px; text-decoration: none; border-radius: 10px;
  color: var(--text-secondary); transition: var(--transition);
}
.tabbar a:hover { background: var(--bg); color: var(--primary); }
/* 后台把某一格设成隐藏时靠这条收掉：上面 `.tabbar a` 写了 display:flex，
   优先级压得住浏览器默认的 [hidden]{display:none}，所以少了这一行那一格只是"看不见"却还占位。
   列数由 app.js 按 logic.js 的 navGridStyle 同步改写，两半缺一都会露出空白。 */
.tabbar a[hidden] { display: none; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tabbar span { font-size: 12.5px; font-weight: 600; letter-spacing: .5px; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on svg { stroke: var(--gold); }
.tabbar a.on::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%);
  width: 22px; height: 2px; border-radius: 2px; background: var(--gold);
}
/* 导航角标：贴在图标右上角，0 条时整个节点 hidden 不占位 */
.tab-badge {
  position: absolute; top: 5px; right: 50%; margin-right: -22px; min-width: 16px; padding: 0 4px;
  font-size: 10px; line-height: 15px; font-weight: 700; text-align: center; font-style: normal;
  color: var(--on-primary); background: var(--danger); border-radius: 999px;
}

main#app { flex: 1; width: 100%; max-width: var(--app-max); margin: 0 auto; padding: var(--app-pad); }

.footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 18px var(--app-pad) calc(18px + env(safe-area-inset-bottom));
  /* 页脚也收到内容列里：宽屏上正文那一叠块封顶 520，而这一条原本铺满整屏，
     于是页脚那两行字的可用宽度比上面每一块都宽出一截——同一页上下不同宽，正是本轮要消掉的东西。
     左右内距与 `main#app` 同一个数，所以落笔的文本边缘和正文卡片的文本边缘对在同一条线上。 */
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
}

/* 页脚备案行：内容取自后台「系统管理 → 项目配置」。一条都没配时 #siteBeian 整块 hidden，
   所以这里不写 min-height 也不写边框——留白会让访客以为"这站没备案"，而真相只是"还没填"。
   纵向排列：备案号是要逐字核对、整段复制的串，横向连着排时窄屏一换行断点就落在编号中间。 */
.footer-note { line-height: 1.7; }
.footer-beian {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; margin-top: 8px; line-height: 1.6;
}
.footer-beian a, .footer-beian span { color: inherit; }
.footer-beian a {
  text-decoration: none; border-bottom: 1px dashed var(--border); padding-bottom: 1px;
}
.footer-beian a:hover { color: var(--primary); border-bottom-color: currentColor; }
/* 一条备案号占一行：图与文字在这一行里横向并排、垂直居中 */
.fb-line { display: flex; align-items: center; gap: 6px; }
/* 备案标识图：图在前、可复制的编号文字在后，共用同一行，所以多一枚图不会把页脚顶高一截。
   高度按 em 走而不是硬编码像素——它得跟着页脚那 11.5px 的字缩，手机上和宽屏上都是"和这行字一般高"。
   官方标识多是白底矩形，给一层卡片底色与细边，浅色页脚上就不像临时贴进来的截图。 */
.fb-badge {
  height: 1.7em; width: auto; object-fit: contain; padding: 0 3px;
  background: var(--card); border: 1px solid var(--border); border-radius: 4px;
}

/* ---------- 卡片与通用 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(74, 47, 22, .07);
  padding: var(--card-pad);
  margin-bottom: 14px;
  transition: var(--transition);
}
.card-title {
  /* 标题左侧那道"经线"：一条从上金到下褐的渐变竖线，代替原来那截纯色条 */
  font-family: var(--font-song);
  font-size: 15.5px; font-weight: 700; letter-spacing: 1px;
  padding-left: 12px;
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, var(--gold-light), var(--gold) 38%, var(--primary)) 1;
  margin-bottom: 12px;
}
.hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.badge-opt {
  font-size: 11px; font-weight: 400; color: var(--warning);
  background: var(--warning-wash); border: 1px solid var(--warning-line); border-radius: 999px; padding: 1px 8px; margin-left: 6px;
}

.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font: 500 14px/1 inherit; padding: 12px 20px; border-radius: 8px;
  transition: var(--transition); font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: inset 0 -2px 0 rgba(43, 28, 18, .3); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--primary); border-color: var(--line-input); }
.btn-ghost:hover { background: var(--wash-hover); }
.btn-block { width: 100%; }
.row-actions { display: flex; gap: 10px; margin-top: 14px; }
.row-actions .btn { flex: 1; }

.input {
  width: 100%; padding: 11px 12px; font: 14px inherit; font-family: inherit;
  border: 1px solid var(--line-input); border-radius: 8px; color: var(--text);
  background: var(--paper-0); transition: var(--transition);
}
.input:focus { outline: 3px solid var(--gold-ink); outline-offset: 2px; }

/* ---------- 首页 ---------- */
.hero { padding: 26px 22px; position: relative; overflow: hidden; }
/* 首页右上那两笔：一枚虚线有机轮廓 + 一道极淡的舌形暖晕。
   它们只是压角的底纹，所以 pointer-events 关掉、层级压在正文之下，reduced-motion 下本来就是静态。 */
.hero::before {
  content: ""; position: absolute; z-index: 0; right: -30px; top: -34px;
  width: 148px; height: 148px; border: 2px dashed var(--gold);
  border-radius: 52% 48% 44% 56% / 46% 54% 46% 54%;
  opacity: .14; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; z-index: 0; right: 8px; top: 6px;
  width: 78px; height: 100px;
  border-radius: 50% 50% 46% 54% / 64% 64% 36% 36%;
  background: radial-gradient(120% 120% at 32% 18%, var(--gold-light), transparent 62%);
  opacity: .16; pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: 1.6px; color: var(--gold-ink); margin-bottom: 8px; }
.hero-title { font-family: var(--font-song); font-size: 24px; font-weight: 700; letter-spacing: 1.5px; line-height: 1.4; }
.hero-desc { color: var(--text-secondary); margin: 10px 0 18px; }
.home-links { display: flex; gap: 16px; margin-top: 12px; }
.home-links a { font-size: 13.5px; color: var(--primary); text-decoration: none; border-bottom: 1px dashed var(--gold-ink); padding-bottom: 1px; }
.home-links a:hover { color: var(--gold-ink); }
.home-links a[hidden] { display: none; }
#homeUploaderBox { margin-top: 4px; }
#homeTongueMsg { margin-top: 4px; }
#homeTongueMsg:empty { margin-top: 0; }

/* ---------- 首页推荐产品 ---------- */
.reco-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reco-card { display: block; text-decoration: none; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--paper-0); transition: var(--transition); }
.reco-card:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.reco-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.reco-card .reco-noimg { width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; color: var(--text-muted); font-size: 11.5px; background: var(--paper-2); }
.reco-card b { display: block; font-size: 12.5px; font-weight: 500; color: var(--text); padding: 7px 8px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- 问卷 ---------- */
/* 精简/完整双量表：整行分段控件，两等分便于拇指点按 */
.quiz-form-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 8px; background: var(--paper-2); border: 1px solid var(--border); border-radius: 12px; }
.qf-tab {
  flex: 1; min-height: 42px; padding: 9px 0; border: 0; border-radius: 9px; cursor: pointer; user-select: none;
  font-family: inherit; font-size: 13.5px; letter-spacing: .3px; color: var(--text-secondary);
  background: transparent; transition: var(--transition);
}
.qf-tab:hover { color: var(--primary); }
.qf-tab.on { background: linear-gradient(180deg, var(--primary), var(--primary-hover)); color: var(--on-primary); font-weight: 500; box-shadow: 0 2px 8px rgba(74, 47, 22, .22); }
.qf-note { margin: 0 0 12px; font-size: 11.5px; line-height: 1.7; letter-spacing: .2px; color: var(--text-muted); text-align: center; }
.quiz-head { margin-bottom: 14px; }
.progress { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--gold)); border-radius: 999px; transition: var(--transition); }
.progress-text { font-size: 12px; color: var(--text-secondary); margin-top: 6px; text-align: right; }
.q-card { animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.q-item { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.q-item:last-child { border-bottom: none; }
.q-text { font-weight: 500; margin-bottom: 8px; }
.q-dim { font-size: 11px; color: var(--text-muted); letter-spacing: .4px; margin-left: 6px; }
.opts { display: flex; gap: 6px; }
.opt {
  flex: 1; padding: 9px 0; text-align: center; cursor: pointer;
  font-size: 12.5px; color: var(--text-secondary);
  background: var(--paper-0); border: 1px solid var(--border); border-radius: 6px;
  transition: var(--transition); user-select: none;
}
.opt:hover { border-color: var(--primary-light); }
.opt.sel { background: var(--success-wash); border-color: var(--success); color: var(--success); font-weight: 500; }
.quiz-foot { display: flex; gap: 10px; margin-top: 4px; }
.quiz-foot .btn { flex: 1; }
/* 跳过入口是纸面上的 13px 小字：--primary-light 在宣纸上只有 3.5:1（它是描边/渐变用的图形色），文字一律降到 --primary。 */
.quiz-skip { flex: 2; align-self: center; text-align: center; font-size: 13px; color: var(--primary); cursor: pointer; letter-spacing: .2px; }
.quiz-skip:hover { color: var(--gold-ink); }
.mode-note { font-size: 13px; color: var(--text-secondary); line-height: 1.9; }
.mode-note .btn { display: block; margin-top: 10px; width: 100%; }

/* ---------- 舌象上传 ---------- */
.shoot-tips { padding-left: 18px; color: var(--text-secondary); font-size: 13px; margin-bottom: 12px; }
.shoot-tips li { margin: 2px 0; }
.uploader {
  border: 1.5px dashed var(--line-input); border-radius: 12px; background: var(--paper-0);
  padding: 14px 12px 12px; color: var(--text-secondary);
}
.viewfinder {
  position: relative; width: min(72%, 250px); aspect-ratio: 5 / 6; margin: 0 auto;
  border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, var(--paper-0), var(--paper-1));
}
.vf-outline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.vf-tongue { fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-dasharray: 8 7; opacity: .9; }
.vf-groove { fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-dasharray: 3 7; opacity: .55; }
.vf-corner { position: absolute; width: 22px; height: 22px; border: 2.5px solid var(--primary-light); }
.vf-tl { top: 9px; left: 9px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.vf-tr { top: 9px; right: 9px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.vf-bl { bottom: 9px; left: 9px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.vf-br { bottom: 9px; right: 9px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.vf-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.vf-btn { flex: 1 1 0; max-width: 158px; font-size: 14px; padding: 8px 10px; }
.vf-caption { font-size: 12.5px; color: var(--text-secondary); text-align: center; margin: 9px 0 0; }
/* ---------- 实时取景（人脸识别式）：椭圆窗内是上传范围，窗外压暗只是视觉引导 ----------
 *  层级纪律与旧圈选层同一条：不写 z-index（底部注册引导层的遮罩要能盖住一切弹层），
 *  靠 DOM 顺序参与堆叠；窗外压暗用椭圆环的 box-shadow 外扩实现，不引入第二个遮罩元素。 */
.live-view {
  position: fixed; inset: 0; background: #101010;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 14px;
}
.live-view[hidden] { display: none; }
.lv-stage {
  position: relative; border-radius: 14px; overflow: hidden; background: #000;
}
.lv-video { display: block; width: 100%; height: 100%; object-fit: contain; }
.lv-video.mirror { transform: scaleX(-1); }
/* 窗外用完全不透明的浅灰（与成图填充同色），让预览就是最终上传的那一块，
   而不是半透明黑罩——半透明会让用户以为窗外的内容也会被带进分析。 */
.lv-ellipse {
  position: absolute; border: 2.5px solid rgba(255, 255, 255, .88); border-radius: 50%;
  box-shadow: 0 0 0 9999px #c8c8c8, inset 0 0 0 2px rgba(0, 0, 0, .25);
  pointer-events: none;
}
.lv-tip {
  position: absolute; left: 0; right: 0; bottom: 8%; margin: 0; text-align: center;
  font-size: 13.5px; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); pointer-events: none;
}
.lv-error { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; padding: 20px; background: #101010; }
.lv-error-msg { margin: 0; font-size: 14px; color: #eee; text-align: center; }
.lv-bar { display: flex; align-items: center; justify-content: space-between; width: min(100%, 360px); }
.lv-side { min-width: 64px; padding: 8px 12px; font-size: 14px; color: #eee; background: rgba(255, 255, 255, .12); border: 0; border-radius: 999px; }
.lv-shutter {
  width: 64px; height: 64px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .28); padding: 0;
}
.lv-shutter:active { background: rgba(255, 255, 255, .55); }

/* 拍摄失败弹窗：原因与建议分开，关掉即可重拍 */
.te-mask {
  position: fixed; inset: 0; z-index: 57; display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(24, 15, 8, .58);
}
.te-mask[hidden] { display: none; }
.te-sheet {
  width: min(100%, 380px); padding: 20px; border-radius: 16px; background: var(--paper-0);
  box-shadow: 0 16px 40px rgba(46, 26, 14, .28);
}
.te-title { font-size: 17px; font-weight: 700; color: var(--primary); margin-bottom: 14px; }
.te-row { margin-bottom: 12px; }
.te-row b { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.te-row p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text); }
.wb-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.wb-ref { font-size: 13px; color: var(--primary); cursor: pointer; border-bottom: 1px dashed var(--gold); }
.wb-ref:hover { color: var(--gold-ink); }
.wb-view { font-size: 13px; color: var(--text-secondary); text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.wb-view:hover { border-color: var(--gold); color: var(--gold-ink); }
.chip.wb { background: var(--water-wash); color: var(--water-ink); border-color: var(--water-line); }
.tongue-result { margin-top: 12px; }
.tongue-result .fail { color: var(--danger); background: var(--danger-wash); border: 1px solid var(--danger-line); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.tongue-result .pass { background: var(--success-wash); border: 1px solid var(--success-line); border-radius: 8px; padding: 12px; }
.chip {
  display: inline-block; font-size: 12px; margin: 3px 4px 3px 0; padding: 3px 10px;
  border-radius: 999px; background: var(--wash-hover); color: var(--primary); border: 1px solid var(--border);
}
.chip.warn { background: var(--warning-wash); color: var(--warning); border-color: var(--warning-line); }
.explain-list { font-size: 12.5px; color: var(--text-secondary); margin-top: 8px; padding-left: 16px; }

/* ---------- 报告 ---------- */
.report-head { text-align: center; padding: 22px 16px; }
.report-headline { font-size: 17px; font-weight: 600; line-height: 1.6; }
.report-primary {
  display: inline-block; margin-top: 10px; padding: 6px 18px;
  background: var(--primary); color: var(--on-primary); border-radius: 999px;
  font-size: 14px; letter-spacing: 2px;
}
.report-secondary { margin-top: 10px; font-size: 12.5px; color: var(--text-secondary); }
.report-scale-note { margin-top: 6px; font-size: 11.5px; line-height: 1.7; color: var(--text-muted); }
canvas.radar { display: block; margin: 0 auto; max-width: 100%; }
.verdict-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.verdict-table th { font-weight: 500; color: var(--text-muted); font-size: 11.5px; letter-spacing: .4px; text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.verdict-table td { padding: 8px 4px; border-bottom: 1px dashed var(--paper-2); }
.verdict-table tr:last-child td { border-bottom: none; }
.lv { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; }
.lv-yes { background: var(--danger-wash); color: var(--danger); }
.lv-tend { background: var(--warning-wash); color: var(--warning); }
.lv-basic { background: var(--warning-wash); color: var(--warning); }
.lv-ok { background: var(--success-wash); color: var(--success); }
.scorebar { display: inline-block; height: 5px; background: var(--border); border-radius: 999px; width: 90px; vertical-align: middle; overflow: hidden; }
.scorebar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.advice-block { margin-bottom: 4px; }
.advice-block h4 {
  font-size: 13px; font-weight: 600; color: var(--primary);
  margin: 12px 0 6px; padding-left: 8px; border-left: 3px solid var(--gold-light);
}
.advice-block ul { padding-left: 18px; font-size: 13px; color: var(--text-secondary); }
.advice-block li { margin: 3px 0; }
.oil-safety {
  margin-top: 14px; background: var(--paper-0); border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px;
}
.oil-safety-title { font-size: 12.5px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.oil-safety ul { padding-left: 16px; margin: 0; }
.oil-safety li { font-size: 12px; color: var(--text-secondary); line-height: 1.8; margin: 2px 0; }
.tongue-corrob { font-size: 12.5px; color: var(--text-secondary); }
.disclaimer {
  font-size: 12px; color: var(--text-secondary); background: var(--paper-0);
  border-left: 3px solid var(--gold); padding: 10px 12px; border-radius: 0 8px 8px 0;
  line-height: 1.85; margin-top: 10px;
}
.report-tags { margin-top: 8px; }
.sub-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.sub-tab {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text-secondary); transition: var(--transition);
}
.sub-tab.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* ---------- 历史 ---------- */
.hist-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 10px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; transition: var(--transition); background: var(--paper-0);
}
.hist-item:hover { border-color: var(--primary-light); background: var(--wash-hover); }
.hist-main b { font-size: 14px; font-weight: 600; }
.hist-main span { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.hist-right { text-align: right; }
.hist-empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 20px 0; }

/* ---------- 加载遮罩 ---------- */
.loading-mask {
  position: fixed; inset: 0; background: rgba(43, 28, 18, .5);
  display: grid; place-items: center; gap: 12px; z-index: 50;
  color: var(--on-primary); font-size: 13px; align-content: center;
}
.spinner {
  width: 34px; height: 34px; margin: 0 auto 10px;
  border: 3px solid rgba(251, 246, 236, .3); border-top-color: var(--gold-light);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: var(--ink); color: var(--on-primary); font-size: 13px;
  padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow-lg);
  /* 吸底操作栏是 z-index:20 的常驻条，提示必须压在它之上，否则下单反馈会被遮住 */
  z-index: 60; animation: fadein .2s ease;
  max-width: 86vw;
}

@media (max-width: 400px) {
  .opts { flex-wrap: wrap; }
  .opt { flex: 1 0 44%; }
}

/* ---------- 穴位手册 ---------- */
.acu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 10px; }
.acu-item {
  display: block; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; background: var(--paper-0); transition: var(--transition);
}
.acu-item:hover { border-color: var(--gold); }
.acu-item b { font-size: 14.5px; color: var(--primary); margin-right: 4px; }
.acu-item .acu-mer { font-size: 10.5px; color: var(--text-muted); }
.acu-item i {
  display: block; font-style: normal; font-size: 11px; color: var(--text-secondary); margin-top: 4px; line-height: 1.6;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.acu-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.acu-name { font-size: 20px; font-weight: 700; color: var(--primary); letter-spacing: 1px; }
.acu-mer { font-size: 12px; color: var(--gold-ink); margin-left: 8px; }
.acu-back { font-size: 12.5px; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.acu-back:hover { color: var(--primary); }
.sec-title { font-size: 13.5px; color: var(--primary); margin: 16px 0 6px; padding-left: 8px; border-left: 3px solid var(--gold); }
.sec-text { font-size: 13px; color: var(--text); }
.press-list { padding-left: 18px; font-size: 13px; }
.press-list li { margin-bottom: 4px; }
.tool-row { margin-top: 4px; }
.chip.tool { background: var(--warning-wash); color: var(--warning); border-color: var(--warning-line); text-decoration: none; }
.chip.tool:hover { background: var(--warning-wash); }
.acu-tips { margin-top: 14px; background: var(--danger-wash); border: 1px solid var(--danger-line); border-radius: 10px; padding: 10px 12px; }
.acu-tips p { font-size: 12.5px; color: var(--danger); }
.acu-link { color: var(--primary); font-weight: 600; text-decoration: none; border-bottom: 1px dashed var(--gold); }
.acu-link:hover { color: var(--gold-ink); }

/* ---------- 人体穴位图（写实底图：暖褐描边 + 金色经络光点） ---------- */
/* 穴位位置图：宽度 = 页面内容宽度的 70%。卡片有内边距，所以容器用负 margin 抵消，
   让 70% 按卡片（= 页面内容列）宽度计算而不是按卡片内容盒计算。
   高度不写死：svg 带 viewBox + width:100% + height:auto，浏览器按 viewBox 比例等比缩放。 */
.body-maps { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 6px calc(var(--card-pad) * -1) 0; }
.body-fig { flex: 0 0 70%; max-width: 70%; text-align: center; margin: 0; }
.body-fig figcaption { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
svg.bodymap { width: 100%; height: auto; border: 1px solid var(--map-frame); border-radius: 12px; box-shadow: 0 6px 18px rgba(66, 38, 18, .3); }
.map-cap { font-size: 9px; fill: rgba(233, 206, 172, .85); }
.meridian { fill: none; stroke: #f2c879; stroke-width: 1.3; stroke-linecap: round; opacity: .85; }
.acu-dot { cursor: pointer; }
.acu-dot .d-core { fill: #ffd98f; stroke: rgba(255, 255, 255, .4); stroke-width: .7; }
.acu-dot .d-glow { fill: rgba(255, 205, 120, .16); }
.acu-dot:hover .d-core { fill: #fff3d6; }
.acu-dot.on { cursor: default; }
.acu-dot.on .d-core { fill: #fff8e2; stroke: #ffcf70; stroke-width: 1.2; }
.acu-dot.on .d-orb { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { opacity: .95; } 50% { opacity: .45; } 100% { opacity: .95; } }
.dot-label { font-size: 11px; font-weight: 700; fill: #ffe9bd; paint-order: stroke; stroke: rgba(40, 22, 10, .85); stroke-width: 3px; }
@media (prefers-reduced-motion: reduce) { .acu-dot.on .d-orb { animation: none; } }

/* ---------- 手册页大图：点选光点 ↔ 列表条目联动 ---------- */
.acu-item.sel {
  border-color: var(--primary); background: var(--warning-wash);
  box-shadow: 0 0 0 2px rgba(168, 118, 42, .4); animation: acu-pop .9s ease;
}
@keyframes acu-pop { 0%, 40% { background: var(--wash-hover); } 100% { background: var(--warning-wash); } }
@media (prefers-reduced-motion: reduce) { .acu-item.sel { animation: none; } }
.acu-map-off { font-size: 10.5px; color: var(--text-muted); line-height: 1.6; margin-top: 3px; }

/* ---------- 取穴局部放大图（底图真放大 + 骨度分寸刻度 + 距离标注） ----------
   svg 用固定尺寸的视图框（横 320x240 / 竖 240x320，随标注点形状二选一），
   标注字号因此恒定；max-width 兜住显示宽度，避免把 700px 宽的底图裁窗放大到
   2 倍以上糊成一片。 */
.acu-zoom-fig { margin: 10px 0 2px; }
svg.acu-zoom {
  display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto;
  border: 1px solid var(--map-frame); border-radius: 12px; box-shadow: 0 6px 18px rgba(66, 38, 18, .3);
  background: var(--map-bg);
}
svg.acu-zoom text { font-family: inherit; }
.zl-ref { fill: none; stroke: #ffe9bd; stroke-width: 1.6; }
.zl-ref-text { font-size: 11px; fill: #ffeed0; paint-order: stroke; stroke: rgba(30, 16, 6, .9); stroke-width: 3.2; }
.zl-ruler { stroke: #7fe3c4; stroke-width: 1.4; stroke-linecap: round; opacity: .95; }
.zl-ruler.run { stroke: #ffd27a; stroke-width: 3; opacity: 1; }
.zl-mark { fill: #ffd27a; stroke: rgba(30, 16, 6, .8); stroke-width: 1; }
.zl-zero { font-size: 11px; font-weight: 700; fill: #7fe3c4; paint-order: stroke; stroke: rgba(30, 16, 6, .9); stroke-width: 3.2; }
.zl-at { font-size: 12px; font-weight: 800; fill: #ffe3ad; paint-order: stroke; stroke: rgba(30, 16, 6, .92); stroke-width: 3.4; }
.zl-tick { stroke: #7fe3c4; stroke-width: 1.4; }
.zl-tick.half { stroke-width: .9; opacity: .8; }
.zl-link { stroke: #fff2cf; stroke-width: 1.6; stroke-dasharray: 5 3; }
.zl-link-text {
  font-size: 12px; font-weight: 700; fill: var(--paper-0);
  paint-order: stroke; stroke: rgba(30, 16, 6, .92); stroke-width: 3.6;
}
.zl-core { fill: #fff8e2; stroke: #ffcf70; stroke-width: 1.4; }
/* 手指比量的手是一张烘好的照片 tile（.zl-hand 的 <image>），像素里已带肤色与接触影，
   这里不再需要任何描边配色——旧的多趟皮筒规则随程序化手形一起删除。 */
.zl-name {
  font-size: 13px; font-weight: 800; fill: #fff3d6;
  paint-order: stroke; stroke: rgba(30, 16, 6, .95); stroke-width: 3.6;
}
.acu-zoom-fig figcaption { margin: 8px auto 0; max-width: 460px; }
.az-lead { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin: 0 0 3px; }
.az-measure { font-size: 13px; line-height: 1.6; color: var(--text); margin: 0 0 7px; }
.az-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.az-chip {
  font-size: 11.5px; line-height: 1.5; color: var(--success); background: var(--success-wash);
  border: 1px solid var(--success-line); border-radius: 8px; padding: 3px 8px;
}
.az-note { font-size: 11.5px; color: var(--text-muted); margin: 7px 0 0; line-height: 1.5; }
.az-src { margin-top: 6px; font-size: 11.5px; color: var(--text-muted); }
.az-src summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.az-src p { margin: 5px 0 0; line-height: 1.6; }

/* ---------- 产品展示 ---------- */
.cat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prod-card {
  display: block; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--paper-0); text-decoration: none; color: var(--text); transition: var(--transition);
}
.prod-card:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.prod-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--paper-2); }
.prod-noimg { width: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; background: var(--paper-2); color: var(--text-muted); font-size: 12px; }
.prod-card b { display: block; font-size: 13.5px; padding: 8px 10px 0; }
.prod-card i {
  display: block; font-style: normal; font-size: 11px; color: var(--text-muted); padding: 2px 10px; min-height: 22px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prod-price { display: block; color: var(--danger); font-weight: 700; font-size: 14px; padding: 0 10px 9px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.spec-table th { text-align: left; color: var(--text-muted); font-weight: 400; padding: 5px 10px 5px 0; white-space: nowrap; vertical-align: top; }
.spec-table td { color: var(--text); padding: 5px 0; }
.rich-text { font-size: 13.5px; line-height: 1.9; }
.rich-text h3 { font-size: 15px; margin: 12px 0 4px; color: var(--primary); }
.rich-text ul { padding-left: 18px; }
.rich-text p { margin: 6px 0; }

/* ---------- 后台 App Shell（左栏 + 顶栏 + 内容区，响应式） ---------- */
body.adm-mode { height: 100vh; overflow: hidden; }
body.adm-mode .topbar, body.adm-mode .footer, body.adm-mode .tabbar { display: none; }
body.adm-mode main#app { flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0; padding: 0; overflow: hidden; }
/* 高度链必须逐层传递：#view-admin 若保持 auto，.adm-shell 的 height:100% 就退化成 auto，
   外壳被内容撑到无限高后 main 的 overflow:hidden 直接裁掉，内容区永远等不到有界高度、出不了滚动条。 */
body.adm-mode #view-admin { height: 100%; }
.adm-shell { display: flex; height: 100%; background: var(--adm-canvas); color: var(--text); font-size: 13px; }
.adm-shell .card { border-color: var(--border); box-shadow: var(--shadow); }

.adm-side {
  flex: none; width: 226px; background: var(--adm-side); color: var(--adm-side-text);
  display: flex; flex-direction: column; z-index: 50;
  transition: width .22s cubic-bezier(.4, 0, .2, 1), transform .22s cubic-bezier(.4, 0, .2, 1);
}
.adm-brand { display: flex; align-items: center; gap: 9px; padding: 15px 14px 11px; color: #eef4f6; }
.adm-brand-mark {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--gold); border-radius: 8px; color: var(--gold-light); font-size: 15px;
}
.adm-brand-text { font-size: 13.5px; font-weight: 600; letter-spacing: 1px; white-space: nowrap; min-width: 0; }
/* 站名是运营可改的任意串（上限 40 字），侧栏只有 226px：让它自己截断，不把侧栏撑宽 */
.adm-brand-text .site-name { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.adm-brand-text i { display: block; font-size: 9.5px; font-style: normal; letter-spacing: 2.5px; color: var(--adm-side-dim); }
.adm-me { display: flex; align-items: center; gap: 9px; padding: 0 14px 12px; }
.adm-avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--adm-side-2);
  display: grid; place-items: center; color: var(--gold-light); font-size: 13px;
}
.adm-me-text { min-width: 0; }
.adm-me-text b { display: block; font-size: 12.5px; font-weight: 600; color: #e8eef1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-online { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-style: normal; color: var(--adm-ok); }
.adm-online i { width: 6px; height: 6px; border-radius: 50%; background: var(--adm-ok); box-shadow: 0 0 0 3px rgba(63, 167, 124, .2); }
.adm-search { position: relative; display: block; margin: 0 12px 10px; }
.adm-search input {
  width: 100%; padding: 7px 30px 7px 10px; border-radius: 8px; font-size: 12px; font-family: inherit;
  border: 1px solid rgba(255, 255, 255, .09); background: var(--adm-side-2); color: #e8eef1; outline: none;
}
.adm-search input::placeholder { color: var(--adm-side-dim); }
.adm-search input:focus { border-color: var(--gold); }
.adm-search svg { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; fill: none; stroke: var(--adm-side-dim); stroke-width: 1.8; pointer-events: none; }
.adm-nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 8px 18px; }
.adm-nav svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.adm-item, .adm-ghead, .adm-sub a {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border-radius: 8px;
  color: var(--adm-side-text); text-decoration: none; font-size: 12.5px; text-align: left; cursor: pointer;
  background: none; border: none; font-family: inherit; transition: var(--transition);
}
.adm-item:hover, .adm-ghead:hover, .adm-sub a:hover { background: var(--adm-hover); color: #f2f7f9; }
.adm-item.on, .adm-sub a.on { background: var(--adm-active); color: #ffffff; box-shadow: inset 3px 0 0 var(--gold); }
.adm-item > span, .adm-ghead > span, .adm-sub a > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-tag { flex: none; font-size: 9.5px; line-height: 1.6; font-weight: 600; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #22303a; }
.adm-ghead { margin-top: 6px; color: var(--adm-side-dim); font-weight: 600; }
.adm-caret {
  flex: none; width: 7px; height: 7px; margin-left: auto; border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .2s;
}
.adm-group.open .adm-caret { transform: rotate(45deg); }
.adm-sub { display: none; margin-left: 15px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .08); }
.adm-group.open .adm-sub { display: block; }
.adm-sub a { padding: 8px 9px; font-size: 12px; }
.adm-sub a svg { width: 15px; height: 15px; }
.adm-mask { position: fixed; inset: 0; background: rgba(9, 26, 33, .46); z-index: 45; }

/* 折叠为图标栏（宽/中屏由 ☰ 切换） */
body.adm-rail .adm-side { width: 62px; }
body.adm-rail .adm-brand { justify-content: center; padding: 15px 0 11px; }
body.adm-rail .adm-me { justify-content: center; }
body.adm-rail .adm-brand-text, body.adm-rail .adm-me-text, body.adm-rail .adm-search,
body.adm-rail .adm-item > span, body.adm-rail .adm-ghead > span, body.adm-rail .adm-sub a > span,
body.adm-rail .adm-tag, body.adm-rail .adm-caret { display: none; }
body.adm-rail .adm-item, body.adm-rail .adm-ghead, body.adm-rail .adm-sub a { justify-content: center; padding: 10px 0; }
body.adm-rail .adm-ghead { margin-top: 4px; pointer-events: none; }
body.adm-rail .adm-sub { display: block; margin: 0; padding: 0; border-left: none; }
body.adm-rail .adm-group { border-top: 1px solid rgba(255, 255, 255, .07); margin-top: 6px; padding-top: 4px; }

.adm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.adm-head {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 52px;
  background: var(--card); border-bottom: 1px solid var(--border);
}
.adm-iconbtn { width: 32px; height: 32px; flex: none; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text-secondary); display: grid; place-items: center; cursor: pointer; }
.adm-iconbtn:hover { border-color: var(--gold); color: var(--primary); }
.adm-iconbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.adm-crumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-muted); min-width: 0; }
.adm-crumb i { font-style: normal; opacity: .5; }
.adm-crumb b { color: var(--text); font-weight: 600; white-space: nowrap; }
.adm-head-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.adm-hbtn { font-size: 12px; color: var(--text-secondary); text-decoration: none; border: 1px solid var(--border); border-radius: 8px; padding: 4px 11px; background: var(--card); cursor: pointer; font-family: inherit; white-space: nowrap; }
.adm-hbtn:hover { color: var(--primary); border-color: var(--gold); }
.adm-topuser { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.adm-topuser::before { content: "管"; display: inline-block; width: 24px; height: 24px; border-radius: 50%; background: var(--adm-side); color: var(--gold-light); vertical-align: middle; margin-right: 6px; text-align: center; line-height: 24px; font-size: 11px; }
.adm-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 44px; scrollbar-width: thin; scrollbar-color: #b9c6cc transparent; }
/* Windows/Linux 默认是悬浮式细条，用户会以为页面不能滚；显式画一条常驻轨道 */
.adm-scroll::-webkit-scrollbar { width: 11px; }
.adm-scroll::-webkit-scrollbar-track { background: var(--adm-canvas); }
.adm-scroll::-webkit-scrollbar-thumb { background: #b9c6cc; border: 3px solid var(--adm-canvas); border-radius: 999px; }
.adm-scroll::-webkit-scrollbar-thumb:hover { background: #93a6ae; }
.adm-pagehead { margin-bottom: 13px; }
.adm-pagehead h2 { font-size: 17px; font-weight: 700; color: var(--primary); letter-spacing: .5px; }
.adm-pagehead p { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.adm-pane .card { margin-bottom: 12px; }
.adm-tablewrap { overflow-x: auto; }

/* 控制台：统计卡 / 趋势图 / 指标 / 渐变块 */
.adm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.adm-stat { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 15px; box-shadow: var(--shadow); }
.adm-ico { width: 42px; height: 42px; flex: none; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.adm-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.adm-ico.a1 { background: #163c4c; }
.adm-ico.a2 { background: #b49a68; }
.adm-ico.a3 { background: #23766b; }
.adm-ico.a4 { background: #4a6b8a; }
.adm-stat b { display: block; font-size: 22px; line-height: 1.25; color: var(--text); }
.adm-stat span { font-size: 11.5px; color: var(--text-muted); }
.adm-split { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.adm-panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 16px; box-shadow: var(--shadow); }
.adm-panel-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.adm-panel-head em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 400; color: var(--text-muted); }
.adm-legend { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 400; color: var(--text-muted); }
.adm-legend::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--success); }
.adm-chart { width: 100%; height: auto; display: block; }
.adm-chart .grid { stroke: #e6ecef; stroke-width: 1; }
.adm-chart .axis { stroke: #d5dfe4; stroke-width: 1; }
.adm-chart .line { fill: none; stroke: var(--success); stroke-width: 2; stroke-linejoin: round; }
.adm-chart .area { fill: rgba(35, 118, 107, .09); stroke: none; }
.adm-chart .dot { fill: var(--card); stroke: var(--success); stroke-width: 2; }
.adm-chart text { font-size: 10px; fill: var(--text-muted); }
.adm-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.adm-metric { display: flex; align-items: center; gap: 9px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.adm-metric .adm-ico { width: 27px; height: 27px; border-radius: 8px; background: #eaf3f0; color: var(--success); }
.adm-metric .adm-ico svg { width: 15px; height: 15px; }
.adm-metric b { font-size: 15px; line-height: 1.2; color: var(--text); }
.adm-metric span { display: block; font-size: 11px; color: var(--text-muted); }
.adm-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.adm-tile { position: relative; border-radius: 12px; padding: 14px 16px 15px; color: #fff; box-shadow: var(--shadow); }
.adm-tile h4 { font-size: 12.5px; font-weight: 500; opacity: .93; }
.adm-tile em { position: absolute; right: 12px; top: 12px; font-style: normal; font-size: 10px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .22); }
.adm-tile .nums { display: flex; gap: 20px; margin: 12px 0 10px; flex-wrap: wrap; }
.adm-tile .nums > div b { display: block; font-size: 21px; line-height: 1.2; }
.adm-tile .nums > div span { font-size: 10.5px; opacity: .88; }
.adm-tile .foot { display: flex; align-items: center; gap: 6px; font-size: 11px; opacity: .92; border-top: 1px solid rgba(255, 255, 255, .2); padding-top: 8px }
.adm-tile .foot svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.adm-tile.t1 { background: linear-gradient(135deg, #1b4b5f, #2f7ea0); }
.adm-tile.t2 { background: linear-gradient(135deg, #1f7a63, #4fbf9a); }
.adm-tile.t3 { background: linear-gradient(135deg, #55508f, #8b84c4); }
.adm-tile.t4 { background: linear-gradient(135deg, #a8763c, #d9b073); }
.adm-empty { padding: 26px 12px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.adm-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 中屏：内容区优先，侧栏收窄 */
@media (max-width: 1079px) {
  .adm-stats, .adm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-split { grid-template-columns: minmax(0, 1fr); }
}
/* 窄屏：侧栏变抽屉，由 ☰ 拉出，图标 + 文字导航 */
@media (max-width: 760px) {
  .adm-side { position: fixed; top: 0; bottom: 0; left: 0; width: 232px; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.adm-drawer .adm-side { transform: none; }
  .adm-scroll { padding: 12px 12px 40px; }
  .adm-topuser { display: none; }
  .adm-head { padding: 0 10px; gap: 8px; }
}
@media (max-width: 520px) {
  .adm-stats, .adm-tiles, .adm-metrics { grid-template-columns: minmax(0, 1fr); }
  .adm-hbtn { padding: 4px 8px; }
  .adm-crumb i { display: none; }
  .adm-crumb b { display: none; }
  .adm-crumb b:last-child { display: inline; }
}

/* ---------- 后台管理 ---------- */
.cat-form { display: grid; grid-template-columns: 1.2fr 1fr .6fr auto; gap: 8px; margin-bottom: 10px; max-width: 860px; }
.cat-form-search { grid-template-columns: minmax(0, 1fr) auto auto; max-width: 620px; }
.pf-group + .adm-tablewrap { margin-top: 12px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th { text-align: left; color: var(--text-muted); font-weight: 400; border-bottom: 1px solid var(--border); padding: 6px; }
.admin-table td { border-bottom: 1px solid #eef2f4; padding: 6px; vertical-align: middle; }
.admin-table td.op { text-align: right; white-space: nowrap; }

/* 评论审核：正文保留换行、宿主类型打标、附件按列排 */
.adm-cmt-kind { display: inline-block; font-size: 10.5px; padding: 0 6px; border-radius: 999px; background: #eef4f7; color: var(--text-secondary); margin-right: 4px; vertical-align: 2px; }
.adm-cmt-body { min-width: 240px; max-width: 380px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.adm-cmt-imgs { min-width: 76px; }
.adm-cmt-imgs a { display: block; font-size: 11.5px; color: var(--primary); text-decoration: underline; }
/* 最热一列：名次徽标压在按钮上方，未生效的标记用另一色区分，运营一眼看得出标了却没展示 */
.adm-cmt-hot { min-width: 92px; white-space: nowrap; }
.adm-cmt-hot .lv { margin-bottom: 4px; }
/* 编码列用等宽小徽标（货号要对得上单据）；备注列单行省略，全文挂在 title 上 */
.pd-code {
  display: inline-block; padding: 1px 7px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--adm-canvas); font-family: Consolas, "Courier New", monospace;
  font-size: 11.5px; color: var(--text-secondary); white-space: nowrap;
}
.pd-remark { margin-top: 2px; max-width: 260px; font-size: 11px; line-height: 1.5; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 英文那一行排在中文名下方：填了是次要信息（小字），没填要说清前台会怎样，而不是留一片空白让人猜 */
.pd-en { margin-top: 2px; max-width: 260px; font-size: 11.5px; line-height: 1.5; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-en-miss { font-size: 11px; color: var(--text-muted); }
/* 微信支付页：开关排成一行（四项一组，不换行成阶梯），缺项清单用红底小块堆叠 */
#view-admin .pf-switches { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 2px 0 10px; }
.wx-missing { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.wx-miss {
  display: inline-block; padding: 2px 9px; border: 1px solid #f0cfcf; border-radius: 999px;
  background: #fdf3f2; color: var(--danger); font-size: 11.5px;
}
.wx-warn { color: var(--danger); }
/* 项目配置页的实时预览：三行「前台会长成什么样」，标签列固定宽让值对齐 */
.sp-rows { display: flex; flex-direction: column; gap: 9px; padding: 2px 0 10px; }
.sp-row { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.sp-key { flex: none; width: 76px; font-size: 11.5px; color: var(--text-muted); letter-spacing: .5px; }
.sp-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sp-name { font-size: 14px; font-weight: 600; letter-spacing: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-code { font-family: Consolas, "Courier New", monospace; font-size: 11.5px; color: var(--text-secondary); overflow-wrap: anywhere; }
/* 预览借用前台的 .footer-beian，所以这里把居中对齐掰回左对齐：预览是标签-值版式，不是页脚。
   纵向排之后横向对齐归 align-items 管，justify-content 那一条已经换成方向了 */
.sp-beian { flex: 1; align-items: flex-start; margin-top: 0; }
/* 项目配置页的备案标识图上传位：格子比产品主图小一圈，因为这里只需要认出"传对了没" */
.badge-slot { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.badge-pick {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 108px; padding: 5px 10px; cursor: pointer; transition: var(--transition);
  border: 1px dashed var(--border); border-radius: 8px; background: var(--card);
  font-size: 12px; color: var(--text-secondary);
}
.badge-pick:hover { border-color: var(--gold); background: rgba(180, 154, 104, .06); }
.badge-pick span { font-size: 10.5px; color: var(--text-muted); }
.badge-prev {
  height: 32px; width: auto; object-fit: contain; padding: 1px 4px; cursor: default;
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
}
.badge-held { display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; color: var(--text-secondary); }
.badge-held em { font-style: normal; font-size: 10.5px; color: var(--text-muted); }
/* 号空图在——正常状态而不是错误，所以是灰底中性小块，不借 .wx-miss 那个红 */
.wx-note {
  display: inline-block; padding: 2px 9px; border: 1px solid #e7d6c0; border-radius: 999px;
  background: #f8efe2; color: var(--text-secondary); font-size: 11.5px;
}
/* 打款表单里的合计与两颗按钮排在一条线上：勾选台账行时合计就在眼前改 */
.wx-po-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.wx-po-foot #poTotal { flex: 1; text-align: left; font-size: 12.5px; color: var(--text-secondary); }
.wx-po-form > td { background: #f7fafb; padding: 12px 10px; }
.mini-btn {
  font-size: 11.5px; padding: 3px 10px; border-radius: 7px; cursor: pointer; margin-left: 6px;
  border: 1px solid #e7d6c0; background: #f8efe2; color: var(--primary);
}
.mini-btn.danger { border-color: #f2cfca; background: #fdf2f0; color: var(--danger); }
.mini-btn:hover { filter: brightness(.96); }
.mini-btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
/* 后台表单控件：比前台更紧凑，并统一到冷色描边 */
#view-admin .input { padding: 8px 11px; font-size: 13px; border-color: var(--border); background: var(--card); border-radius: 9px; }
#view-admin .input:focus { border-color: var(--gold); outline-color: rgba(22, 60, 76, .13); }
#view-admin .btn { padding: 9px 20px; font-size: 13px; }
#view-admin .btn-ghost { border-color: var(--border); }
#view-admin .btn-ghost:hover { background: var(--adm-canvas); }
#view-admin .row-actions { justify-content: flex-end; margin-top: 2px; }
#view-admin .row-actions .btn { flex: 0 0 auto; min-width: 118px; }

/* 分组卡片 + 12 栅格 + 标签在上，避免字段随屏宽无限拉伸 */
.prod-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.pf-group { border: 1px solid var(--border); border-radius: 12px; background: var(--card); overflow: hidden; }
.pf-group-head {
  display: flex; align-items: center; gap: 8px; padding: 8px 13px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  background: var(--adm-canvas); border-bottom: 1px solid var(--border);
}
.pf-group-head::before { content: ""; flex: none; width: 3px; height: 13px; border-radius: 2px; background: var(--gold); }
.pf-group-head .pf-sub { font-style: normal; font-weight: 400; font-size: 11px; color: var(--text-muted); }
.pf-group-body { padding: 13px 14px 14px; }
.pf-group-body .cat-form { margin-bottom: 0; }
.pf-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 16px; }
.pf-cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pf-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.pf-label em { font-style: normal; font-size: 10.5px; color: var(--text-muted); }
.pf-label .pf-req { color: var(--danger); }
/* 一键翻译：按钮顶到这一栏标签行的最右，与左侧那行说明分开，避免读成"这就是保存" */
.tr-btn { flex: none; align-self: center; font-size: 11px; padding: 2px 9px; white-space: nowrap; }
.pf-label .tr-btn, .pf-group-head .tr-btn { margin-left: auto; }
/* 分类那一行只有四个格子，英文栏与它的翻译按钮排第二行，列宽沿用上一行 */
.cat-form .cat-en { grid-column: 1 / 4; }
.cat-form .tr-btn { grid-column: 4; justify-self: start; margin-left: 0; }
.pf-hint { font-size: 11px; line-height: 1.6; color: var(--text-muted); }
.pf-c12 { grid-column: span 12; }
.pf-c8 { grid-column: span 8; }
.pf-c6 { grid-column: span 6; }
.pf-c4 { grid-column: span 4; }
.pf-c3 { grid-column: span 3; }
/* 报告推荐那一页的类别格：勾选块一行两件事（名字 + 类别说明），复用 pf 栅格不加新皮肤 */
.rec-cat { cursor: pointer; }
.rec-check { display: flex; align-items: center; gap: 8px; }
.rec-check input { width: 17px; height: 17px; accent-color: var(--primary); flex: 0 0 auto; }
.rec-check i { font-style: normal; color: var(--text-secondary); font-weight: normal; }
.pf-switches { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-check {
  display: flex; align-items: center; gap: 7px; flex: 1 1 138px; min-width: 0;
  padding: 7px 11px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 12.5px; color: var(--text-secondary); cursor: pointer; transition: var(--transition);
}
.pf-check:hover { border-color: var(--gold); }
.pf-check input { flex: none; accent-color: var(--primary); }
.pf-check:has(input:checked) { border-color: var(--gold); background: rgba(180, 154, 104, .09); color: var(--primary); font-weight: 600; }
/* 长文本单元（内部备注）：只允许纵向拉伸，超长网址按字符折行，不撑破 12 栅格 */
.pf-textarea { min-height: 70px; resize: vertical; line-height: 1.65; overflow-wrap: anywhere; font-family: inherit; }

/* ---------- 系统管理 → 导航配置 ---------- */
/* 首页那一格：它没有开关，所以这里刻意不画成一个disabled的下拉框——
   disabled 读起来像"现在不能改，之后能改"，而真实情况是这条路径在库里、接口里都不存在。 */
.nav-locked {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-height: 38px; padding: 0 11px; border: 1px dashed var(--border);
  border-radius: 9px; background: var(--bg);
}
.nav-locked-state { font-size: 12.5px; font-weight: 700; color: var(--primary); }
.nav-locked-note { font-size: 11px; color: var(--text-muted); }
/* 预览条外面这层是"这是一份示意图"的边框感，里面的那条直接复用 .tabbar 的画法 */
.navp-shell { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.navp-shell .navp-bar { max-width: 420px; margin: 0 auto; box-shadow: var(--shadow); }
/* 后台整站把 .tabbar 收掉了（那条真的导航在后台没有用处），所以这里按 id 单独放行一次：
   id 选择器的权重压得过 body.adm-mode .tabbar 那条，不需要给预览再另起一个类名。 */
body.adm-mode #navPreview { display: block; }

#specRows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.spec-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) 30px; gap: 8px; align-items: center; }
.spec-row .mini-btn { width: 30px; height: 30px; margin: 0; padding: 0; font-size: 15px; line-height: 1; }
.spec-add { margin: 10px 0 0; }
#specRows:empty { display: block; }
#specRows:empty::before { content: "暂无规格，点下方「+ 添加规格」新增一行。"; font-size: 12px; color: var(--text-muted); }

.pf-upload { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.img-pick {
  display: grid; place-items: center; width: 132px; height: 112px; text-align: center;
  border: 1px dashed var(--border); border-radius: 10px; padding: 8px;
  font-size: 12.5px; color: var(--text-secondary); cursor: pointer; transition: var(--transition);
}
.img-pick:hover { border-color: var(--gold); background: rgba(180, 154, 104, .06); }
.img-pick span { display: block; margin-left: 0; color: var(--text-muted); font-size: 11px; }
.prod-preview { width: 112px; height: 112px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.pf-upload .pf-hint { flex: 1 1 210px; }
/* 多图缩略条：一行排满自动换行；封面标在左上，序号在右上，两个动作压在图下 */
.img-strip { display: flex; flex-wrap: wrap; gap: 12px; flex: 1 1 260px; }
.img-strip:empty { display: none; }
.img-cell { position: relative; width: 112px; }
.img-cell .prod-preview { width: 112px; height: 112px; display: block; }
.img-cell-cover {
  position: absolute; left: 5px; top: 5px; font-size: 10.5px; color: #fff;
  background: rgba(147, 100, 55, .92); border-radius: 6px; padding: 1px 6px;
}
.img-cell-n {
  position: absolute; right: 5px; top: 5px; font-size: 10.5px; color: #fdf6ee;
  background: rgba(74, 52, 40, .6); border-radius: 6px; padding: 1px 5px;
}
.img-cell-ops { display: flex; gap: 4px; margin-top: 4px; }
.img-cell-ops .mini-btn { padding: 3px 6px; font-size: 11px; }
/* 专家管理：证件材料按类分组，每一组先说"要它做什么"再排缩略图。
   缩略图沿用 .prod-preview 那一档尺寸（112px），换的只是外框与序号位置。 */
.exp-doc-g { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--adm-canvas); }
.exp-doc-g:last-child { margin-bottom: 0; }
.exp-doc-head { font-size: 12.5px; font-weight: 600; color: var(--primary); }
.exp-doc-head em { font-style: normal; font-weight: 400; font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.exp-doc-why { font-size: 11.5px; line-height: 1.6; color: var(--text-muted); margin: 3px 0 8px; }
.exp-doc-strip { display: flex; flex-wrap: wrap; gap: 12px; }
.exp-doc-cell { position: relative; width: 112px; }
.exp-doc-cell em { display: block; font-style: normal; font-size: 10.5px; color: var(--text-muted); margin-top: 3px; word-break: break-all; }
.exp-doc-img { background: #fff; }
.exp-note { display: inline-block; font-style: normal; font-size: 11.5px; color: var(--text-secondary); background: #f3efe8; border: 1px solid #e6dbcb; border-radius: 999px; padding: 2px 10px; }
.exp-chip {
  display: inline-block; padding: 2px 9px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--text-secondary); font-size: 11.5px; line-height: 1.6;
}
/* 申请字段表：左栏是 label，宽度固定，右栏按字符折行——证件号与机构名都不该撑破栅格 */
.exp-app { table-layout: fixed; }
.exp-app th { width: 168px; font-weight: 600; color: var(--text-secondary); vertical-align: top; white-space: normal; }
.exp-app td { white-space: pre-wrap; overflow-wrap: anywhere; }
.exp-gap { min-width: 74px; }
.exp-card { min-width: 210px; max-width: 300px; line-height: 1.6; }
.exp-card em { display: block; font-style: normal; }
.exp-gap-line { margin-top: 8px; }
.exp-review { margin-top: 12px; }
.exp-avatar-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.exp-avatar-ops { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: 11.5px; }
.exp-avatar-ops .mini-btn { margin-left: 0; }
@media (max-width: 1079px) {
  .pf-c8, .pf-c6 { grid-column: span 12; }
  .pf-c4, .pf-c3 { grid-column: span 6; }
  #specRows { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .pf-c8, .pf-c6, .pf-c4, .pf-c3 { grid-column: span 12; }
  .pf-grid { gap: 10px; }
  .pf-group-body { padding: 12px; }
}
.chk { display: flex; align-items: center; gap: 5px; }
.chk input { accent-color: var(--primary); }
.rt-toolbar { display: flex; gap: 4px; border: 1px solid var(--border); border-bottom: none; border-radius: 10px 10px 0 0; padding: 6px 8px; background: var(--adm-canvas); }
.rt-toolbar .rt-img { margin-left: auto; }
.rt-toolbar b, .rt-toolbar i, .rt-toolbar u, .rt-toolbar span {
  font-size: 12.5px; padding: 2px 9px; border-radius: 6px; cursor: pointer; user-select: none; color: var(--primary);
}
.rt-toolbar b:hover, .rt-toolbar i:hover, .rt-toolbar u:hover, .rt-toolbar span:hover { background: rgba(22, 60, 76, .08); }
.rt-editor { min-height: 130px; border: 1px solid var(--border); border-radius: 0 0 10px 10px; padding: 10px 12px; font-size: 13px; background: var(--card); outline: none; }
.rt-editor:focus { border-color: var(--gold); }
.rt-editor:empty::before { content: "在这里输入产品描述…（先选中文字，再用上方工具栏加粗/列表/小标题）"; color: var(--text-muted); }
#newsEditor:empty::before { content: "在这里输入新闻正文…（可选中文字加粗/加小标题，或用「插入图片」配插图）"; color: var(--text-muted); }
#newsRtToolbar { margin-top: 13px; }
.rt-editor img { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.rich-text img { max-width: 100%; border-radius: 8px; margin: 6px 0; }

/* ---------- 注册 / 登录 ---------- */
.top-user { text-decoration: none; cursor: pointer; }
.top-user:hover { color: var(--gold-light); }
.auth-card .input { margin-bottom: 10px; }
.auth-card .input[hidden] { display: none; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; margin-bottom: 14px; background: var(--wash-hover); }
.seg-item { font-size: 13px; padding: 6px 22px; border-radius: 999px; cursor: pointer; color: var(--text-secondary); user-select: none; transition: var(--transition); }
.seg-item.on { background: var(--primary); color: var(--on-primary); font-weight: 500; }
.code-row { display: flex; gap: 8px; margin-bottom: 10px; }
.code-row .input { flex: 1; margin-bottom: 0; }
.code-row .btn { white-space: nowrap; padding: 0 14px; }
.auth-switch { font-size: 12.5px; color: var(--primary); cursor: pointer; border-bottom: 1px dashed var(--gold); margin: 2px 0 12px; width: fit-content; }
.auth-switch:hover { color: var(--gold-ink); }

/* ---------- 用户中心 ---------- */
.uc-row { display: flex; gap: 8px; align-items: center; }
/* 账号资料是只读展示：值用 <b> 加粗、键名弱化，刻意不做成 input，避免看起来能改 */
.uc-ro { display: flex; align-items: baseline; gap: 8px; padding: 4px 0 2px; }
.uc-ro-k { font-size: 12px; color: var(--text-muted); min-width: 46px; }
.uc-ro b { font-size: 15px; color: var(--primary); letter-spacing: .3px; }
.uc-list { margin-top: 10px; }
.uc-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--paper-0); }
.uc-item b { font-size: 13.5px; margin-right: 6px; }
.uc-item .uc-sub { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 3px; line-height: 1.6; }
.uc-item .op { text-align: right; margin-top: 6px; }
.uc-tag { font-size: 11px; color: var(--success); border: 1px solid var(--success-line); background: var(--success-wash); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.uc-tag.warn { color: var(--warning); border-color: var(--warning-line); background: var(--warning-wash); }
.uc-form { border: 1px dashed var(--line-input); border-radius: 10px; padding: 12px; margin-top: 10px; background: var(--paper-0); }
.uc-form .input, .uc-form select.input { margin-bottom: 8px; }
.uc-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.uc-form[hidden] { display: none; }
.uc-empty { font-size: 12.5px; color: var(--text-muted); padding: 8px 0; }

/* ---------- 用户中心分段导航（线条图标 + 文字，与全局功能导航同一套画法） ---------- */
/* 内容列封顶 520px：十一格排一行只有 47px 宽，四字标签必然溢出。
   按 4 列走三行是 4/4/3——最后一行只缺右下一格；按 5 列就成了 5/5/1，多出一个孤零零的格。
   ≤400px 仍是 4 列（一行五个在此宽度下只有 78px，标签要靠 10px 才塞得下，读起来吃力）。 */
.uc-nav {
  position: sticky; top: var(--topbar-h); z-index: 9;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px 2px;
  padding: 7px 6px 5px; margin-bottom: 12px;
}
.uc-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 2px 7px; border: 0; background: none; border-radius: 10px;
  color: var(--text-secondary); font: inherit; cursor: pointer; transition: var(--transition);
}
.uc-tab svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.uc-tab span { font-size: 11.5px; font-weight: 600; letter-spacing: .2px; white-space: nowrap; }
.uc-tab:hover { background: var(--bg); color: var(--primary); }
.uc-tab.on { background: var(--bg); color: var(--primary); }
.uc-tab.on svg { stroke: var(--gold); }
.uc-tab.on::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%);
  width: 20px; height: 2px; border-radius: 2px; background: var(--gold);
}
.uc-tab-n {
  position: absolute; top: 1px; left: 50%; transform: translateX(3px);
  min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; font-style: normal;
  line-height: 16px; border-radius: 999px; background: var(--seal-ink); color: var(--on-primary);
}
/* 购物车与在线客服这两格是跳页的链接，不是分段：不给下划线，也不会有 .on */
.uc-tab-link { text-decoration: none; }
@media (max-width: 400px) {
  .uc-nav { grid-template-columns: repeat(4, 1fr); gap: 4px 0; }
  .uc-tab { padding: 7px 0 6px; }
  .uc-tab span { font-size: 10px; letter-spacing: 0; }
  .uc-tab svg { width: 18px; height: 18px; }
  .uc-tab-n { min-width: 14px; height: 14px; line-height: 14px; font-size: 9px; }
}

/* ---------- 我的推广（#/promote） ---------- */
/* 版面次序即口径：先给码（能分享），再讲规则（钱从哪来、只计两级），
   最后才是团队与台账——邀请人数排在佣金之前会读成「拉人头有钱」。 */
.pr-head h2 { margin: 5px 0 3px; font-size: 19px; }
.pr-back { font-size: 12.5px; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.pr-back:hover { color: var(--primary); }
.pr-qr-card { text-align: center; }
.pr-qr { display: flex; justify-content: center; padding: 4px 0 0; }
.pr-qr img { width: 220px; height: 220px; max-width: 68vw; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.pr-code { margin: 8px 0 0; font-size: 17px; font-weight: 700; color: var(--primary); }
.pr-link-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pr-link-row .input { flex: 1; min-width: 0; font-size: 12px; }
/* 绑定确认卡只在「带码进来 + 本人还没绑过」时出现，金边提示这是要当场拿主意的卡片 */
.pr-bind { border-color: var(--gold); }
.pr-rules { margin: 4px 0 0; padding-left: 20px; font-size: 12.5px; line-height: 1.9; color: var(--text-secondary); }
.pr-rules li + li { margin-top: 3px; }
.pr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.pr-stat { border: 1px solid var(--border); border-radius: 10px; padding: 9px 4px; text-align: center; background: var(--bg); }
.pr-stat b { display: block; font-size: 14.5px; color: var(--primary); }
.pr-stat span { display: block; margin-top: 2px; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-member { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; }
.pr-member:last-child { border-bottom: none; }
.pr-mname { flex: none; max-width: 34%; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-mtime { flex: none; font-size: 11px; color: var(--text-muted); }
.pr-mamt { flex: 1; text-align: right; font-size: 11.5px; color: var(--text-secondary); }
/* 层级徽标：一级/二级必须一眼分开，两档佣金比例不同，读错就是口径事故 */
.pr-lv {
  flex: none; font-size: 10.5px; line-height: 1.7; padding: 0 7px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border); color: var(--primary); white-space: nowrap;
}
.pr-lv.lv2 { color: var(--text-muted); }
.pr-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.pr-row:last-child { border-bottom: none; }
.pr-rmain { flex: 1; min-width: 0; }
.pr-rmain b { display: block; font-size: 12.5px; color: var(--text); }
.pr-rmain i { display: block; margin-top: 2px; font-size: 11px; font-style: normal; color: var(--text-muted); }
.pr-ramt { flex: none; font-size: 13.5px; font-weight: 700; color: var(--primary); }
.pr-rtime { flex: none; font-size: 10.5px; color: var(--text-muted); }
@media (max-width: 400px) {
  .pr-stats { grid-template-columns: repeat(2, 1fr); }
  .pr-member { flex-wrap: wrap; }
  .pr-mamt { flex-basis: 100%; text-align: left; }
  .pr-rtime { flex-basis: 100%; }
}
/* 推广码、订单号都是要照着念的字符串，一律等宽 */
.admin-table code, .pr-code { font-family: Consolas, "Courier New", monospace; letter-spacing: .5px; }
/* 登录卡里的邀请提示：只在带码进来了、且处于注册态时出现 */
.inv-note {
  margin: 6px 0 0; padding: 7px 10px; border-radius: 9px; font-size: 12px; line-height: 1.6;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-secondary);
}
.inv-note[hidden] { display: none; }

/* ---------- 新闻 ---------- */
.news-brief { display: flex; flex-direction: column; gap: 2px; }
.news-brief-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px dashed var(--paper-2); font-size: 13px;
}
.news-brief-item:last-child { border-bottom: none; }
.news-brief-title {
  flex: 1; min-width: 0; color: var(--text); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.news-brief-title:hover { color: var(--primary); }
.news-brief-time { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.news-chip {
  flex: none; font-size: 11px; line-height: 1.6; padding: 0 8px; border-radius: 999px;
  background: var(--paper-2); color: var(--text-secondary); text-decoration: none; white-space: nowrap;
}
.news-chip:hover { background: var(--primary); color: var(--on-primary); }
.news-list { display: flex; flex-direction: column; }
.news-item { padding: 11px 0; border-bottom: 1px dashed var(--paper-2); }
.news-item:last-child { border-bottom: none; }
.news-item-title {
  display: block; font-size: 14.5px; font-weight: 600; line-height: 1.6;
  color: var(--text); text-decoration: none;
}
.news-item-title:hover { color: var(--primary); }
.news-item-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); }
.news-detail-title { font-size: 20px; font-weight: 700; line-height: 1.55; color: var(--primary); margin: 12px 0 6px; }
.news-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.more-link { float: right; font-size: 12px; font-weight: 400; color: var(--text-muted); text-decoration: none; }
.more-link:hover { color: var(--primary); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.pager .btn { padding: 6px 14px; font-size: 12.5px; }
.pager .btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-info { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }

/* ---------- 隐私协议 ---------- */
.agree-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); margin: 2px 0 12px; }
.agree-row input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.agree-row label { cursor: pointer; }
.agree-row a { color: var(--primary); text-decoration: underline; }
.agreement-card { line-height: 1.9; }
.agreement-title { font-size: 19px; font-weight: 700; color: var(--primary); margin: 12px 0 4px; }
.agreement-date { font-size: 11.5px; color: var(--text-muted); margin-bottom: 14px; }
.agreement-body { font-size: 13px; color: var(--text); }
.agreement-body p { margin: 6px 0; }
.agreement-body h3 { font-size: 14.5px; color: var(--primary); margin: 16px 0 6px; }
.agreement-body ol { padding-left: 20px; margin: 6px 0; }
.agreement-body li { margin: 4px 0; }

/* ---------- 商城：顶栏账号入口与购物车角标 ---------- */
/* 购物车图标已从顶栏搬进用户中心分段导航，这里只剩吸底栏那枚角标沿用同一套画法 */
.top-actions { display: flex; align-items: center; gap: 12px; flex: none; }
/* 页头语言切换：两枚并列的小胶囊，而不是"切到另一种"的单按钮——两枚一直在，
   用户随时看得见自己现在在哪种语言、以及另一种语言在不在。选中那枚填哑金。 */
.lang-switch {
  display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px;
  border: 1px solid rgba(240, 217, 189, .28); background: rgba(0, 0, 0, .18);
}
.lang-opt {
  font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: .3px;
  padding: 3px 9px; border: 0; border-radius: 999px; cursor: pointer;
  color: rgba(232, 212, 190, .72); background: transparent; transition: var(--transition);
}
.lang-opt:hover { color: var(--gold-light); }
.lang-opt.is-on { color: var(--ink); background: var(--gold-light); }
.cart-badge {
  position: absolute; top: -6px; right: -7px; min-width: 17px; padding: 0 4px;
  font-size: 10.5px; line-height: 16px; font-weight: 700; text-align: center;
  color: var(--on-primary); background: var(--danger); border-radius: 999px; border: 1px solid var(--on-primary);
}
.cart-badge[hidden] { display: none; }

/* ---------- 商城：产品详情 ----------
   版式按移动端商品详情页的通行结构排：整宽大图 → 价格带 → 标题 → 一行式条目（参数/数量/评价）
   → 通栏图文详情 → 吸底两键。配色仍是本站暖色，没有跟任何参考站换色板。 */
.pd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pd-cat {
  display: inline-block; font-size: 11px; color: var(--text-secondary); background: var(--paper-2);
  border-radius: 999px; padding: 1px 9px; white-space: nowrap;
}
/* 大图不再整块出血：它和下面那张白纸、评论区、猜你喜欢用的是同一个宽度（内容宽 = 页宽封顶
   --app-max 再扣掉左右各 --app-pad）。上一版让大图铺满屏幕而白纸缩回内容宽，同一页里上下
   两段就差出 32px，那正是"上下布局的 DIV 不一样宽"的观感来源。 */
.pd-hero { position: relative; background: var(--paper-2); }
/* 顶栏那一行按钮要压在图上面，所以它得有自己的层级；图本身不设层级，仍在流内 */
.pd-hero::before {
  content: ""; position: absolute; z-index: 1; top: 0; left: 0; right: 0; height: 62px;
  background: linear-gradient(180deg, rgba(46, 26, 14, .34), rgba(46, 26, 14, 0));
  pointer-events: none;
}
/* 主图轮播：横向 flex + translateX 换帧，帧宽用 flex-basis:100% 钉成一屏一张，
   overflow 放在 .pd-gallery 上（大图不再出血，这块也没有圆角，卡片那圈边留给卡片内容）。 */
.pd-gallery { position: relative; overflow: hidden; }
.pd-track { display: flex; transition: transform .38s cubic-bezier(.33, .1, .2, 1); }
.pd-slide { flex: 0 0 100%; min-width: 100%; }
.pd-gallery img { width: 100%; aspect-ratio: 1 / 1; max-height: 460px; object-fit: cover; display: block; background: var(--paper-2); }
/* 圆点从图下方挪到图上：一整屏图加一行点，等于把下一屏内容往下推半屏 */
.pd-dots { position: absolute; z-index: 2; left: 0; right: 0; bottom: 13px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.pd-dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 251, 245, .62); cursor: pointer; transition: var(--transition); }
.pd-dot:hover { background: rgba(255, 251, 245, .9); }
.pd-dot.on { width: 18px; background: var(--gold); }
.pd-noimg { width: 100%; aspect-ratio: 1 / 1; max-height: 460px; display: grid; place-items: center; background: var(--paper-2); color: var(--text-muted); font-size: 12.5px; }
/* 系统级"减少动效"：自动轮播停了，切换也就不再滑动（JS 同步不起定时器） */
@media (prefers-reduced-motion: reduce) {
  .pd-track { transition: none; }
}
/* 图上的圆钮：返回在左，分享与收藏在右。底色是半透明白 + 模糊，深色照片上也按得出 */
.pd-hero-bar { position: absolute; z-index: 3; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; justify-content: space-between; }
.pd-hero-acts { display: flex; align-items: center; gap: 8px; }
.pd-round {
  width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 999px;
  background: rgba(255, 253, 249, .84); color: var(--primary); cursor: pointer;
  box-shadow: 0 1px 6px rgba(46, 26, 14, .18); backdrop-filter: blur(4px); font-family: inherit; transition: var(--transition);
}
.pd-round:hover { background: var(--paper-0); color: var(--primary-hover); }
.pd-round svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pd-round.on svg { fill: var(--gold); stroke: var(--gold); }
.pd-back { font-size: 22px; line-height: 1; text-decoration: none; padding-bottom: 2px; }
/* 帧角标只有数字（3/5），不含可翻的中文，因此它不进词典也不进观察器的覆盖面 */
.pd-counter {
  position: absolute; z-index: 3; right: 12px; bottom: 12px;
  min-width: 34px; padding: 2px 8px; border-radius: 999px; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; color: var(--on-primary);
  background: rgba(46, 26, 14, .52); backdrop-filter: blur(3px);
}
.pd-counter[hidden] { display: none; }
/* 大图之后是一整张白纸：价格、标题、那一叠行与图文详情都印在同一面上，
   段与段之间用一条厚浅线分开（而不是再套三四张 .card）。
   横向留白不再由这张纸整体承担，而是逐段各给自己的：图文详情那一段的**图**贴边，
   因为详情页的图要一张挨一张、不要间隔也不要倒角；文字段落则内缩 `--card-pad`，
   与紧接其下的评论卡、推荐卡（`.card` 的 padding 也是这个数）左边缘对齐。 */
.pd-sheet { margin: 0; padding: 14px 0 6px; background: var(--card); }
.pd-sheet > .pd-pricebox, .pd-sheet > .pd-titlebox, .pd-sheet > .pd-rows, .pd-sheet > .pd-terms { padding-left: var(--card-pad); padding-right: var(--card-pad); }
/* 图文详情整段搬到「猜你喜欢」之后，成了自己的一张白纸（最后一张 .pd-sheet）。
   原来那道 8px 厚的浅线是分在白纸内部用的，现在两张白纸之间已经有 .card 那 14px 的下边距，
   再留一条厚线就成了"两条间隙叠在一起"——所以这一档把线与它自带的上边距一起收掉。 */
.pd-sheet-tail { margin-bottom: 14px; }
.pd-sheet-tail .pd-detail { margin-top: 0; border-top: 0; padding-top: 0; }
.pd-pricebox { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.pd-pricecol { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.pd-price { font-size: 24px; font-weight: 700; color: var(--danger); letter-spacing: .5px; }
.pd-price-note { font-size: 11.5px; color: var(--text-muted); }
.pd-sold { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.pd-titlebox { margin-top: 8px; }
.pd-title { font-size: 17.5px; font-weight: 700; line-height: 1.55; color: var(--text); margin-top: 6px; }
.pd-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.7; }
/* 服务承诺那一排：一个起头的小标签 + 一串描边胶囊。只描边、不涂实色——
   这一排的字全部来自运营手填的 `product.service_terms`，画成实心色块会看着像平台担保，
   而本站没有任何担保可给。库里没填时整段不渲染（见 app.js: productHtml 的 terms.length 判断）。 */
.pd-terms { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; }
.pd-terms-k { flex: none; font-size: 11.5px; line-height: 22px; color: var(--text-muted); }
.pd-terms-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.pd-term {
  font-weight: 500; font-size: 11.5px; line-height: 1; padding: 5px 9px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--gold-ink); background: var(--paper-0);
}
/* 一行一条、右端箭头：参数就地展开，数量与评论各占一行（评论那行滚到评论区） */
.pd-rows { margin-top: 14px; border-top: 1px solid var(--paper-2); }
.pd-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px;
  padding: 9px 2px; border: 0; border-bottom: 1px solid var(--paper-2);
  background: transparent; color: var(--text); font: inherit; text-align: left;
}
button.pd-row { cursor: pointer; transition: var(--transition); }
button.pd-row:hover { background: var(--paper-0); }
.pd-row-label { flex: none; font-size: 12.5px; color: var(--text-muted); }
.pd-row-val { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-secondary); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pd-row-n { flex: none; font-size: 11.5px; color: var(--text-muted); }
.pd-row-gap { flex: 1; min-width: 0; }
.pd-chev { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.pd-row.open .pd-chev { transform: rotate(90deg); }
.pd-panel { padding: 4px 2px 12px; border-bottom: 1px solid var(--paper-2); }
.pd-qty { cursor: default; }
.pd-sum { margin-left: auto; font-size: 16px; font-weight: 700; color: var(--danger); white-space: nowrap; }
/* 图文详情与上面那一叠行之间是一条厚浅线，不是又一圈卡片边：移动端商详的分段感来自间隙本身。
   段内的横向留白一律取 `--card-pad`（与下面那两张 .card 的内边距同一个数），
   这样白纸里的文字左边缘和评论卡、推荐卡的文字左边缘落在同一条线上。 */
.pd-detail { margin-top: 16px; padding-top: 14px; border-top: 8px solid var(--paper-1); }
.pd-detail > .rich-text { margin-top: 10px; }
.pd-detail-title {
  font-size: 13.5px; font-weight: 700; color: var(--text);
  margin: 0 var(--card-pad); padding-left: 8px; border-left: 3px solid var(--gold-light);
}
.pd-detail > .hint { margin: 10px var(--card-pad) 8px; }
/* 详情页的图：贴满这一段的可用水宽，一张挨一张，之间不留缝、四角不倒角。
   `margin: 0` 要写满而不是只写 `margin-top: 0`——连排两张图时上一张的下边距同样会把缝留出来。
   新闻正文里的图仍走 `.rich-text img` 那条老规则（有 8px 圆角、6px 间隙），这一档只管商详。 */
.pd-detail .rich-text img { width: 100%; max-width: 100%; border-radius: 0; margin: 0; display: block; }
/* 图上不留缝，图旁的文字仍要与上面那叠行左对齐：富文本里 img 之外的一切自己内缩 */
.pd-detail .rich-text > :not(img) { padding-left: var(--card-pad); padding-right: var(--card-pad); }
/* 后台编辑器是把每一张图嵌进一段里落库的（`<p><img></p>`），而库里已存的正文就是这个形状：
   上一条给那个 `<p>` 内缩 18px，`.rich-text p` 的 6px 上下段距又在两张图之间留了一道缝。
   所以"只装着一张图"的那一段要连内缩带段距一起收掉，图才真的贴满内容宽、一张挨一张。
   `:has()` 判不了的旧内核退回到"图有 18px 内缩、两张图之间有 6px 缝"，不影响读。 */
.pd-detail .rich-text p:has(> img:only-child) { padding-left: 0; padding-right: 0; margin: 0; }

/* 数量步进器：± 按钮与输入框连成一体，隐藏原生 number 箭头 */
.qty { display: inline-flex; align-items: stretch; border: 1px solid var(--line-input); border-radius: 10px; overflow: hidden; background: var(--paper-0); flex: none; }
.qty-btn { width: 34px; border: 0; background: var(--paper-2); color: var(--primary); font-size: 16px; line-height: 1; cursor: pointer; transition: var(--transition); }
.qty-btn:hover { background: var(--wash-hover); }
.qty-btn:active { transform: translateY(1px); }
.qty-input { width: 48px; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); background: transparent; text-align: center; font: 600 14px/2.4 inherit; font-family: inherit; color: var(--text); appearance: textfield; }
.qty-input:focus { outline: 2px solid var(--gold-ink); outline-offset: -2px; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { appearance: none; margin: 0; }
.qty-sm .qty-btn { width: 28px; font-size: 14px; }
.qty-sm .qty-input { width: 38px; font-size: 13px; }

/* 吸底操作栏：详情页两枚图标（客服/购物车）+ 两个主按钮，购物车/结算页右侧合计 + 主按钮。
   宽度按内容列算（页宽封顶 --app-max，再扣掉左右各 --app-pad），
   所以量出来和上面那张 .card 一模一样；图标格自己吸收伸缩量（见下面的 flex），栏内不再靠定宽排。 */
.buy-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 20;
  width: calc(100% - var(--app-pad) * 2); max-width: calc(var(--app-max) - var(--app-pad) * 2);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 22px rgba(74, 47, 22, .09); backdrop-filter: blur(6px);
  min-height: var(--buybar-h);
}
/* 有吸底栏的那几页，让位量要落在页脚**下面**，不是正文与页脚之间。
   旧写法是在正文末尾插一块 78px 的 .buy-space，而页脚排在这块之后：滚到底看到的是
   「正文 — 一大段空 — 页脚被栏压掉半行」，那段空就是用户指着说的那道缝。
   现在正文与页脚之间只剩卡片本来的下边距，栏盖住的正是页脚自己补出来的这段内距。
   `:not([hidden])` 是必需的：切走的视图只是被 hidden，innerHTML 还留在原地，
   不排掉它的话从商详退回首页，首页也会平白多出这一档让位。 */
main#app:has(.view:not([hidden]) .buy-bar) + .footer {
  padding-bottom: calc(var(--buybar-h) + 12px + env(safe-area-inset-bottom));
}
/* 两枚图标格不再定宽：在两个主按钮之外均分剩余空间（上限仍是 44px，宽屏观感不变）。
   原来「定宽 + space-between」的写法在 375 这类主流宽度下已经把「立即购买」挤出白栏，
   分享位一加就是明着溢出——让图标格吸收伸缩量，任何宽度下都不可能再溢出。
   overflow 只加在文字上：角标是 right:-7px 挂在格子外的，格子一裁就没了。 */
.bar-cart, .bar-svc {
  position: relative; flex: 1 1 0; min-width: 0; max-width: 44px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 3px 0 1px; border: 0; background: transparent; cursor: pointer; text-decoration: none;
  font-size: 10px; line-height: 1.3; color: var(--text-secondary); font-family: inherit; transition: var(--transition);
}
.bar-cart span, .bar-svc span {
  max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.bar-cart svg, .bar-svc svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.bar-cart:hover, .bar-svc:hover { color: var(--primary); }
.bar-all { flex: none; display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }
.bar-all input { width: 16px; height: 16px; accent-color: var(--primary); }
.bar-total { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; }
.bar-total span { font-size: 11.5px; color: var(--text-muted); flex: none; }
.bar-total b { font-size: 17px; color: var(--danger); white-space: nowrap; }
.bar-total em { font-size: 11px; font-style: normal; color: var(--text-muted); white-space: nowrap; }
.bar-btn { flex: none; padding: 12px 16px; font-size: 14px; }
.bar-btn.primary { background: var(--primary); color: var(--on-primary); }
.bar-btn.primary:hover { background: var(--primary-hover); }
.bar-btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--line-input); }
.bar-btn.ghost:hover { background: var(--wash-hover); }
.bar-btn[disabled] { opacity: .45; cursor: not-allowed; }
.bar-wide { justify-content: flex-end; }
/* 详情页那两个主按钮做成等宽双胶囊：一浅一深、各占剩下那一半，和移动端商详一样。
   `.bar-btn { flex: none }` 是按内容定宽，两枚按钮加两枚图标格在 375 这类主流宽度下会挤出白条；
   改成 `flex: 1 1 0` 之后剩余宽度由两枚均分，任何视口都不可能溢出（图标格仍有 44px 上限）。
   浅色那一枚不用描边（border 会改盒高、把吸底栏顶起来），但也不能只靠底色分档：
   米色对米色的差值远低于 3:1，读屏之外的用户看不出那是一枚可按的胶囊。
   故底色走纸二档，再压一道 inset 墨线当边界——不占位、不改高。 */
.bar-pd .bar-btn { flex: 1 1 0; min-width: 0; padding: 11px 6px; border: 0; border-radius: 999px; font-size: 13.5px; }
.bar-pd .bar-btn.ghost { background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line-input); color: var(--primary); }
.bar-pd .bar-btn.ghost:hover { background: var(--wash-hover); box-shadow: inset 0 0 0 1px var(--primary); }

/* ---------- 产品分享面板：从底部升起，海报是主角 ---------- */
/* 压在吸底栏与遮罩之上、toast 之下：海报面板里报错时那句提示必须还看得见 */
.share-mask {
  position: fixed; inset: 0; z-index: 55; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(46, 26, 14, .52); backdrop-filter: blur(2px);
}
.share-sheet {
  width: 100%; max-width: var(--app-max); max-height: 88vh; overflow-y: auto;
  padding: 14px var(--app-pad) calc(18px + env(safe-area-inset-bottom));
  background: var(--paper-0); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 34px rgba(46, 26, 14, .3);
}
.share-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.share-head b { font-size: 15.5px; color: var(--text); overflow-wrap: anywhere; }
.share-x {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 999px; background: transparent;
  color: var(--text-secondary); font-size: 15px; line-height: 1; cursor: pointer;
}
.share-x:hover { background: rgba(124, 74, 36, .12); }
.share-posterbox { display: flex; justify-content: center; background: var(--paper-1); border-radius: 12px; }
.share-poster { display: block; width: min(300px, 72vw); height: auto; border: 1px solid var(--border); border-radius: 12px; }
.share-dl { display: block; width: 100%; margin: 10px 0 2px; text-align: center; text-decoration: none; }
/* 微信授权没接入这件事必须写在面板上，而不是等用户扫完码才发现：这一句是如实披露，不是提示 */
.share-note {
  margin: 10px 0 0; padding: 9px 11px; border-left: 3px solid var(--gold); border-radius: 8px;
  background: var(--warning-wash); font-size: 11.5px; line-height: 1.7; color: var(--text-secondary);
}
/* 未登录引导层：遮罩与面板的版面全在上面那两条 .share-* 里，这里只补宽度、表单间距与层序。
   `.gate-sheet>.input` 只挑直接子元素——`.code-row` 里那两枚的间距归 `.code-row` 管
   （它已经写了 `margin-bottom: 0`，用后代选择器会把它顶掉，输入框就比旁边的按钮矮一截）。
   两枚 .btn-block 是叠着排的，而 .btn 本身不带外边距，所以中间那 8px 只能在这里给。 */
/* 宽度从内容列那两个令牌算，不写 100% 也不写死像素：`main#app` 的盒子宽是 --app-max，
   卡片真正落在其中的内容列还要各扣一道 --app-pad。上一版引导层铺满 100% 再封顶 --app-max，
   于是它比正文卡片各边宽出一整道内距（520 vs 488），白纸压住了卡片。
   这里封顶取**内容列的 95%**（463.6px），窄屏由 `100% - 内距×2` 先收口，两侧留页面自己的那道内距。 */
.gate-sheet {
  width: calc(100% - var(--app-pad) * 2);
  max-width: calc((var(--app-max) - var(--app-pad) * 2) * .95);
}
.gate-sheet>.input { margin-bottom: 10px; }
.gate-sheet .btn-block + .btn-block { margin-top: 8px; }
/* 层序比海报面板低一档：加载遮罩是 50，而这一层要点「注册并登录」就会叫它。
   跟着 .share-mask 走 55 的话，那颗转圈和「绑定中…」那句都藏在面板后面，忙态等于没做。 */
.gate-mask { z-index: 44; }

/* ---------- 商城：购物车 ---------- */
.cart-list { display: flex; flex-direction: column; gap: 10px; }
.cart-item {
  display: grid; grid-template-columns: 20px 66px minmax(0, 1fr); gap: 10px; align-items: start;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--paper-0);
}
.cart-item.off { border-style: dashed; background: var(--paper-2); }
.cart-check { display: flex; padding-top: 22px; }
.cart-check input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.cart-thumb { display: block; width: 66px; height: 66px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--paper-2); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-thumb span { display: grid; place-items: center; width: 100%; height: 100%; font-size: 10px; color: var(--text-muted); }
.cart-info { min-width: 0; }
.cart-name { display: block; font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.5; }
.cart-name:hover { color: var(--primary); }
.cart-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.6; }
.cart-off { font-size: 11.5px; color: var(--danger); margin-top: 2px; }
.cart-bottom { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cart-price { font-size: 14.5px; font-weight: 700; color: var(--danger); }
.cart-bottom .mini-btn { margin-left: auto; }

/* ---------- 商城：确认订单 ---------- */
.co-addr {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--paper-0); cursor: pointer; transition: var(--transition);
}
.co-addr:last-child { margin-bottom: 0; }
.co-addr:hover { border-color: var(--gold); }
.co-addr.on { border-color: var(--gold); background: var(--warning-wash); box-shadow: 0 0 0 2px rgba(168, 118, 42, .13); }
.co-addr input { width: 16px; height: 16px; margin-top: 3px; accent-color: var(--primary); flex: none; }
.co-addr-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.co-addr-text b { font-size: 13.5px; color: var(--text); }
.co-addr-text em { font-size: 12px; font-style: normal; color: var(--text-secondary); line-height: 1.7; }
.co-items { display: flex; flex-direction: column; gap: 10px; }
.co-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.co-item img, .co-noimg { width: 52px; height: 52px; border-radius: 9px; border: 1px solid var(--border); object-fit: cover; display: block; }
.co-noimg { display: grid; place-items: center; background: var(--paper-2); color: var(--text-muted); font-size: 10px; }
.co-item-info { min-width: 0; }
.co-item-info b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.5; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.co-item-info i { font-style: normal; font-size: 11.5px; color: var(--text-muted); }
/* 订单快照里的规格单独一行：与 `x2` 那一种数量信息不同一句，挤在一起就读不清了 */
.co-item-info .co-spec { display: block; margin-top: 2px; color: var(--text-secondary); word-break: break-all; }
.co-item-price { font-size: 13.5px; font-weight: 700; color: var(--danger); white-space: nowrap; }
.co-remark { margin-bottom: 6px; resize: vertical; line-height: 1.8; }
.co-sum { padding-bottom: 16px; }
.co-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; }
.co-line b { font-size: 13.5px; }
.co-line.total { border-top: 1px dashed var(--paper-2); margin-top: 6px; padding-top: 10px; font-weight: 600; }
.co-line.total b { font-size: 18px; color: var(--danger); }
.co-free { font-size: 12px; font-weight: 400; color: var(--success); }

/* ---------- 商城：开具发票（折叠行 + 抬头选择面板，结算页与订单页共用） ---------- */
.co-inv-card { padding-top: 13px; padding-bottom: 15px; }
.co-cell {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 2px 0;
  background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: var(--text);
}
.co-cell-k { flex: none; font-size: 14px; font-weight: 600; }
.co-cell-v {
  flex: 1; min-width: 0; text-align: right; font-size: 12.5px; color: var(--text-muted);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.co-cell-v.on { color: var(--primary); font-weight: 600; }
.co-cell-chev {
  flex: none; font-style: normal; font-size: 17px; line-height: 1; color: var(--text-muted);
  transition: transform .18s ease;
}
.co-cell-chev.open { transform: rotate(90deg); color: var(--primary); }
.co-cell:hover .co-cell-chev { color: var(--primary); }
.inv-opts { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--paper-2); }
.inv-opt { padding: 9px 11px; }
.inv-opt b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inv-opts .mini-btn { width: 100%; margin-top: 2px; }
.inv-rule { margin: 10px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--text-muted); }
.inv-amount { font-size: 13.5px; color: var(--danger); }

/* ---------- 商城：订单详情 / 我的订单 ---------- */
.ord-hero { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.ord-status { flex: none; font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.ord-tip { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.75; color: var(--text-secondary); }
.ord-addr { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.ord-addr b { font-size: 14.5px; }
.ord-addr span { color: var(--text-secondary); font-size: 13px; }
.ord-addr-sub { font-size: 12.5px; color: var(--text-secondary); line-height: 1.8; margin: 2px 0 12px; }
.ord-addr .ord-comp { color: var(--text); }
/* 买家页面上的物流一句话：登记过才有这一行，所以它不需要"暂无"那种占位样式 */
.ord-ship { margin: 0 0 12px; padding: 8px 11px; border-left: 3px solid var(--gold); background: var(--bg); border-radius: 0 8px 8px 0; font-size: 12.5px; line-height: 1.7; color: var(--text-secondary); word-break: break-all; }
.ord-uc-comp { color: var(--text-secondary); }
.ord-uc-ship { color: var(--success); }
.ord-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; font-size: 12.5px; }
.ord-meta dt { color: var(--text-muted); }
.ord-meta dd { color: var(--text); }
.ord-no { font-family: Consolas, "Courier New", monospace; letter-spacing: .5px; }
.ord-remark { white-space: pre-wrap; word-break: break-all; line-height: 1.8; }
/* 订单页的支付面板：二维码要够大够清晰（手机屏上扫得动是第一要求），左边图右边话 */
.od-pay .ord-tip { margin-bottom: 0; }
.od-pay-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 12px; }
.od-qr { width: 190px; height: 190px; image-rendering: pixelated; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.od-pay-tip { font-size: 12px; line-height: 1.8; color: var(--text-secondary); }
.od-pay-tip code { font-size: 11.5px; word-break: break-all; }
.od-pay-warn { color: var(--danger); }
@media (max-width: 420px) {
  /* 窄屏上下排：图在上、话在下，二维码跟着页宽缩，不留横向滚动 */
  .od-pay-grid { grid-template-columns: minmax(0, 1fr); }
  .od-qr { width: min(190px, 62vw); height: auto; aspect-ratio: 1; }
}
.ord-list { display: flex; flex-direction: column; gap: 8px; }
.ord-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--paper-0);
  text-decoration: none; transition: var(--transition);
}
.ord-line:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.ord-line-main { min-width: 0; }
.ord-line-main b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.6; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ord-line-main i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.ord-line-r { text-align: right; }
.ord-line-r b { display: block; font-size: 14px; font-weight: 700; color: var(--danger); }
.ord-line-r em { font-style: normal; }
.ord-inv { display: block; font-style: normal; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.ord-inv.on { color: var(--success); }
/* 「确认收货」挂在整行外面：那一行本身是个 <a>（点它进订单详情），按钮嵌在自己的父链接里
   在 HTML 上就是非法嵌套，浏览器会把内层 <a> 拆出去，落点变得不可预期。
   所以外层套一个不跳页的 div，行和按钮是兄弟。 */
.ord-line-wrap { display: flex; align-items: stretch; gap: 8px; }
.ord-line-wrap .ord-line { flex: 1; min-width: 0; }
.ord-cfm {
  flex: none; display: grid; place-items: center; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--paper-0);
  color: var(--gold-ink); font-size: 12px; font-weight: 600; text-decoration: none;
  transition: var(--transition);
}
.ord-cfm:hover { border-color: var(--gold); background: var(--paper-1); }
/* 订单详情里那一格只带路，不解释流程：点进确认收货页才看得见「确认后会发生什么」那份清单 */
.ord-cfm-bar { display: flex; align-items: center; gap: 12px; }
.ord-cfm-tip { flex: 1; min-width: 0; margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--text-secondary); }
.ord-cfm-go { flex: none; padding: 9px 18px; font-size: 13px; }

/* ---------- 评论区：新闻与产品共用 ---------- */
.cmt-card { margin-top: 12px; }
.cmt-list { display: flex; flex-direction: column; gap: 10px; }
.cmt-empty { font-size: 12.5px; color: var(--text-muted); padding: 10px 0; text-align: center; }
.cmt-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; background: var(--paper-0); }
.cmt-item.mine { border-color: var(--border); background: var(--paper-1); }
.cmt-head { display: flex; align-items: center; gap: 7px; }
.cmt-head b { font-size: 12.5px; color: var(--text); }
.cmt-when { flex: 1; font-size: 11px; color: var(--text-muted); }
.cmt-st { font-size: 10.5px; border-radius: 999px; padding: 1px 7px; background: var(--paper-2); color: var(--gold-ink); }
.cmt-st.rejected { background: var(--danger-wash); color: var(--danger); }
.cmt-body { margin: 6px 0 0; font-size: 13.5px; line-height: 1.75; color: var(--text-secondary); word-break: break-word; }
.cmt-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cmt-img { width: 82px; height: 82px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); display: block; }
.cmt-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmt-more { width: 100%; margin-top: 10px; font-size: 12.5px; padding: 9px; }
.cmt-form { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
/* 产品「评价」的只读那一档：整块输入区换成一句原因 + 一个去处。
   底色用商城那圈浅沙色而不是禁用态的灰——他没做错什么，只是这一款还没确认收货；
   `justify-items: start` 让那颗按钮按内容收缩，不做成一条通栏的假主按钮。 */
.cmt-locked { display: grid; gap: 9px; justify-items: start; padding: 12px 14px; background: var(--paper-0); border-radius: 12px; }
.cmt-lock { font-size: 12.5px; line-height: 1.8; color: var(--text-secondary); margin: 0; }
.cmt-lock-go { padding: 9px 15px; font-size: 12.5px; }
.cmt-locked .hint { margin-top: 0; }
/* 商详那一档的「去评价」：列表读完想写就去评价页，不在商详里就地开一个输入框。
   所以这一行是导航（居中、按内容收缩的文字链），不是那块只读灰底——它不拒绝任何人，只是带路。 */
.cmt-foot { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--border); text-align: center; }
.cmt-go { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--primary); text-decoration: none; }
.cmt-go::after { content: "›"; }
.cmt-foot .hint { margin: 6px 0 0; }
.cmt-text { width: 100%; resize: vertical; min-height: 72px; font: inherit; font-size: 13.5px; line-height: 1.7; }
.cmt-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.cmt-tools { display: flex; align-items: center; gap: 7px; }
.cmt-tools .mini-btn { margin-left: 0; }
.cmt-len { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.cmt-emojis { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--paper-0); }
.cmt-e { width: 32px; height: 32px; font-size: 18px; line-height: 1; border: 0; background: transparent; border-radius: 8px; cursor: pointer; }
.cmt-e:hover { background: var(--paper-2); }
.cmt-picks { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.cmt-pick { position: relative; width: 68px; height: 68px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--paper-2); }
.cmt-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmt-x {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; padding: 0;
  font-size: 11px; line-height: 16px; color: #fff; background: rgba(59, 42, 30, .78);
  border: 0; border-radius: 999px; cursor: pointer;
}
.cmt-pick-n { align-self: center; font-size: 11.5px; color: var(--text-muted); }
/* 新闻页评论分区：最热由后台挑最多 2 条，最新按时间给 5 条，剩下的靠「查看全部评论」就地展开 */
.cmt-sec { margin-bottom: 12px; }
.cmt-sec-title {
  font-size: 12.5px; font-weight: 700; color: var(--text);
  margin: 0 0 8px; padding-left: 7px; border-left: 3px solid var(--gold);
}
.cmt-all { width: 100%; margin-top: 10px; font-size: 12.5px; padding: 9px; }

/* ---------- 产品评价页（#/review/<id>）：表单从商详搬到这里 ----------
   商详那一档只留已发表的列表，发表这一步给了一整页：页头是「返回商品详情」，
   第一张卡是这一款商品（对着哪个商品写的那一句总得看得见），紧接着就是输入框。
   商品卡缩略图沿用确认订单那一份尺寸（52px / 9px 倒角 / 同一条边框），不另立一套。 */
.rv-prod { display: flex; align-items: center; gap: 11px; }
.rv-thumb { width: 52px; height: 52px; flex: none; border-radius: 9px; border: 1px solid var(--border); object-fit: cover; display: block; }
.rv-nothumb { display: grid; place-items: center; background: var(--paper-2); }
.rv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rv-main b { font-size: 13.5px; font-weight: 600; line-height: 1.5; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rv-main span { font-size: 12px; color: var(--text-muted); line-height: 1.6; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rv-go { flex: none; }
/* 用户中心「待评价」那一格沿用同一份商品行形状：图 + 名称 + 去处，只是外面套的是 `.uc-item`
   那条既有的边框，所以这里只补 flex，不重描一遍边框。 */
.uc-item.rv-row { display: flex; align-items: center; gap: 10px; }
.uc-item.rv-row b { margin-right: 0; }
/* 这一页的评论卡上面就是商品卡：两张 .card 之间的 14px 下边距已经够了，
   再叠上 `.cmt-card` 那条 12px 上边距就成了两道间隙。 */
.rv-prod + .cmt-card { margin-top: 0; }

/* ---------- 确认收货页（#/confirm/<id>）：按钮之前的那一屏 ----------
   这一页的职责是把「确认后会发生什么」讲完，再给那颗按钮，所以它是一个独立页面而不是
   订单详情里的一次点击。文案判据全在 logic.js（`confirmGate`/`confirmLine`/`CONFIRM_EFFECTS`），
   这里只管形状：效果清单用描点列表，等单号那一档用一条浅沙色的提示带。 */
.cf-who { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); }
/* 确认页那一格比订单详情多一句留痕，所以提示与留痕竖着排在一列里，
   不去改 `.ord-hero` 那条共用的横排规则（订单详情页还在用它）。 */
.cf-sum { flex: 1; min-width: 0; }
.cf-do .card-title { margin-bottom: 10px; }
.cf-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.cf-list li { font-size: 12.5px; line-height: 1.75; color: var(--text-secondary); }
.cf-do .btn-block { margin-top: 14px; }
.cf-do .hint { margin-top: 9px; }
.cf-wait { margin: 0; padding: 11px 13px; border-left: 3px solid var(--gold); background: var(--paper-0); border-radius: 0 10px 10px 0; font-size: 12.5px; line-height: 1.75; color: var(--text-secondary); word-break: break-all; }
/* 完成之后各件商品的去处：一行一个「评价「某某」」，横向排不下了就换行，不做成表格 */
.cf-reviews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--paper-2); }
.cf-review { font-size: 12px; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- 用户中心：我的收藏 ---------- */
.fav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fav-item { position: relative; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--paper-0); }
.fav-thumb { display: block; width: 100%; height: 104px; border-bottom: 1px solid var(--border); background: var(--paper-2); }
.fav-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fav-thumb span { display: grid; place-items: center; width: 100%; height: 100%; font-size: 11px; color: var(--text-muted); }
.fav-name { display: block; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; padding: 8px 9px 0; line-height: 1.5; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fav-name:hover { color: var(--primary); }
.fav-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 9px 9px; }
.fav-foot b { font-size: 13.5px; font-weight: 700; color: var(--danger); }
.fav-foot .mini-btn { margin-left: 0; }
/* 失效对象（下架/删除）在卡片左上角压一枚小标，行式列表里则内联跟在文字后 */
.fav-dead { font-size: 10.5px; color: var(--on-primary); background: rgba(59, 42, 30, .82); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.fav-item .fav-dead { position: absolute; top: 8px; left: 8px; }
/* 三类收藏共用一个夹子：分段按钮带计数徽标，产品走卡片，报告与新闻走文字行 */
.fav-tabs { margin-bottom: 10px; }
.fav-tab { font: inherit; display: inline-flex; align-items: center; gap: 5px; }
.fav-n { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--gold-ink); }
.fav-tab.on .fav-n { color: var(--gold-ink); }
.fav-rows { display: flex; flex-direction: column; gap: 8px; }
.fav-row {
  display: flex; align-items: center; gap: 9px; padding: 10px 11px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--paper-0);
}
.fav-kind {
  flex: none; font-size: 10.5px; color: var(--primary); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 5px; background: #fff;
}
.fav-row-main { flex: 1 1 auto; min-width: 0; text-decoration: none; color: var(--text); display: block; }
.fav-row-main b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fav-row-main i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.fav-row-main:hover b { color: var(--primary); }
/* 收藏星：吸底栏、报告页脚与新闻元信息共用，实心即已收藏 */
.fav-star { display: inline-flex; align-items: center; gap: 6px; font: inherit; }
.fav-star svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.fav-star.on { color: var(--gold-ink); border-color: var(--gold); }
.fav-star.on svg { fill: var(--gold); stroke: var(--gold); }
/* 新闻标题下那行元信息里的收藏星：跟元信息同字号，靠右端站，不与分类 chip 抢位 */
.news-fav { margin-left: auto; padding: 2px 4px; border: 0; background: none; cursor: pointer; font-size: 11.5px; color: var(--text-muted); }
.news-fav svg { width: 15px; height: 15px; }
.news-fav.on { color: var(--gold-ink); }

/* ---------- 后台订单表内排版 ---------- */
.ord-when { font-size: 11px; color: var(--text-muted); }
.ord-prods { display: flex; flex-direction: column; gap: 3px; min-width: 200px; }
.ord-prod { font-size: 12px; line-height: 1.6; }
.ord-prod .pd-code { margin-left: 4px; }
.ord-amt { display: block; font-size: 13px; font-weight: 700; }
.ord-invt { display: flex; flex-direction: column; gap: 3px; min-width: 152px; font-size: 12px; }
.ord-invt .lv { align-self: flex-start; }

/* ---------- 电子发票：开票列三态、站内预览浮层与上传页 ---------- */
/* 三种状态里两种是按钮、两种是文字，排版上得对齐同一根左边线 */
.ord-invt .mini-btn, .ord-invt a.mini-btn { align-self: flex-start; margin-top: 3px; text-align: center; }
.ord-invt a.mini-btn { text-decoration: none; }
.inv-none { color: var(--text-muted); }
/* 浮层压在抽屉(45)与底部面板(55)之上，但留在提示条(60)之下：预览失败时那句 toast 必须看得见 */
.inv-viewer { position: fixed; inset: 0; z-index: 58; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(24, 15, 8, .62); }
.inv-viewer[hidden] { display: none; }
.inv-viewer-box { display: flex; flex-direction: column; width: min(940px, 100%); height: min(78vh, 760px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.inv-viewer-head { display: flex; align-items: center; gap: 10px; flex: none; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--adm-canvas); }
.inv-viewer-head b { font-size: 13.5px; }
/* 那句状态占满剩余宽度并省略号：订单号一长就不该把「关闭」挤出可视区 */
.inv-viewer-head .ord-when { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-viewer-box iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
/* 邮件通道那一横条：配好与没配好是两种脸色，但都不阻止上传 */
.inv-banner { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 9px 12px; border: 1px dashed var(--border); border-radius: 10px; font-size: 12.5px; line-height: 1.7; background: var(--card); }
.inv-banner.ok { border-color: var(--success-line); }
.inv-banner.off { border-style: solid; background: var(--warning-wash); }
.inv-banner span { min-width: 0; }
#invUpForm select.input, #invUpForm input[type="file"].input { width: 100%; }

/* ---------- 发货管理：勾选列、收货信息格、导出横条与登记弹层 ---------- */
/* 勾选列只有 26px：它是"选哪几单"的把手，不该和订单号抢宽度 */
.ship-pick { width: 26px; text-align: center; }
.ship-chk { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
/* 收货信息一格里排四行（单位 / 收货人 / 电话 / 地址），不给个下限宽度就会把整张表挤成一列一个字 */
.ship-addr { min-width: 168px; line-height: 1.65; }
.ord-shipt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 176px; }
.ord-shipt .lv { align-self: flex-start; }
.ord-shipt .mini-btn { margin-top: 2px; }
/* 省 + 市并排：两栏各占一半，窄屏由 .pf-c3 自己降列（见上面的媒体查询） */
.ship-region { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* 导出那一横条贴着表格上沿，三种范围各自一颗按钮；超限那句红字换行走 */
.ship-export { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 2px 0 12px; }
.ship-export-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ship-export .wx-miss { flex: 1 1 100%; }
.ship-logs { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.9; color: var(--text-secondary); }
.ship-logs li { margin-bottom: 3px; }
.ship-logs .ord-when { display: block; }
/* 派单那一格（P2）：态 + 灯 + 一行来源读数 + 那几颗按钮。
   下限宽度比发货那格窄一点，因为它默认只有一枚「未派单」的药丸和一句话 */
.ord-sup { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 168px; }
.ord-sup .lv { align-self: flex-start; }
.ord-sup .wx-miss { max-width: 100%; }
.sup-meta { display: block; line-height: 1.6; }
/* 按钮横排、可换行：四颗挤成一排会把整张表撑宽，而这一格的按钮大多数时候只点其中一颗 */
.sup-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.sup-trace { font-size: 12px; color: var(--text-secondary); }
.sup-trace summary { cursor: pointer; }
.sup-trace ul { margin: 4px 0 0; padding-left: 16px; line-height: 1.8; }
/* 来源卡上的缺配置清单：每一条都是一个环境变量的名字，所以按行左对齐、不并排 */
.sup-blocks { margin: 0 0 10px; padding-left: 18px; font-size: 12.5px; line-height: 1.9; }
.sup-blocks li { margin-bottom: 3px; }
/* 弹层借发票预览的浮层底色与层级（都在 toast 之下），但它是表单不是查看器：
   高度按内容走，宽度收到 560px——一张 760px 高的空壳罩在两栏输入上是给 PDF 用的 */
.ship-box { width: min(560px, 100%); height: auto; max-height: 86vh; overflow: auto; }
.ship-box-body { padding: 14px; }
.ship-box-body .pf-grid { gap: 14px 16px; }
.ship-box-body .cat-form { margin: 14px 0 0; max-width: none; }
.ship-box-body #shipBoxHint { margin: 12px 0 0; }
.ship-box-body #shipBoxIssue:not(:empty) { margin-top: 8px; }
/* 撤销登记是这一页唯一"会清空已写过的东西"的动作，脸色必须和另两颗分开 */
.btn-ghost.danger { border-color: var(--danger-line); color: var(--danger); background: var(--danger-wash); }
.btn-ghost.danger:hover { background: var(--danger-wash); }

@media (max-width: 620px) {
  .ship-region { grid-template-columns: 1fr; }
  .ship-export-btns { flex: 1 1 100%; }
}

@media (max-width: 420px) {
  .buy-bar { gap: 5px; padding-left: 8px; padding-right: 8px; }
  /* 两个主按钮先让尺寸，图标格（客服/购物车）让出来的宽度本来就够整词放下 */
  .bar-btn { padding: 12px 9px; font-size: 12.5px; }
  .bar-total em { display: none; }
  .pd-title { font-size: 16.5px; }
  .pd-price { font-size: 21px; }
  .cart-item { grid-template-columns: 18px 58px minmax(0, 1fr); }
  .cart-thumb { width: 58px; height: 58px; }
  .tabbar span { font-size: 11.5px; letter-spacing: 0; }
  .xp-head { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; }
  .xp-avatar { width: 34px; height: 34px; }
  .xp-btn { padding: 7px 10px; font-size: 12px; }
  .chat-msg { max-width: 88%; }
}

/* ---------- 问专家：全局提醒横幅 ---------- */
.expert-alert {
  display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 10px 12px;
  border: 1px solid var(--gold-light); border-left: 3px solid var(--gold); border-radius: 12px;
  background: var(--warning-wash); box-shadow: var(--shadow); color: var(--text); font-size: 13px;
}
.expert-alert svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.expert-alert span { flex: 1; min-width: 0; }
.expert-alert-go { flex: none; font-size: 12.5px; font-weight: 600; color: var(--on-primary); background: var(--primary); border: 0; border-radius: 999px; padding: 5px 14px; cursor: pointer; transition: var(--transition); }
.expert-alert-go:hover { background: var(--primary-hover); }
.expert-alert-x { flex: none; width: 24px; height: 24px; font-size: 16px; line-height: 1; color: var(--text-secondary); background: transparent; border: 0; border-radius: 999px; cursor: pointer; }
.expert-alert-x:hover { background: rgba(124, 74, 36, .12); }

/* ---------- 问专家：专家卡与在线点 ---------- */
.xp-card { border: 1px solid var(--border); border-radius: 12px; background: var(--paper-0); padding: 12px 13px; margin-bottom: 10px; }
.xp-card.open { border-color: var(--gold); box-shadow: var(--shadow); }
.xp-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.xp-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; background: var(--paper-2); color: var(--primary); font-size: 15px; font-weight: 700; }
.xp-id { min-width: 0; }
.xp-id b { display: block; font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.xp-state { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-secondary); }
.xp-dot { flex: none; width: 7px; height: 7px; border-radius: 999px; background: var(--text-muted); }
.xp-dot.on { background: var(--success); box-shadow: 0 0 0 3px rgba(63, 107, 74, .18); }
.xp-btn { flex: none; padding: 7px 13px; font-size: 12.5px; }
.xp-bio { margin: 8px 0 0; font-size: 12.5px; line-height: 1.75; color: var(--text-secondary); }
.xp-bio.mute { color: var(--text-muted); }
.xp-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 2px 0 12px; }
.xp-stat { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); }
.xp-stat b { font-size: 14.5px; font-weight: 700; color: var(--text); }

/* ---- 智能助手：身份角标、班次、点名字展开的档案（口径全来自 logic.js/服务端，CSS 只负责长得像标签） ---- */
.xp-name {
  display: block; width: 100%; min-width: 0; padding: 0; border: 0; background: none;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text); text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.xp-name:hover, .xp-name:hover .xp-tag { color: var(--primary); border-color: var(--gold); }
.xp-tag {
  flex: none; display: inline-block; vertical-align: 1.5px; margin-left: 5px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--paper-2);
  font-style: normal; font-size: 10px; font-weight: 600; line-height: 17px; color: var(--primary);
}
.xp-duty {
  flex: none; display: inline-block; vertical-align: 1.5px; margin-left: 4px; padding: 0 6px;
  border-radius: 999px; background: var(--paper-1); font-style: normal; font-size: 10px; line-height: 17px; color: var(--text-muted);
}
.xp-duty.on { background: rgba(63, 107, 74, .14); color: var(--success); }
.xp-rot { min-width: 0; }
.xp-profile {
  margin: 9px 0 0; padding: 9px 0 0; border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.xpp-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 9px; align-items: start; }
.xpp-row dt { font-size: 11.5px; color: var(--text-muted); }
.xpp-row dd { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--text-secondary); }
.chip-sys {
  flex: none; display: inline-block; padding: 0 6px; border: 1px dashed var(--gold); border-radius: 999px;
  font-size: 10px; line-height: 16px; color: var(--primary); background: rgba(168, 118, 42, .08);
}

/* ---- 专家公开卡片：真人形象照与「已核验」角标（v1.50） ----
 * 形象照沿用 .xp-avatar 的 38px 圆框，只把底色换成"这是一张照片"：不加边框会让一张
 * 浅色自拍看起来像没加载出来的头像；核验标记与「智能助手」那枚同形不同色，
 * 因为两枚说的不是一回事（一个是系统身份，一个是人工比对过原件）。 */
.xp-avatar.xp-photo { background: var(--paper-1); object-fit: cover; border: 1px solid var(--border); }
.xp-verified {
  flex: none; display: inline-block; vertical-align: 1.5px; margin-left: 5px; padding: 0 6px;
  border: 1px solid rgba(63, 107, 74, .4); border-radius: 999px; background: rgba(63, 107, 74, .12);
  font-style: normal; font-size: 10px; font-weight: 600; line-height: 17px; color: var(--success);
}

/* ---------- 专家入驻申请（#/expert-apply）与 #/ask 上的入驻入口 ----------
 * 这一页的栏位、材料类、上限全由服务端下发，CSS 只负责"一格里放得下两张图也不会撑破"：
 * 任何数字都不写在这里，界面不猜服务端给了几栏。 */
.ea-entry .row-actions { margin: 8px 0 0; }
.ea-entry a.btn { text-decoration: none; }
.ea-lack {
  margin: 8px 0 0; padding: 8px 10px; border-radius: 9px; background: var(--warning-wash);
  font-size: 12px; line-height: 1.75; color: var(--text-secondary); overflow-wrap: anywhere;
}
.ea-lack b { display: inline-block; margin-right: 5px; color: var(--warning); }
.ea-ok { margin: 8px 0 0; font-size: 12px; line-height: 1.7; color: var(--success); }
.ea-sub { margin: 6px 0 0; font-size: 11.5px; color: var(--text-muted); }
.ea-agree { margin: 10px 0 0; align-items: flex-start; line-height: 1.7; }
.ea-agree input[type=checkbox] { margin-top: 2px; }
.ea-list { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.ea-list li { font-size: 12px; line-height: 1.7; color: var(--text-secondary); }
.ea-why { margin: 5px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--text-muted); }
.ea-why b { color: var(--text-secondary); }

.ea-doc { margin-top: 10px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--paper-0); }
.ea-doc.lack { border-color: var(--warning); background: var(--warning-wash); }
.ea-doc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.ea-doc-head b { font-size: 13px; font-weight: 600; color: var(--text); }
.ea-need {
  flex: none; padding: 0 6px; border-radius: 999px; background: rgba(191, 90, 74, .12);
  font-style: normal; font-size: 10px; line-height: 17px; color: var(--danger);
}
.ea-count { flex: none; font-style: normal; font-size: 11px; color: var(--text-muted); }
.ea-doc-head .mini-btn { margin-left: auto; }
.ea-strip { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 9px; }
.ea-cell { width: 112px; }
.ea-img {
  display: block; width: 112px; height: 112px; object-fit: cover;
  border: 1px solid var(--border); border-radius: 9px; background: var(--paper-1);
}
/* 删除按钮摆在照片**下面**而不是叠在上面：这一页是给人对着证件原件核对用的，
 * 压住任何一个角都可能正好压住他要确认的那一行字（证件号、国徽面、发证机关）。 */
.ea-cell .mini-btn { margin-top: 5px; width: 100%; }

.ask-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 9px; }
.ask-form .hint { margin: 0; }
.ask-text { resize: vertical; min-height: 84px; line-height: 1.7; }
.ask-rep { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-secondary); }

/* ---------- 咨询列表行（我的咨询 / 工作台 / 工作参考共用） ---------- */
.th-list { display: flex; flex-direction: column; gap: 8px; }
.th-line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--paper-0);
  text-decoration: none; transition: var(--transition);
}
.th-line:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.th-line.new { border-color: var(--gold); background: var(--warning-wash); }
.th-main { min-width: 0; }
.th-main b { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.th-main i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.th-r { text-align: right; white-space: nowrap; }
.th-r em { font-style: normal; }
.th-r i { display: block; font-style: normal; font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.th-rep { font-size: 11.5px; color: var(--primary); text-decoration: none; }

/* ---------- 专家舌象评审（#/expert 第三段，P2 回流闭环） ---------- */
.tr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tr-item {
  display: flex; flex-direction: column; gap: 6px; padding: 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); border-radius: 11px; background: var(--paper-0); transition: var(--transition);
}
.tr-item.on { border-color: var(--gold); background: var(--warning-wash); }
.tr-thumb { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; background: var(--paper-1); }
.tr-meta { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--text-muted); }
.tr-meta b { color: var(--text); }
.tr-body { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 14px; }
.tr-large { width: 100%; max-height: 420px; object-fit: contain; border-radius: 10px; background: var(--paper-1); }
.tr-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tr-section { font-size: 12px; color: var(--text-secondary); }
.tr-bars { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.tr-bar { display: grid; grid-template-columns: 76px 1fr 28px; gap: 8px; align-items: center; }
.tr-bar i { display: block; height: 6px; border-radius: 999px; background: var(--gold); }
.tr-bar b { text-align: right; font-weight: 500; }
.tr-checks { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.tr-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.tr-grades { display: flex; gap: 8px; margin-top: 6px; }
.tr-section .input { min-height: 70px; resize: vertical; }
@media (max-width: 640px) { .tr-body { grid-template-columns: 1fr; } }
.th-rep:hover { color: var(--primary-hover); }

/* ---------- 咨询会话 ---------- */
.chat-card { display: flex; flex-direction: column; gap: 10px; }
.chat-peer { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.chat-note { margin: 0; font-size: 12px; line-height: 1.7; color: var(--warning); background: var(--warning-wash); border-radius: 9px; padding: 7px 10px; }
.chat-note.mute { color: var(--text-secondary); background: var(--wash-hover); }
.chat-list { display: flex; flex-direction: column; gap: 10px; max-height: min(52vh, 420px); overflow-y: auto; padding: 2px; }
.chat-msg { display: flex; flex-direction: column; gap: 3px; max-width: 82%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.chat-meta { display: flex; flex-wrap: wrap; gap: 3px 7px; font-size: 10.5px; color: var(--text-muted); }
.chat-source {
  flex: none; display: inline-block; padding: 0 6px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--paper-2); font-size: 10px; line-height: 16px; color: var(--primary); white-space: nowrap;
}
.chat-body {
  margin: 0; padding: 8px 11px; border-radius: 12px; border-top-left-radius: 4px;
  font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word;
  background: var(--paper-2); color: var(--text);
}
.chat-msg.mine .chat-body { background: var(--primary); color: var(--on-primary); border-top-left-radius: 12px; border-top-right-radius: 4px; }
.chat-msg.pending .chat-body { opacity: .72; }
.chat-sending { color: var(--primary); }
.chat-send { display: flex; align-items: flex-end; gap: 8px; }
.chat-send .input { flex: 1; min-width: 0; resize: vertical; }

/* ---------- 后台客服工作台：左用户列表 / 中会话 / 右预设答案 ---------- */
.svc-wrap {
  display: grid; grid-template-columns: 216px minmax(0, 1fr) 302px; gap: 12px;
  height: calc(100vh - 190px); min-height: 460px;
}
.svc-side, .svc-chat, .svc-canned {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
}
/* 三栏各自有一行标题，客服扫一眼就知道自己站在哪一栏 */
.svc-pane-head {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--border); background: var(--paper-1);
}
.svc-pane-head .input { flex: 1; min-width: 0; height: 28px; padding: 3px 8px; font-size: 12px; }
.svc-users, .ck-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.svc-users { display: flex; flex-direction: column; gap: 2px; }
.svc-user {
  width: 100%; flex: none; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 7px;
  align-items: center; padding: 8px; border: 0; border-radius: 9px; background: none;
  font: inherit; color: var(--text-secondary); text-align: left; cursor: pointer; transition: var(--transition);
}
.svc-user:hover { background: var(--bg); }
.svc-user.on { background: var(--paper-1); box-shadow: inset 3px 0 0 var(--gold); }
.svc-ava {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; font-size: 12.5px; font-weight: 600;
}
.svc-uinfo { min-width: 0; }
.svc-uinfo b { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.svc-uinfo i { display: block; margin-top: 2px; font-size: 11px; font-style: normal; color: var(--text-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.svc-ur { text-align: right; white-space: nowrap; }
.svc-ur em { font-style: normal; }
.svc-ur i { display: block; margin-top: 3px; font-size: 10px; font-style: normal; color: var(--text-muted); }
.svc-agents { flex: none; padding: 8px 11px; border-top: 1px dashed var(--border); font-size: 11px; line-height: 1.7; color: var(--text-muted); }
.svc-agents i { display: block; font-style: normal; font-weight: 600; color: var(--text-secondary); }
.svc-agents em { display: block; font-style: normal; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.svc-chat-head {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 13px;
  border-bottom: 1px solid var(--border); background: var(--paper-1); font-size: 12.5px;
}
.svc-chat-head b { font-size: 13px; }
.svc-chat-head .xp-state { flex: 1; }
/* 会话区里那一列消息才是主角：让它吃掉剩余高度，别沿用前台的 52vh 上限 */
.svc-chat .chat-list { flex: 1; max-height: none; padding: 12px 13px; }
.svc-chat .chat-send { flex: none; padding: 0 13px; }
.svc-chat .hint { flex: none; margin: 8px 13px 12px; }
.svc-chat.empty { display: grid; place-items: center; }
.ck-list { gap: 8px; display: flex; flex-direction: column; }
.ck-item { border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; background: var(--paper-0); }
.ck-item.mine { border-color: var(--border); background: var(--paper-1); }
.ck-head { display: flex; align-items: center; gap: 6px; }
.ck-head b { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ck-head .lv { flex: none; font-style: normal; }
.ck-use { flex: none; font-size: 10.5px; font-style: normal; color: var(--text-muted); }
.ck-body {
  margin: 5px 0 0; font-size: 12px; line-height: 1.7; color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-word; max-height: 74px; overflow: hidden;
}
.ck-foot { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.ck-by { font-size: 11px; color: var(--text-muted); }
.ck-acts { display: flex; gap: 6px; margin-left: auto; }
/* 复制与发送是客服最高频的两个动作：做成图标块，一眼找得到，不靠文字猜 */
.ck-btn {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line-input); border-radius: 8px; background: var(--card); color: var(--primary);
  transition: var(--transition);
}
.ck-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ck-btn:hover { border-color: var(--gold); background: var(--wash-hover); }
.ck-btn.send { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ck-btn.send:hover { background: var(--primary-hover); }
.ck-cell { max-width: 420px; font-size: 12px; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }
.ck-form {
  display: flex; flex-direction: column; gap: 9px; margin: 12px 0; padding: 12px;
  border: 1px dashed var(--border); border-radius: 11px; background: var(--paper-0);
}
.ck-form textarea.input { resize: vertical; line-height: 1.7; }

@media (max-width: 1340px) {
  .svc-wrap { grid-template-columns: 190px minmax(0, 1fr) 264px; }
}
@media (max-width: 1079px) {
  /* 窄一点的屏先把话术栏挪到底下：左栏与会话是主链路，宁可不看话术也要两边都留够宽 */
  .svc-wrap { grid-template-columns: 190px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 250px; }
  .svc-canned { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .svc-wrap { display: block; height: auto; }
  .svc-side { height: 262px; margin-bottom: 10px; }
  .svc-chat { height: 62vh; min-height: 380px; margin-bottom: 10px; }
  .svc-canned { height: 300px; }
}

/* ---------- 外部商品：粘贴导入、字段锁面板与同步留痕 ---------- */
/* 粘贴框是这一页的主角：一份快照动辄几十行。等宽字体、固定下限高度、可纵向拖——
   三者缺一，运营核对的其实是引号落在第几列，而不是内容对不对 */
.offer-ta { min-height: 236px; font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.65; resize: vertical; }
.offer-ops { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin-top: 10px; }
.offer-fld { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-muted); }
.offer-fld .input { width: auto; min-width: 190px; }
/* 传上来的图那一横条：地址是"要粘进快照的那一行"，不是装饰，省略号截掉就等于让人去猜 */
.offer-imgs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.offer-imgchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.offer-imgchip img { width: 24px; height: 24px; flex: none; border-radius: 5px; object-fit: cover; }
.offer-imgchip code { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-secondary); }
.offer-keys { margin-top: 12px; }
.offer-keys > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.offer-keys > summary .pf-sub { display: block; margin-top: 2px; font-style: normal; font-weight: 400; font-size: 11px; color: var(--text-muted); }
.offer-keys[open] > summary { margin-bottom: 10px; }
.offer-keys code { font-family: Consolas, "Courier New", monospace; font-size: 11.5px; color: var(--primary); }
.offer-keynote { min-width: 260px; max-width: 520px; line-height: 1.65; color: var(--text-secondary); }
.offer-detail { min-width: 200px; max-width: 400px; font-size: 11.5px; line-height: 1.7; color: var(--text-secondary); word-break: break-word; }
/* 商品格：44px 方图贴两行文字。图小是有意的——这一列要的是"认得出是哪一件"，不是主图展示 */
.offer-goods { display: flex; align-items: center; gap: 8px; min-width: 210px; }
.offer-thumb { width: 44px; height: 44px; flex: none; border: 1px solid var(--border); border-radius: 6px; object-fit: cover; background: var(--adm-canvas); }
/* 没有图是这一列最该看得见的一种失败：留一片空白就没人去查 */
.offer-noimg { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border: 1px dashed var(--border); border-radius: 6px; font-size: 10.5px; color: var(--text-muted); }
.offer-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.offer-alerts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; min-width: 150px; }
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 锁面板嵌在表行里：底色必须和主行分开，否则勾完不记得自己开的是哪一件 */
.offer-lockrow > td { background: var(--adm-canvas); border-bottom: 1px solid var(--border); }
.offer-lockbox { display: flex; flex-direction: column; gap: 10px; max-width: 780px; }
.offer-lockbox > b { font-size: 12.5px; }
.offer-lockopts { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.offer-lockopt { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); cursor: pointer; }
.offer-lockopt input { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.offer-lockbox .offer-ops, .offer-lockbox .hint { margin-top: 0; }

@media (max-width: 620px) {
  .offer-imgchip code { max-width: 140px; }
  .offer-fld .input { min-width: 150px; }
}

/* ---------- 「宣纸·艾烟·朱砂印」识别层 ----------
   换肤的"版式与识别"那一半集中在这里，只叠不抢、值全部走令牌（这一段的新增字面 hex 为 0）。
   层级靠三道线立起来：顶栏那一节金线（.topbar::after）、标题左侧的经线（.card-title/.sec-title）、
   状态与提醒上的印泥环（.lv/.chip/.disclaimer）。字体族是第四道：标题与体质名走宋体，正文仍无衬线。 */

/* 导航选中态：指示条从纯色短杠升成一段金→褐的经线，和标题那道同族 */
.tabbar a.on::after { width: 24px; height: 3px; background: linear-gradient(90deg, var(--gold), var(--primary)); }
.sub-tab.on { box-shadow: inset 0 0 0 1px rgba(251, 246, 236, .26); }
.qf-tab.on { box-shadow: inset 0 0 0 1px rgba(251, 246, 236, .22), 0 2px 8px rgba(74, 47, 22, .22); }
.progress-bar { background: linear-gradient(90deg, var(--primary), var(--primary-light) 45%, var(--gold)); }
.opt.sel { box-shadow: inset 0 0 0 1px var(--success); font-weight: 600; }

/* 状态徽章补一圈同族深边：浅色 wash 单独放在纸面上分不出"是状态"还是"是装饰" */
.lv { border: 1px solid transparent; }
.lv-yes { border-color: var(--danger); }
.lv-tend, .lv-basic { border-color: var(--warning); }
.lv-ok { border-color: var(--success); }

/* 标题族：凡"一段话的名字"都用宋体，和正文的无衬线拉开一档 */
.sec-title { font-family: var(--font-song); letter-spacing: 1px; border-left: 3px solid transparent; border-image: linear-gradient(180deg, var(--gold), var(--primary)) 1; }
.acu-name { font-family: var(--font-song); letter-spacing: 2px; }
.advice-block h4 { font-family: var(--font-song); letter-spacing: 1px; }
.report-headline, .report-primary { font-family: var(--font-song); }
.report-primary { box-shadow: inset 0 0 0 1px rgba(251, 246, 236, .28); }
/* 报告页眉顶那道极淡的墨线：把"这是一份医案"和"这是一堆卡片"分开 */
.report-head { position: relative; }
.report-head::before {
  content: ""; position: absolute; top: 8px; left: 22%; right: 22%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* 免责与禁忌：全站唯一允许出现朱砂竖线的两处，提醒访客"这一句要读完" */
.disclaimer { border-left: 3px solid var(--seal); }

/* 空态不留白屏：给一个虚线纸框，把"还没有"说成一件可辨认的事 */
.hist-empty { border: 1px dashed var(--border); border-radius: var(--r-lg); background: var(--paper-1); }

/* 提示条压一道内环，深墨在纸面上不至于像一块没洗掉的污迹 */
.toast { border: 1px solid rgba(251, 246, 236, .16); }

/* 页脚收口：一条墨线当作卷尾，宽屏上它的宽度和正文同一列 */
.footer { border-top: 1px solid var(--border); }

