/* ============================================================
 * MiGao Mold Studio — 样式
 * ============================================================ */

:root {
  --bg: #eceff5;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --border: #e1e6ef;
  --border-strong: #cfd6e4;
  --text: #1b2130;
  --text-2: #4a5468;
  --muted: #7b8497;
  --primary: #2b5ce6;
  --primary-hover: #1f4dd1;
  --primary-soft: #e9efff;
  --danger: #d63b3b;
  --danger-soft: #fdeaea;
  --warn: #c07a09;
  --warn-soft: #fdf3e0;
  --ok: #0d9463;
  --ok-soft: #e5f7f0;
  --shadow: 0 1px 2px rgba(23, 33, 56, .05), 0 4px 16px rgba(23, 33, 56, .045);
  /* 阴影分三档：1 贴在平面上的卡片，2 浮起来的胶囊 / 弹层，3 盖住内容的大窗。
   * 以前每处手写一串 rgba，深浅全靠改的人估；统一成三档后层次才拉得开。 */
  --shadow-1: 0 1px 2px rgba(23, 33, 56, .05);
  --shadow-2: 0 1px 2px rgba(23, 33, 56, .05), 0 4px 14px rgba(23, 33, 56, .06);
  --shadow-3: 0 2px 8px rgba(23, 33, 56, .06), 0 18px 40px rgba(23, 33, 56, .13);
  /* 键盘聚焦环：和输入框 focus 同一套，不再每处写 3px 不同透明度 */
  --ring: 0 0 0 3px rgba(43, 92, 230, .16);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  /* 右栏宽度只有这一处定义：.main 的栅格用它，礼包浮层（#promo）也照它算
   * 宽度 —— 浮层要「和右栏那张 .report 卡一样宽」，而 .report 的宽度
   * = 右栏 − 两侧 10px 内边距 − 4px 细滚动条，就是 var(--right-col) - 24px。
   * 写死 344px 的旧写法不会跟着断点变，屏一窄就比报告卡瘦一圈。 */
  --right-col: 374px;
}

* { box-sizing: border-box; }

/* UA 的 [hidden]{display:none} 优先级比任何 class 都低 —— 只要元素本身
 * 设了 display（.btn / .chip / .modal 都设了），hidden 就失效。
 * 加 !important 统一兜底，省得每加一个可控显隐的元素就补一条规则。 */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 选中色跟主色走：默认的系统蓝（#3297fd 附近）和这套蓝紫差得远，
 * 选中一段参数名时会有第三种蓝跳出来 */
::selection { background: rgba(43, 92, 230, .18); }

button, input, select { font-family: inherit; }

/* ---------------- 布局 ---------------- */

.app {
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr) 30px;
  height: 100vh;
}

/* ---------------- 顶栏 ---------------- */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(180deg, #ffffff, #fdfeff);
  border-bottom: 1px solid #e3e8f1;
  /* 一条几乎看不见的下投影：顶栏和面板同为白色，只靠 1px 边线会显得两张纸糊在一起 */
  box-shadow: 0 1px 3px rgba(23, 33, 56, .04);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 680;
  font-size: 15px;
  letter-spacing: -.015em;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: linear-gradient(180deg, #3d70f0, #2556dd);
  display: grid;
  place-items: center;
  color: #fff;
  flex: 0 0 auto;
  /* 内高光 + 同色投影：让这块橙色从白顶栏上「鼓」起来，不至于像贴纸 */
  box-shadow: 0 2px 6px rgba(61, 112, 240, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.brand small {
  font-weight: 450;
  color: var(--muted);
  font-size: 11.5px;
  margin-left: 2px;
  letter-spacing: .01em;
}
.brand-mark img{width:25px;height:25px;}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

/* 未连接 / 本地副本是「现在不能用」，不是普通状态，用琥珀色和主色分开：
 * 蓝色会读成「一切正常」，用户点到导出才知道导不了 */
.chip.off {
  background: var(--warn-soft);
  color: var(--warn);
  box-shadow: inset 0 0 0 1px rgba(192, 122, 9, .18);
}

/* .chip.gray 随 3D 预览下方的参数摘要条一起移除（原本只有那一处用） */

/* ---------------- 主区 ---------------- */

.main {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) var(--right-col);
  gap: 1px;
  background: var(--border);
  min-height: 0;
  overflow: hidden;
}

.panel {
  background: var(--panel);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 0 0 24px;
}

/* ---------------- 分组（步骤卡片） ----------------
 * 五个步骤各自是一张独立卡片：留白 + 边框 + 圆角 + 自己的标题栏底色，
 * 全部展开时也能一眼看出「这一块是第几步」，而不是连成一片。
 */

/* 左栏拆成「上滚下固定」两区：1~4 步在 .left-scroll 里滚，
 * 第 5 步整块钉在底部。用 flex 分区而不是 position:fixed —— 宽度自动跟
 * 330 / 300 / 290px 三个断点，不脱离文档流、不遮最后一步、压不到 30px 状态栏。 */
.panel.left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: #eef1f8;
}

.left-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  /* 顶部留白交给一键优化条自己（它要通栏贴顶，负上边距会被 sticky 抵消，
   * 结果把下面第一张卡顶掉 1px、缝隙也没了）。 */
  padding: 0 10px 14px;
}

/* ---------------- 全局滚动条：所有会滚的地方统一用 .left-scroll 这套 4px 细条 ----------------
 * 覆盖：左栏 .left-scroll、右栏正文 .right-scroll 与外层 .panel、导出块 .sec-body、一键优化结果 .note、
 * 字体预览 .font-picker-list、问题列表 .problem-list、弹窗 .modal-card、
 * 教程目录/正文 .help-nav / .help-panes、台账与导出记录 #ledgerList / #jobsList、
 * 用户协议正文 .policy-body、模具市场 .mk-scroll。
 * 右栏正文曾漏在这份清单外，走浏览器默认 15px 粗条，和左栏细条并排很违和。
 * 以前各处各写一套（有的 hover 深一点、有的没 hover），弹窗干脆没写走浏览器默认粗条；
 * 现在集中成一份，页面里不会再出现一个细一个粗。
 *
 * 平时淡到几乎看不见，鼠标移进区域或按上滑块才加深，不抢内容的视觉。
 * width + height 都给 4px：教程窄屏目录会横向滚，横条也得是细的。
 *
 * Chrome 121+ 一旦看到标准属性 scrollbar-width / scrollbar-color，就会整条忽略
 * ::-webkit-scrollbar，自己画一根约 10px 的 thin 条 —— 比原来的 9px 还宽。
 * 所以标准属性只给不认 webkit 伪元素的浏览器（Firefox）；Chromium 走下面的 4px。 */
@supports not selector(::-webkit-scrollbar) {
  .left-scroll,
  .panel,
  .panel.left > .export-dock .sec-body,
  .quickfix .note,
  .font-picker-list,
  .problem-list,
  .modal-card,
  .help-nav,
  .help-panes,
  #ledgerList,
  #jobsList,
  .policy-body,
  .right-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 135, 165, .28) transparent;
  }
}
.left-scroll::-webkit-scrollbar,
.panel::-webkit-scrollbar,
.panel.left > .export-dock .sec-body::-webkit-scrollbar,
.quickfix .note::-webkit-scrollbar,
.font-picker-list::-webkit-scrollbar,
.problem-list::-webkit-scrollbar,
.modal-card::-webkit-scrollbar,
.mk-scroll::-webkit-scrollbar,
.help-nav::-webkit-scrollbar,
.help-panes::-webkit-scrollbar,
#ledgerList::-webkit-scrollbar,
#jobsList::-webkit-scrollbar,
.policy-body::-webkit-scrollbar,
.right-scroll::-webkit-scrollbar { width: 4px; height: 4px; }
.left-scroll::-webkit-scrollbar-track,
.panel::-webkit-scrollbar-track,
.panel.left > .export-dock .sec-body::-webkit-scrollbar-track,
.quickfix .note::-webkit-scrollbar-track,
.font-picker-list::-webkit-scrollbar-track,
.problem-list::-webkit-scrollbar-track,
.modal-card::-webkit-scrollbar-track,
.mk-scroll::-webkit-scrollbar-track,
.help-nav::-webkit-scrollbar-track,
.help-panes::-webkit-scrollbar-track,
#ledgerList::-webkit-scrollbar-track,
#jobsList::-webkit-scrollbar-track,
.policy-body::-webkit-scrollbar-track,
.right-scroll::-webkit-scrollbar-track { background: transparent; }
.left-scroll::-webkit-scrollbar-thumb,
.panel::-webkit-scrollbar-thumb,
.panel.left > .export-dock .sec-body::-webkit-scrollbar-thumb,
.quickfix .note::-webkit-scrollbar-thumb,
.font-picker-list::-webkit-scrollbar-thumb,
.problem-list::-webkit-scrollbar-thumb,
.modal-card::-webkit-scrollbar-thumb,
.mk-scroll::-webkit-scrollbar-thumb,
.help-nav::-webkit-scrollbar-thumb,
.help-panes::-webkit-scrollbar-thumb,
#ledgerList::-webkit-scrollbar-thumb,
#jobsList::-webkit-scrollbar-thumb,
.policy-body::-webkit-scrollbar-thumb,
.right-scroll::-webkit-scrollbar-thumb {
  background: rgba(120, 135, 165, .28);
  border: 0;
  border-radius: 99px;
}
.left-scroll:hover::-webkit-scrollbar-thumb,
.panel:hover::-webkit-scrollbar-thumb,
.panel.left > .export-dock .sec-body:hover::-webkit-scrollbar-thumb,
.quickfix .note:hover::-webkit-scrollbar-thumb,
.font-picker-list:hover::-webkit-scrollbar-thumb,
.problem-list:hover::-webkit-scrollbar-thumb,
.modal-card:hover::-webkit-scrollbar-thumb,
.mk-scroll:hover::-webkit-scrollbar-thumb,
.help-nav:hover::-webkit-scrollbar-thumb,
.help-panes:hover::-webkit-scrollbar-thumb,
#ledgerList:hover::-webkit-scrollbar-thumb,
#jobsList:hover::-webkit-scrollbar-thumb,
.policy-body:hover::-webkit-scrollbar-thumb,
.right-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(120, 135, 165, .48);
}
.left-scroll::-webkit-scrollbar-thumb:hover,
.panel::-webkit-scrollbar-thumb:hover,
.panel.left > .export-dock .sec-body::-webkit-scrollbar-thumb:hover,
.quickfix .note::-webkit-scrollbar-thumb:hover,
.font-picker-list::-webkit-scrollbar-thumb:hover,
.problem-list::-webkit-scrollbar-thumb:hover,
.modal-card::-webkit-scrollbar-thumb:hover,
.mk-scroll::-webkit-scrollbar-thumb:hover,
.help-nav::-webkit-scrollbar-thumb:hover,
.help-panes::-webkit-scrollbar-thumb:hover,
#ledgerList::-webkit-scrollbar-thumb:hover,
#jobsList::-webkit-scrollbar-thumb:hover,
.policy-body::-webkit-scrollbar-thumb:hover,
.right-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(90, 110, 145, .68);
}

/* 一键优化：钉在左栏最上面，滚动时按钮一直可点。
 *
 * 它不属于五步流程里的任何一步 —— 所以不套 .sec 的编号 / 折叠 / 完成徽标，
 * 只做一条更窄的高亮带，免得和下面的步骤卡抢视觉。放在顶部是因为
 * 「不懂参数的人」进来第一眼就该看到它，而不是滚到第 3 步末尾才发现。
 *
 * 只有按钮那条 sticky；点击后的结果说明是普通文档流 —— 否则一条长长的
 * 优化报告会一直钉在顶部，把左栏压掉三分之一。 */
.quickfix {
  margin: 0 0 10px;
}
.quickfix .qf-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 -10px;
  padding: 10px;
  background: linear-gradient(180deg, #e6edfc 0%, #eef1f8 100%);
  border-bottom: 1px solid #d5deef;
}
.quickfix .qf-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quickfix .qf-text b {
  font-size: 12.5px;
  color: #1e3f7d;
  letter-spacing: -.01em;
}
.quickfix .qf-text span {
  font-size: 11px;
  line-height: 1.45;
  color: #63718c;
}
.quickfix .btn {
  flex: none;
  white-space: nowrap;
  padding: 9px 11px;
  font-size: 12px;
}
.quickfix .note {
  margin-top: 8px;
  max-height: 176px;
  overflow: auto;
}
.sec {
  position: relative;
  border: 1px solid #dfe6f1;
  border-radius: var(--radius);
  background: var(--panel);
  /* 卡片间距 5 → 8：五张卡贴在一起时看不出边界，反而像一张长表；
   * 拉开 3px 后每张卡的圆角和投影才成立 */
  margin-bottom: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.sec:last-child { margin-bottom: 0; }

.sec:hover {
  border-color: #cdd8e9;
  box-shadow: 0 2px 10px rgba(23, 33, 56, .07);
}

/* 展开的那张多给一层投影：五张卡里只有一张是「正在改的」，深度差比边框色更早被看到 */
.sec:not(.collapsed) {
  border-color: #d5e0f1;
  box-shadow: 0 1px 2px rgba(23, 33, 56, .05), 0 6px 18px rgba(23, 33, 56, .06);
}

/* 展开卡再被悬停时加深一档：上面那条 :not(.collapsed) 优先级和 :hover 相同、
 * 又写在后面，不单独补一条的话展开卡移上去毫无反应 */
.sec:not(.collapsed):hover {
  border-color: #c8d7ee;
  box-shadow: 0 2px 4px rgba(23, 33, 56, .06), 0 10px 24px rgba(23, 33, 56, .08);
}

/* 左侧色条：折叠时淡灰，展开时变主题色，作为「当前正在改哪一步」的锚点 */
.sec::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #e7ebf3;
  transition: background .16s ease;
  z-index: 1;
}

.sec:not(.collapsed)::before { background: linear-gradient(180deg, #6f96ff, var(--primary)); }

/* 完成 / 预检失败与「展开与否」无关：
   收起时竖条也保留颜色，否则会出现「徽标是绿的、竖条却退回灰色」的内外不一致 */
.sec.done::before { background: linear-gradient(180deg, #34c08a, #0d9463); }
.sec.fail::before { background: linear-gradient(180deg, #ef6b5e, var(--danger)); }

.sec-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 12px 11px 14px;
  cursor: pointer;
  user-select: none;
  /* 头部的蓝灰渐变收淡一档：五张卡同时露出时，原色会让整栏偏蓝、参数区反而显灰 */
  background: linear-gradient(180deg, #fbfcff, #f3f7fd);
  border-bottom: 1px solid #e7ecf5;
  transition: background .16s var(--ease);
}

.sec.collapsed .sec-head { border-bottom-color: transparent; }
.sec-head:hover { background: linear-gradient(180deg, #f8faff, #eef4fd); }

.sec-num {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid #dee5f0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  transition: background .16s var(--ease), color .16s var(--ease),
              border-color .16s var(--ease), box-shadow .16s var(--ease);
}

.sec:not(.collapsed) .sec-num {
  background: linear-gradient(180deg, #3d70f0, #2556dd);
  border-color: #2556dd;
  color: #fff;
  box-shadow: 0 1px 3px rgba(43, 92, 230, .32), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.sec.done .sec-num {
  background: linear-gradient(180deg, #24b57e, #0d9463);
  border-color: #0d9463;
  color: #fff;
  box-shadow: 0 1px 3px rgba(13, 148, 99, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.sec.fail .sec-num {
  background: linear-gradient(180deg, #e2554f, #cf3434);
  border-color: #cf3434;
  color: #fff;
  box-shadow: 0 1px 3px rgba(214, 59, 59, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
}

/* 完成后用 ✓ / × 顶掉数字，进度不再只靠颜色传达（色弱也能读） */
.sec-num .mark {
  display: none;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

.sec.done .sec-num .n,
.sec.fail .sec-num .n { display: none; }

.sec.done .sec-num .mark.ok { display: block; }
.sec.fail .sec-num .mark.bad { display: block; }

.sec-title {
  font-weight: 650;
  font-size: 14px;
  flex: 1;
  letter-spacing: -.01em;
}

.sec-caret {
  color: #b3bbca;
  transition: transform .18s var(--ease), color .16s var(--ease);
  font-size: 10px;
}

/* 整行可点，但箭头自己不变色的话，鼠标移上去只有底色在动，看不出「这一行是开关」 */
.sec-head:hover .sec-caret { color: var(--text-2); }

.sec.collapsed .sec-caret { transform: rotate(-90deg); }

/* 导出价：标题行右侧的一颗小胶囊。数字比单位大一号，扫一眼就知道这一档
 * 多少钱；带圈的问号提示「移入还有完整扣费表」。 */
.export-price {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  flex: 0 0 auto;
  padding: 3px 7px 3px 8px;
  border: 1px solid #c9d8ff;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  cursor: help;
  white-space: nowrap;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.export-price b {
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
/* 作者写了 display: inline-flex，UA 的 [hidden] 压不住它，得显式兜一条 */
.export-price[hidden] { display: none; }
.export-price-unit { font-size: 10.5px; }
.export-price-q {
  align-self: center;
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  margin-left: 2px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 8.5px;
  font-weight: 700;
  opacity: .75;
}
.export-price:hover,
.export-price:focus-visible {
  border-color: var(--primary);
  background: #e4edff;
  box-shadow: 0 0 0 3px rgba(43, 92, 230, .1);
  outline: none;
}

.sec-body { padding: 13px 12px 14px 14px; }
.sec.collapsed .sec-body { display: none; }

/* ---------------- 控件 ---------------- */

.row {
  margin-bottom: 11px;
}

.row:last-child { margin-bottom: 0; }

/* 派生值行（字板外框）：没有滑块，标签后直接跟算出来的数 + 公式说明。 */
.row-readonly .lbl b { color: var(--primary); }

.lbl {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12.5px;
  color: var(--text-2);
}

.lbl b {
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

.lbl .unit {
  color: var(--muted);
  font-weight: 450;
  font-size: 11.5px;
  margin-left: 2px;
}

/* 参数说明的「?」：跟着标题走，说明只在悬停/聚焦时才浮出来。
 *
 * 左栏原本把这些说明都排成常驻正文 —— 光「每格一字」一条就 9 行，一屏放不下
 * 三个参数。收进图标后同样的高度能多放一倍参数，扫参数时也不会被大段文字打断。
 * 尺寸刻意做到 13px：再小点不中，再大就把 12.5px 的标题顶高。 */
.q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  margin-left: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: 1px;
  flex: none;
  transition: border-color .14s, color .14s, background .14s;
}

.q::before { content: '?'; }

.q:hover,
.q:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  outline: none;
}

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  cursor: pointer;
  display: block;
}

input[type=range]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(180deg, #e3e8f2, #eef2f8);
  box-shadow: inset 0 1px 1px rgba(23, 33, 56, .06);
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  margin-top: -5px;
  box-shadow: 0 1px 3px rgba(30, 50, 100, .22);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}

input[type=range]:not(:disabled):hover::-webkit-slider-thumb {
  transform: scale(1.1);
  box-shadow: 0 1px 4px rgba(30, 50, 100, .28), 0 0 0 4px rgba(43, 92, 230, .12);
}

input[type=range]::-moz-range-track {
  height: 5px; border-radius: 99px; background: #e7ecf4;
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary);
  box-shadow: 0 1px 3px rgba(30, 50, 100, .22);
}

/* 规格锁定的滑块：轨道、± 都灰了，圆点也得跟着灰，别让人以为还能拖。
 * 用 :disabled 而不是类名，所有锁滑块的路径一次覆盖；hover 放大也只在可用态生效。 */
input[type=range]:disabled { cursor: not-allowed; }
input[type=range]:disabled::-webkit-slider-thumb {
  border-color: #aab4c6;
  box-shadow: 0 1px 2px rgba(30, 50, 100, .10);
}
input[type=range]:disabled::-moz-range-thumb {
  border-color: #aab4c6;
  box-shadow: 0 1px 2px rgba(30, 50, 100, .10);
}

/* 滑块两侧的 − / + 微调按钮。拖动不精确时一下一下点，按 step 走。
 * 滑块在 flex 容器里要 min-width:0，否则 Firefox 下会撑破容器。 */
.range-ctl {
  display: flex;
  align-items: center;
  gap: 7px;
}
.range-ctl input[type=range] {
  flex: 1;
  min-width: 0;
}
/* 常规态就用蓝色，让「能点」一眼可见，不靠悬停才提示；
 * hover 只做加深反馈，禁用态必须显式盖回灰（否则会继承默认蓝边蓝字）。 */
.range-step {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.range-step:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: #dbe5ff;
}
.range-step:active:not(:disabled) { background: #c9d8ff; }
.range-step:focus-visible { outline: none; box-shadow: var(--ring); }
.range-step:disabled {
  opacity: .45;
  cursor: not-allowed;
  background: var(--panel-2);
  border-color: var(--border-strong);
  color: var(--text-2);
}

.seg {
  display: flex;
  /* 轨道压一层内阴影：白块浮在灰底上，才像「在一排格子里选了这一格」 */
  background: #e9eef7;
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
  box-shadow: inset 0 1px 2px rgba(23, 33, 56, .06);
}

.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 500;
  transition: background .14s var(--ease), color .14s var(--ease), box-shadow .14s var(--ease);
  white-space: nowrap;
}

.seg button:hover { color: var(--text); }

/* 锁掉的选项（预制规格不支持的格数）：灰掉但仍占位，一眼看出「有这一档、
 * 只是这套规格没有」。直接隐藏会让人以为少了一行。 */
.seg button:disabled {
  opacity: .38;
  cursor: not-allowed;
}
.seg button:disabled:hover { color: var(--text-2); }

.seg button.on {
  background: #fff;
  color: var(--primary);
  font-weight: 640;
  /* 一圈极淡的主色描边，把「选中」从阴影里再说一遍 —— 浅灰底上光靠投影不容易分辨 */
  box-shadow: 0 1px 2px rgba(30, 50, 100, .12), 0 0 0 1px rgba(43, 92, 230, .1);
}

/* 素材切换：图片 / 文字，占满整行 */
.seg-wide { margin-bottom: 11px; }
.seg-wide button { padding: 7px 8px; }

/* 一行里并排放控件 */
.row.inline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row.inline .seg { flex: 1; }
.check.tight { padding: 0; white-space: nowrap; }

/* B / I 字形开关：两个独立开关，可同时按下（区别于左中右那种互斥 seg）。
 * 用衬线体写 B/I 更像编辑器里的加粗/倾斜图标，按下态用主色底 + 白字。 */
.style-tog { display: flex; gap: 5px; flex: 0 0 auto; }
.style-tog button {
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text-2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.style-tog button b { font-weight: 700; }
.style-tog button i { font-style: italic; }
.style-tog button:hover { border-color: var(--primary); color: var(--primary); }
.style-tog button.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(43, 92, 230, .25);
}

/* 字体行下方的按钮行。现在只剩「导入字体文件」，靠右对齐 */
.btn-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
#btnFontFile { margin-left: auto; }
.btn.sm {
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 500;
  flex: 0 0 auto;
}
.btn.sm.busy { opacity: .6; pointer-events: none; }

/* 导入的字体可以单独删掉 */
.font-del {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.font-del:hover { color: #c0392b; }

/* 字体搜索：原生 <select> 没有检索能力，靠上面这个输入框过滤 option。
 * 保留 select 本身是为了不破坏键盘操作、以及所有依赖 options/optgroup 的逻辑。 */
.font-search-wrap {
  position: relative;
  margin-bottom: 6px;
}
.font-search {
  width: 100%;
  border: 1px solid #dbe2ef;
  background-color: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 28px 7px 28px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Ccircle cx='5' cy='5' r='3.5' fill='none' stroke='%237b8497' stroke-width='1.4'/%3E%3Cpath d='M7.7 7.7L11 11' fill='none' stroke='%237b8497' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 9px center;
}
.font-search::placeholder { color: var(--muted); }
.font-search:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.font-search.nomatch { border-color: var(--danger); }
.font-search-clear {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  line-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}
.font-search-clear:hover { background: var(--panel-2); color: var(--text); }
.font-search-clear[hidden] { display: none; }

/* -------- 字体选择器：触发器 + 就地展开的字形预览面板 --------
 * 原生 select 留着当数据源（搜索过滤、change 通路、测试都走它），
 * 视觉上换成这颗触发器 + 面板。面板就地展开在左栏里（不 position:fixed），
 * 这样滚动左栏时它跟着走、不会被滚动容器裁掉、也不会盖住右侧画布。 */
.native-font-sel { display: none; }

.font-picker { position: relative; }
.font-picker-btn {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px;
  border: 1px solid #dbe2ef;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.font-picker-btn:hover { border-color: var(--primary); }
.font-picker-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.font-picker-btn[aria-expanded="true"] { border-color: var(--primary); box-shadow: var(--ring); }

/* 左边是「输入框当前文字」用该字体渲染出来的样张，字体名在中间，箭头在最右。
 * 样张限宽单行省略——用户打了一整句也别把按钮撑破。 */
.fpb-sample {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  line-height: 1.25;
  color: var(--text);
}
.fpb-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}
.fpb-caret {
  flex: none;
  width: 10px;
  height: 6px;
  fill: none;
  stroke: #6b7488;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .16s var(--ease);
}
.font-picker-btn[aria-expanded="true"] .fpb-caret { transform: rotate(180deg); }

.font-picker-panel[hidden] { display: none; }
.font-picker-panel {
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  box-shadow: var(--shadow-2);
}
.font-picker-panel .font-search-wrap { margin-bottom: 6px; }

/* 列表限高内部滚动：本机字体可能几十个，别把整条左栏顶飞 */
.font-picker-list {
  max-height: 268px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 4px;
}
.fp-group {
  padding: 7px 5px 3px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .02em;
}
.fp-group:first-child { padding-top: 2px; }

/* 每一项：左边样张用该条目的字体渲染（行内 font-family 由 JS 写入），
 * 右边是字体名 + 来源小标。选中项整行高亮并打勾。 */
.fp-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background .12s var(--ease), border-color .12s var(--ease);
}
.fp-item:hover { background: #eef2fb; }
.fp-item:focus-visible { outline: none; border-color: var(--primary); }
.fp-item.on { background: #eaf0ff; border-color: #b9cbff; }

.fp-sample {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  line-height: 1.3;
  color: var(--text);
}
.fp-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--text-2);
}
.fp-tag {
  flex: none;
  font-size: 9.5px;
  line-height: 1.4;
  padding: 1px 5px;
  border-radius: 4px;
  background: #eceff5;
  color: var(--muted);
}
.fp-item.on .fp-tag { background: #dbe6ff; color: #3358b8; }
.fp-check {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  visibility: hidden;
}
.fp-item.on .fp-check { visibility: visible; }

/* 下拉与文本域：与滑块同一套观感 */
.sel,
textarea {
  width: 100%;
  border: 1px solid #dbe2ef;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}

.sel:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
}

textarea {
  resize: vertical;
  min-height: 46px;
  line-height: 1.45;
  font-family: inherit;
}

.sel {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 26px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7488' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--text-2);
  user-select: none;
}

.check input {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #cfd7e6;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  transition: background .14s var(--ease), border-color .14s var(--ease),
              box-shadow .14s var(--ease);
}

.check input:hover { border-color: #a9b6cc; }

.check input:checked {
  background: linear-gradient(180deg, #3d70f0, #2556dd);
  border-color: #2556dd;
  box-shadow: 0 1px 3px rgba(43, 92, 230, .3);
}

.check input:checked::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

.check:hover { color: var(--text); }
.check input:disabled + span { opacity: .45; }

/* ---------------- 上传区 ---------------- */

.drop {
  margin: 15px 16px 4px;
  border: 1.5px dashed #c6d2e6;
  border-radius: var(--radius);
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease),
              box-shadow .16s var(--ease);
  background: linear-gradient(180deg, #fafcff, #f4f7fc);
}

.drop:hover, .drop.over {
  border-color: var(--primary);
  background: linear-gradient(180deg, #f2f6ff, #e9f0ff);
  box-shadow: inset 0 0 0 1px rgba(43, 92, 230, .08);
}

.drop .ico {
  color: #9aa5b9;
  margin-bottom: 7px;
  transition: color .16s var(--ease), transform .16s var(--ease);
}

/* 图标往上提 2px：拖动文件靠近时这块是唯一的变化，静止的虚线框看不出来 */
.drop:hover .ico, .drop.over .ico { color: var(--primary); transform: translateY(-2px); }

.drop .t1 {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 3px;
}

.drop .t2 {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.thumb-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 14px 16px 6px;
  padding: 9px;
  background: #f7f9fd;
  border-radius: var(--radius-sm);
  border: 1px solid #e4eaf4;
  transition: border-color .16s var(--ease);
}
.thumb-row:hover { border-color: #d3dced; }

.thumb-row img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e3e9f3;
  background: #fff;
  flex: 0 0 auto;
}

.thumb-meta {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
}

.thumb-meta .nm {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thumb-meta .dp { color: var(--muted); font-size: 11px; }

.link-btn {
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  font-weight: 550;
  transition: background .14s var(--ease), color .14s var(--ease);
}

.link-btn:hover { background: var(--primary-soft); }
.link-btn.muted { color: var(--muted); }
.link-btn.muted:hover { background: #eef1f7; color: var(--text-2); }

/* ---------------- 画布区 ---------------- */

.stage {
  position: relative;
  /* 网格淡一点（.022 → .028 但线距 22 → 24）、顶部加一层极淡的主色光：
   * 画布是整页最大的白区，纯平会显得空；一点点光就够，别盖过矢量轮廓 */
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(43, 92, 230, .05), transparent 62%),
    linear-gradient(0deg, rgba(23, 33, 56, .028) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(23, 33, 56, .028) 1px, transparent 1px) 0 0 / 24px 24px,
    #f4f6fa;
  min-width: 0;
  overflow: hidden;
}

/* 常驻云雾底噪：盖在网格上、矢量图下。极低透明度 + 上下淡出，
 * 只给大块白画布一点「活的」氛围，不抢轮廓和文字。
 * 0.6 倍分辨率渲染由 js/ambient.js 完成，这里拉伸回来天然带柔化。 */
.ambient-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .46;
  /* 团块边缘再柔一层：噪声阈值已经拉宽，这里补一点真实模糊，
   * 避免刷新瞬间看到硬边的色块轮廓。blur 不改颜色总量，只摊开边界。 */
  filter: blur(9px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 72%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 72%, transparent 100%);
}

#mainCanvas {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#mainCanvas.grabbing { cursor: grabbing; }

/* 测距：十字光标，比抓手更适合「瞄准一个点」 */
#mainCanvas.measuring { cursor: crosshair; }
#mainCanvas.measuring.grabbing { cursor: grabbing; }

/* 测距提示条：和编辑那条一样挂在画布顶栏的右端（位置由 .stage-hints 决定），
 * 这里只管外观 —— 原来是固定在左下角的。
 * 尺寸向 .stage-bar 看齐：胶囊内边距 3px、按钮 28px 高，两块排在一起高度才一致。 */
.measure-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 7px 3px 9px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
}

/* 和编辑那条同理：地方不够先压缩文字，按钮永远完整 */
.measure-hint #measureInfo {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.measure-hint .m-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ff5000;
  flex: none;
}

.measure-hint b {
  color: #b8390e;
  font-variant-numeric: tabular-nums;
}

.measure-hint button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  /* 1px 边框 + 5px 内边距 = 和 .stage-bar 按钮同样的 6px，外框高度一致 */
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .13s;
}

.measure-hint button:hover:not(:disabled) { background: var(--panel-2); }
.measure-hint button:disabled { opacity: .45; cursor: default; }

/* 字板素材档提示条：直接复用 .measure-hint 的外观（圆角胶囊 / 毛玻璃 /
 * 12.5px 字 / 同款按钮），这里只覆盖圆点与文字截断。
 * 用户明确要求「和 stage-hints 里那两条长得一样」，所以不再自己另写一套
 * padding / 边框 / 阴影 —— 以后调提示条样式，一处改三条一起变。 */
.plate-slot-hint #plateSlotHintText {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plate-slot-hint .ps-dot {
  width: 6px; height: 6px; border-radius: 2px;
  background: #ff5000; flex: none;
}
#mainCanvas.placing { cursor: copy; }

/* 编辑提示条：结构和测距那条一致，配色统一用橙（编辑 = 改原始几何）。
 * 位置交给 .stage-top / .stage-hints 决定（顶栏那一排的右端），这里只管外观。
 * 尺寸向 .stage-bar 看齐：胶囊内边距 3px、按钮 28px 高。 */
.edit-hint {
  display: flex;
  align-items: center;
  /* 工具多了之后窄窗口放不下一行：允许折行，宁可占两行也别把按钮挤出画布 */
  flex-wrap: wrap;
  gap: 6px;
  row-gap: 4px;
  max-width: 100%;
  padding: 3px 7px 3px 9px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
}

/* 文字和按钮分成两块：窄窗口折行时整块按钮一起下移，不会拆成两行按钮。
 * 文字允许收缩并打省略号 —— 和左边那排视图按钮抢地方时，先牺牲提示文字的长度，
 * 也不要让整条提示跳到第二行（按钮永远完整，操作不能少）。 */
.edit-hint #editInfo {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edit-hint .eh-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.edit-hint button { flex: none; }

.edit-hint .e-dot {
  width: 6px; height: 6px;
  border-radius: 2px;
  background: #ff5000;
  flex: none;
}

.edit-hint b {
  color: #b8390e;
  font-variant-numeric: tabular-nums;
}

.edit-hint button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  /* 纯图标按钮：固定正方，图标随 currentColor，选中时整颗变白 */
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: background .13s, color .13s;
}
/* 图标统一线性描边：不填充，圆头圆角，和编辑的橙色语义一致 */
.edit-hint button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;   /* 点击落到 button 上，不吃事件 */
}

/* hover 只管「没被选中」的按钮。
 * 坑在这里：:hover 那条多带一个 :not(:disabled)，优先级 (0,3,1) 反而高于
 * .on 的 (0,2,1)，不排除 .on 的话，点中的按钮一 hover 就掉成浅灰底，
 * 而 .on 的白字还在 —— 白底白字，按钮看着像消失了。 */
.edit-hint button:hover:not(.on):not(:disabled) { background: var(--panel-2); }

/* 选中的按钮也要有 hover 反馈：橙底再压深一档，别让人以为点不动 */
.edit-hint button.on:hover:not(:disabled) {
  background: #e64800;
  border-color: #e64800;
}

.edit-hint button:disabled { opacity: .45; cursor: default; }
.edit-hint button.on {
  background: #ff5000;
  border-color: #ff5000;
  color: #fff;
  font-weight: 600;
}

/* 编辑模式的十字光标：和平移的 grab 明确区分 */
#mainCanvas.editing { cursor: crosshair; }

/* 画布顶栏：视图切换（左）+ 编辑提示条（右）共用一排。
 *
 * 两块都是浮在画布上的胶囊，各自绝对定位过——但那样窗口一窄就会互相压住。
 * 收进这个容器统一排版：左边贴左、右边贴右，真放不下时整条提示条折到第二行
 * （仍靠右），绝不重叠。
 *
 * pointer-events: none 让容器空出来的中间区域仍然可以拖画布。
 */
.stage-top {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  z-index: 5;
  pointer-events: none;
}

.stage-top > * { pointer-events: auto; }

/* 右端那一组提示条：测距和编辑互斥，同一时刻只会露一条；
 * 万一将来两条同时开着，也是并排靠右，不会叠在一起。 */
.stage-hints {
  margin-left: auto;      /* 吃掉剩余空间 → 整组贴右 */
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.stage-hints > * { flex: 0 1 auto; min-width: 0; }

.stage-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  background: rgba(255, 255, 255, .93);
  border: 1px solid rgba(219, 226, 240, .95);
  border-radius: 10px;
  padding: 3px;
  /* 玻璃感：半透明白 + 模糊，压在矢量图上也不会把底下的线切断成一块死白 */
  box-shadow: 0 1px 2px rgba(23, 33, 56, .06), 0 6px 18px rgba(23, 33, 56, .07);
  backdrop-filter: blur(10px) saturate(150%);
}

.stage-bar button {
  border: 0;
  background: transparent;
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  font-weight: 500;
  transition: all .13s;
  white-space: nowrap;
}

.stage-bar button:hover { background: #f1f4fa; color: var(--text); }

/* 没导入图案时「测距」是禁用的：得让它看得出来，不然点了没反应像坏了 */
.stage-bar button:disabled { opacity: .4; cursor: not-allowed; }
.stage-bar button:disabled:hover { background: transparent; }

.stage-bar button.on {
  background: linear-gradient(180deg, #3d70f0, #2556dd);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(43, 92, 230, .32);
}

/* 选中的视图按钮也要有 hover 反馈：蓝底压深一档，否则鼠标移上去毫无反应 */
.stage-bar button.on:hover {
  background: linear-gradient(180deg, #3565e8, #1f4dd1);
  color: #fff;
}

.stage-bar .sep {
  width: 1px;
  height: 17px;
  background: var(--border);
  margin: 0 3px;
}

.zoom-ctl {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 1px;
  background: rgba(255, 255, 255, .93);
  border: 1px solid rgba(219, 226, 240, .95);
  border-radius: 9px;
  box-shadow: 0 1px 2px rgba(23, 33, 56, .06), 0 6px 16px rgba(23, 33, 56, .06);
  backdrop-filter: blur(8px);
  overflow: hidden;
  z-index: 5;
}

.zoom-ctl button {
  border: 0;
  background: transparent;
  width: 30px;
  height: 28px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1;
  transition: background .13s var(--ease), color .13s var(--ease);
}

.zoom-ctl button:hover { background: #eef3fd; color: var(--primary); }

.zoom-ctl .val {
  min-width: 46px;
  padding: 0 7px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 右栏底部「运行日志」 ----------------
 * 和左栏导出 Dock 一样钉在面板最底部：标题栏常驻，默认 .collapsed 只露一条；
 * 有日志输出时 syncStageConsole() 去掉 collapsed 自动展开，点标题栏也能手动切。
 * 配色沿用原画布浮层的深色玻璃，透明度从 .84 降到 .70，别压住上方预检报告。
 * 复用 .sec / .sec-head / .sec-body 是为了蹭到既有的整行点击折叠事件。 */
.panel.right > .log-dock {
  flex: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: rgba(23, 30, 48, .70);
  box-shadow: 0 -6px 20px rgba(15, 22, 42, .16);
  color: #cfd9f0;
}
/* .sec 的左侧 3px 竖条换成顶部一条细线，和导出 Dock 同一套「上下分界」语言 */
.panel.right > .log-dock::before {
  left: 0; right: 0; bottom: auto;
  width: auto; height: 1px;
  z-index: 2;
  background: rgba(126, 150, 198, .38);
}
.panel.right > .log-dock .sec-head {
  gap: 7px;
  padding: 9px 12px;
  background: rgba(23, 30, 48, .58);
  border-bottom: 1px solid rgba(126, 150, 198, .18);
  color: #c2d0ec;
}
.panel.right > .log-dock .sec-head:hover { background: rgba(36, 48, 76, .66); }
.panel.right > .log-dock.collapsed .sec-head { border-bottom-color: transparent; }
.log-dock .sc-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: #41d19a;
  box-shadow: 0 0 0 3px rgba(65, 209, 154, .14);
}
.panel.right > .log-dock .sec-title {
  color: #dbe4fa;
  font-size: 12px;
  font-weight: 700;
}
.panel.right > .log-dock .sec-caret { color: #a9bce0; font-size: 9px; }
.panel.right > .log-dock .sec-head:hover .sec-caret { color: #dbe4fa; }
.log-dock .sc-body {
  overflow: auto;
  max-height: 180px;
  padding: 8px 10px 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11.5px;
  line-height: 1.62;
}
/* 控制台里的 .note 换成「日志行」外观：透明底 + 状态色左边框，
 * 不再套左栏那套浅色卡片（深底上会糊成一块）。类名不变，测试照旧读得到。 */
.log-dock .note {
  margin: 0 0 7px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(140, 165, 215, .2);
  border-left: 2px solid rgba(140, 165, 215, .55);
  border-radius: 5px;
  color: #cfd9f0;
  font: inherit;
}
/* 后面还跟着 .sc-empty（隐藏也算 DOM 子元素），所以用倒数第二块找最后一条 note */
.log-dock .note:nth-last-child(2) { margin-bottom: 0; }
/* 空日志提示：只在两块 note 都空、且用户手动展开时露出（.sec.collapsed
 * 已经把整个 .sc-body 藏了）。字号沿用正文，不额外缩小。 */
.log-dock .sc-empty { display: none; padding: 4px 3px 2px; color: #93a3c4; }
.log-dock.empty .sc-empty { display: block; }
.log-dock .sc-empty b {
  display: block;
  margin-bottom: 3px;
  color: #b7c6e4;
  font-size: inherit;
  font-weight: 600;
}
.log-dock .note b { color: #fff; }
/* 这里必须把 background / border-color 也写明：通用 .note.ok/.bad/.warn
 * 定义在文件后面（同为两级选择器），不写就会被它的浅底盖掉，深字配浅底
 * 再加上控制台的浅色文字会糊成一片。 */
.log-dock .note.ok {
  background: rgba(65, 209, 154, .1);
  border-color: rgba(65, 209, 154, .28);
  border-left-color: #41d19a;
  color: #bfe9d7;
}
.log-dock .note.ok b { color: #7ee7b6; }
.log-dock .note.bad {
  background: rgba(255, 122, 122, .1);
  border-color: rgba(255, 122, 122, .28);
  border-left-color: #ff7a7a;
  color: #ffd2d2;
}
.log-dock .note.bad b { color: #ff9a9a; }
.log-dock .note.warn {
  background: rgba(255, 182, 72, .1);
  border-color: rgba(255, 182, 72, .28);
  border-left-color: #ffb648;
  color: #f7dfb4;
}
.log-dock .note.warn b { color: #ffc978; }
.log-dock .note .warn { color: #ffc978; }
.log-dock .note .dim { color: #93a3c4; }
.log-dock .note .on { color: #8ef0c2; }
.log-dock .note .link-btn { color: #8fb6ff; }
.log-dock .sc-body::-webkit-scrollbar { width: 4px; }
.log-dock .sc-body::-webkit-scrollbar-track { background: transparent; }
.log-dock .sc-body::-webkit-scrollbar-thumb {
  background: rgba(160, 180, 215, .34);
  border: 0;
  border-radius: 99px;
}
.empty-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-align: center;
  padding: 30px;
}

.empty-stage .inner {
  max-width: 640px;
  color: var(--muted);
}

/* 空态主视觉：胶囊标签 + 两行渐变标语。
 * 参考深色科技海报的排版，但换成白底配色，和三栏的白色卡片语言一致。
 * 文字特效走 background-clip:text 的渐变 + 极慢流光，不是开场动画。 */
.empty-stage .slogan-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid #d9e5fb;
  border-radius: 999px;
  background: #eef4ff;
  color: #2b5ce6;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.empty-stage .slogan-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #17b8a6;
  box-shadow: 0 0 0 3px rgba(23, 184, 166, .15);
}

.empty-stage .slogan-title {
  margin: 20px 0 0;
  font-size: clamp(30px, 4.4vw, 54px);
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.empty-stage .slogan-line {
  display: block;
  width: fit-content;
  margin: 0 auto;
  /* 渐变裁进文字：background-size 拉宽，靠 background-position 缓慢流光 */
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-size: 240% 100%;
  background-repeat: no-repeat;
  animation: sloganFlow 9s ease-in-out infinite;
}
.empty-stage .slogan-line-1 {
  background-image: linear-gradient(100deg, #005BEA 0%, #2b5ce6 32%, #6d9bff 50%, #2b5ce6 68%, #005BEA 100%);
  /* background-image: linear-gradient(100deg, #16305e 0%, #2b5ce6 32%, #6d9bff 50%, #2b5ce6 68%, #16305e 100%); */
}
.empty-stage .slogan-line-2 {
  background-image: linear-gradient(100deg, #ff7a45 0%, #ff7a45 30%, #ffa876 62%, #ff7a45 76%, #ff7a45 100%);
  /* background-image: linear-gradient(100deg, #345fcb 0%, #7059e0 30%, #ff7a45 62%, #ffa876 76%, #ff7a45 100%); */
  animation-delay: -4.5s;
}

/* 空态整层是 pointer-events:none，只把这一个按钮放出来接点击。
 * 换成主色填充胶囊：实色块在淡色标语下方更稳，也能收住整块视觉重心。 */
.empty-stage .demo-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  padding: 10px 22px;
  border: 1px solid #2b5ce6;
  border-radius: 999px;
  background: linear-gradient(100deg, #2b5ce6, #4e8bff);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(43, 92, 230, .24);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.empty-stage .demo-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 9px 22px rgba(43, 92, 230, .32);
}
.empty-stage .demo-btn:focus-visible { outline: 2px solid #4e8bff; outline-offset: 3px; }

/* ---------------- 右栏 ----------------
 * 原来是两张贴着边的白块，和左栏的卡片栏并排看会显得「没画完」。
 * 现在右栏也铺浅灰底、3D 与预检各成一张白卡，三栏的卡片语言就统一了。 */

.panel.right {
  background: #eef1f8;
  /* 和左栏同构：上方内容自己滚，最底部钉一块「运行日志」Dock。
     padding 清零是为了让 Dock 真正贴到面板底边，不留一条浅灰缝。 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.right-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 14px;
}

.viewer-box {
  border: 1px solid #dfe6f1;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  flex: 0 0 auto;
}

/* 3D 预览下方「当前选项参数」：一眼看清当前素材源的关键设置。
 * 和画布底角（尺寸/拔模/收缩）及预检报告四项分工不同，不重复摆那些数值。
 * 用两列小格，标签灰、值主色加粗，窄屏自然换行。 */
.current-spec {
  border: 1px solid #dfe6f1;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-1);
  padding: 10px 12px 11px;
  flex: 0 0 auto;
}
.cs-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-2);
  margin-bottom: 9px;
}
.cs-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 92, 230, .12);
}
.cs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}
/* 每项一行（标签 + 值横排），一行摆两项；原来标签在上、值在下要多占一倍高度 */
.cs-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.cs-k {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.4;
  white-space: nowrap;
}
.cs-v {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--primary);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-v small { font-size: 10px; font-weight: 500; color: var(--text-2); margin-left: 1px; }

.viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 9px;
}

.viewer-head .t {
  font-weight: 650;
  font-size: 13px;
  letter-spacing: -.005em;
}

.viewer-head .hint {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#viewer3d {
  width: 100%;
  height: 268px;
  display: block;
  cursor: grab;
  border-radius: 0;
}

#viewer3d:active { cursor: grabbing; }

.viewer-tools {
  display: flex;
  gap: 6px;
  padding: 8px 14px 12px;
}

/* 四颗按钮等分一行：宽度随文字长短参差不齐时，这一排看起来像随手摆的 */
.mini-btn {
  flex: 1 1 0;
  border: 1px solid #dbe2ef;
  background: #fff;
  color: var(--text-2);
  border-radius: 7px;
  padding: 6px 6px;
  font-size: 11.5px;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  transition: background .13s var(--ease), border-color .13s var(--ease),
              color .13s var(--ease), box-shadow .13s var(--ease);
}

.mini-btn:hover { border-color: #bfcbe0; background: #f7f9fd; color: var(--text); }
.mini-btn.on {
  background: var(--primary-soft);
  border-color: #bdd0ff;
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(43, 92, 230, .08);
}

/* ---------------- 检测报告 ---------------- */

.report {
  padding: 14px 14px 18px;
  /* 高度按内容走，不抢右栏剩下的空间：flex:1 时内容一多就会从卡片底边溢出去
   * （卡片有圆角，溢出的条目会挂在圆角外面），整栏交给 .panel 滚更稳 */
  flex: 0 0 auto;
  background: var(--panel);
  border: 1px solid #dfe6f1;
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  /* 不自滚：问题列表自己有 max-height + 滚动，外面再套一层会出现双滚动条 */
}

.report-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.report-title .t {
  font-weight: 650;
  font-size: 13px;
  letter-spacing: -.005em;
}

.badge {
  font-size: 11.5px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .01em;
}

.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.idle { background: #f1f3f8; color: var(--muted); }

.verdict {
  border-radius: var(--radius);
  padding: 12px 13px;
  margin-bottom: 12px;
  border: 1px solid transparent;
  line-height: 1.55;
}

.verdict.ok { background: var(--ok-soft); border-color: #c6ecdd; }
.verdict.bad { background: var(--danger-soft); border-color: #f6cfcf; }
.verdict.warn { background: var(--warn-soft); border-color: #f2ddb5; }
.verdict.idle { background: var(--panel-2); border-color: var(--border); }

.verdict .big {
  font-weight: 660;
  font-size: 13px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.verdict.ok .big { color: var(--ok); }
.verdict.bad .big { color: var(--danger); }
.verdict.warn .big { color: var(--warn); }

.verdict .desc {
  font-size: 12.5px;
  color: var(--text-2);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 13px;
}

.metric {
  background: linear-gradient(180deg, #fbfcfe, #f5f8fc);
  border: 1px solid #e6ecf6;
  border-radius: 9px;
  padding: 9px 10px 10px;
  transition: border-color .14s var(--ease);
}
.metric:hover { border-color: #d8e2f0; }

.metric .k {
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 3px;
  letter-spacing: .01em;
}

.metric .v {
  font-size: 15.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.metric .v small {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.metric.danger .v { color: var(--danger); }
.metric.warn .v { color: var(--warn); }
.metric.ok .v { color: var(--ok); }

.problem-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 3px;
}

.problem {
  display: flex;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all .13s;
  align-items: flex-start;
}

.problem:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(30, 45, 80, .06);
}

/* 点过之后保持选中态：画布上那几个琥珀色光环对应的就是这一条。
   再点一次取消，方便和没高亮时的红点对照。 */
.problem.active {
  border-color: #f0b65a;
  background: #fff8ea;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .28), 0 2px 6px rgba(30, 45, 80, .06);
}
.problem.active.error,
.problem.active.warn { border-left-color: #f59e0b; }
.problem.active .dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.problem.active .msg { color: #7c4a03; font-weight: 600; }
.problem.active .fix { color: #96682a; }

.problem.error { border-left: 3px solid var(--danger); }
.problem.warn { border-left: 3px solid var(--warn); }

.problem .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 5px;
  flex: 0 0 auto;
}

.problem.error .dot { background: var(--danger); }
.problem.warn .dot { background: var(--warn); }

.problem .body { flex: 1; min-width: 0; }

.problem .msg {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 3px;
}

.problem .fix {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

.no-problem {
  text-align: center;
  /* 多留一点上下白：空态时这段字挂在预检卡顶部，下面一大片空会显得卡片没做完 */
  padding: 34px 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---------------- 导出区（整块钉在左栏底部） ----------------
 * 它不是「第 5 张步骤卡」，而是一条通栏贴底的操作台：
 *   · 去掉左右留白 / 圆角 / 卡片边框，宽度跟左栏一致，从卡片列表里脱开
 *   · 标题栏换实心主题蓝、顶部一条渐变亮边，把「上滚区」和「固定区」切开
 *   · 投影朝上打，像浮在滚动内容之上的一层
 * 块内的按钮 / 提示 / 价目卡仍是浅色，不用跟着改配色。 */

.panel.left > .export-dock {
  flex: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 -6px 20px rgba(23, 33, 56, .14);
}

/* 上方卡片用左侧 3px 竖条表示展开 / 完成；这里改成顶部 2px 横向亮条，
   既当分界线，也接管 .sec.done::before 的绿渐变，不会在蓝标题上冒出绿边。 */
.panel.left > .export-dock::before {
  left: 0; right: 0; bottom: auto;
  width: auto;
  z-index: 2;
}

.panel.left > .export-dock .sec-head {
  padding: 11px 14px;
  background: linear-gradient(180deg, #3d70f0, #2556dd);
  border-bottom: 0;
}
.panel.left > .export-dock .sec-head:hover {
  background: linear-gradient(100deg, #2556dd, #3d70f0);
}
.panel.left > .export-dock .sec-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.panel.left > .export-dock .sec-caret { color: rgba(255, 255, 255, .82); }

/* 标题后的「?」（wireTips 把 .hint 收成的图标）：
 * 默认那套是「灰圈灰字」，落在实心蓝标题栏上就只剩一个脏圆点，和旁边的白字
 * 完全不在一个色系里。这里翻成白 —— 半透明白圈 + 白问号，移入时反成
 * 一层淡白底，仍是同一套「移入变实」的手感，只是底色换成深色版。 */
.panel.left > .export-dock .sec-title .q {
  color: #fff;
  border-color: rgba(255, 255, 255, .62);
}
.panel.left > .export-dock .sec-title .q:hover,
.panel.left > .export-dock .sec-title .q:focus-visible {
  background: rgba(255, 255, 255, .22);
  border-color: #fff;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .14);
}

/* 价格胶囊原本是浅蓝底蓝字，放到深蓝标题栏上会糊成一片 */
.panel.left > .export-dock .export-price {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .38);
  color: #fff;
}
.panel.left > .export-dock .export-price:hover,
.panel.left > .export-dock .export-price:focus-visible {
  background: rgba(255, 255, 255, .24);
  border-color: rgba(255, 255, 255, .72);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
}

/* 价格胶囊：导出标题行上只露当前档位，高度一处定义 */
.panel.left > .export-dock .export-price { height: 27px; }

.panel.left > .export-dock .sec-body {
  padding: 12px 14px 16px;
  max-height: min(38vh, 300px);
  overflow-y: auto;
}
@media (max-height: 760px) {
  .panel.left > .export-dock .sec-body { max-height: 30vh; }
}

.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 行距比列距宽：右下角的「免费」角标会向下探出 6px，8px 会贴到下一行按钮 */
  gap: 12px 8px;
}

/* .export-grid 自带 display:grid，会盖掉 UA 的 [hidden]{display:none}，得显式补回来 */
.export-grid[hidden] { display: none; }

/* 三个 2D 格式不扣积分：角标只挂在「能点」的按钮上，
 * :disabled 时自动不生成，按钮灰着就不会出现刺眼的绿标。
 * 贴在按钮右下角（bottom/right），不占按钮文字的位置、也不盖住上一行按钮。 */
.export-grid .btn[data-free] { position: relative; }
.export-grid .btn[data-free]:not(:disabled)::after {
  content: "免费";
  position: absolute;
  bottom: -6px;
  right: -5px;
  padding: 0 5px;
  border-radius: 99px;
  /* 三颗「免费」同时出现时，实心绿会盖过按钮本身；浅底 + 深绿字 + 一圈细边，
   * 既能扫到，又不会把导出的主按钮比下去 */
  background: #e9f8f1;
  color: #0a7a55;
  box-shadow: 0 0 0 1px rgba(13, 148, 99, .22);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
}

/* 没有轮廓时的引导条：和按钮区互斥，说清「下一步做什么」而不是摆一排灰按钮 */
.export-guide {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 12px;
  border: 1px dashed #c9d3e6;
  border-radius: var(--radius-sm);
  background: #f6f8fd;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.65;
}
.export-guide[hidden] { display: none; }
.export-guide b {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}
.export-guide p { margin: 0; }
.export-guide-mark {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: #dbe6fb;
  color: #2c5cc5;
  font-size: 11px;
  font-weight: 600;
}

.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: -.005em;
  transition: background .15s var(--ease), box-shadow .15s var(--ease),
              border-color .15s var(--ease), transform .06s var(--ease);
}

/* 主按钮做成上浅下深的渐变 + 内高光：纯色蓝在浅灰栏里像一块贴纸，
 * 加一层 1px 顶部高光才有「按得下去」的实体感 */
.btn.primary {
  background: linear-gradient(180deg, #3d70f0, #2556dd);
  color: #fff;
  box-shadow: 0 1px 2px rgba(31, 66, 170, .26), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #3565e8, #1f4dd1);
  box-shadow: 0 2px 4px rgba(31, 66, 170, .28), 0 6px 16px rgba(43, 92, 230, .22),
              inset 0 1px 0 rgba(255, 255, 255, .2);
}

/* 按下时下沉 1px、把投影收掉：这是唯一能让人确认「点到了」的反馈 */
.btn.primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(12, 32, 96, .22);
}

.btn.ghost {
  background: #fff;
  color: var(--text-2);
  border: 1px solid #d6deeb;
}

.btn.ghost:hover:not(:disabled) { background: #f7f9fd; border-color: #bfcbe0; }
.btn:disabled { opacity: .42; cursor: not-allowed; }

/* wide = 撑满整行，三种容器里都要成立。
 * <button> 是表单控件：就算 .btn 设了 display:flex，width:auto 依然按内容
 * 收缩（实测只有 142px，父容器 273px），必须显式给 100%。
 * grid-column 只在 grid item 上有意义（导出区的 DXF 按钮靠它跨两列），
 * 放到普通 div / flex 行里会被完全忽略 —— 这就是以前「加了 wide 却没变宽」的原因。 */
.btn.wide {
  width: 100%;
  grid-column: 1 / -1;
}
/* flex 行里改用伸缩而不是写死 100%：同一行以后再加按钮也不会被挤出去；
 * 特异性高于 .btn.sm 的 flex:0 0 auto，否则小按钮仍然拒绝拉伸。 */
.btn-row > .btn.wide {
  flex: 1 1 auto;
  width: auto;
}

.note {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 9px 0;
  padding: 9px 10px;
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.note b { color: var(--text-2); font-weight: 600; }

/* note 里的行内动作（比如「去调文字」），字号跟 note 对齐，别把行高顶开 */
.note .link-btn {
  font-size: 11.5px;
  font-weight: 500;
  padding: 0 4px;
  margin-left: 2px;
  vertical-align: baseline;
}

/* 参数行下方的说明 */
.hint {
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 5px;
}

/* 「?」的浮层：挂在 body 上、position:fixed。
 *
 * 不用 css 的 :hover + absolute —— 左栏是 overflow:auto 的滚动容器，绝对定位的
 * 浮层会被裁在栏内，靠近底部的参数根本看不到完整说明。fixed 脱离滚动容器，
 * 坐标由 js 按图标的位置现算（见 app.js initTips）。 */
.tip-layer {
  position: fixed;
  z-index: 9999;
  max-width: 292px;
  padding: 9px 11px;
  border: 1px solid #dfe5f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(23, 33, 56, .14), 0 2px 6px rgba(23, 33, 56, .06);
  font-size: 11px;
  line-height: 1.62;
  color: var(--text-2);
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .12s var(--ease), transform .12s var(--ease);
}

.tip-layer.on { opacity: 1; transform: none; }

.tip-layer b { color: var(--text); font-weight: 650; }
.tip-layer code {
  font-size: 10.5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}

/* 提示里的命令行片段。等宽字体 + 浅底，让「照抄这一行」这件事没有歧义 */
.hint code {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 10px;
  background: #eef1f5;
  border-radius: 3px;
  padding: 0 3px;
  color: #3d4654;
  word-break: break-all;
}

/* 自动优化结果面板 */
.note.ok { background: var(--ok-soft); border-color: #c6ecdd; color: #127a57; }
.note.ok b { color: #0d6b4c; }
.note.bad { background: var(--danger-soft); border-color: #f3cccc; color: #ab2f2f; }
.note.bad b { color: #932626; }
.note.warn { background: var(--warn-soft); border-color: #efd9b0; color: #7d5306; }
.note.warn b { color: #6b4705; }
.note .warn { color: #a9660a; font-weight: 600; }
.note .dim { color: var(--muted); font-size: 10.5px; }
.note .on { color: var(--text); font-weight: 600; }

/* ---------------- 状态栏 ---------------- */

footer {
  /* 三列等宽：左右各 1fr、中间 auto，中间那栏因此天然居中。
   * 用绝对定位也能居中，但状态文字一长就会从下面压过去；
   * 这里左右列可被压缩（minmax(0, …)），中间永远是视口正中。 */
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  border-top: 1px solid #e3e8f1;
  font-size: 11.5px;
  color: var(--muted);
  z-index: 10;
}

.foot-left {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: start;
  min-width: 0;
  overflow: hidden;
}
.foot-left span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }

#statTime { justify-self: end; white-space: nowrap; }

/* 公司信息：低调但要能看出是链接 */
.foot-mid {
  justify-self: center;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: .2px;
}

.foot-mid a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.foot-mid a:hover {
  /* 不发蓝：只把灰色压深一档并补下划线，提示可点就够 */
  color: var(--text-2);
  border-bottom-color: currentColor;
}

.foot-mid a:focus-visible {
  /* 键盘聚焦时的可见性还是要保留，但同样不发蓝 */
  outline: 2px solid var(--border-strong);
  outline-offset: 2px;
  border-radius: 2px;
}

.dot-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c5cddd;
  /* 光环让这颗小点在 30px 高的状态栏里被看见，也让 ok / busy 的颜色更醒目 */
  box-shadow: 0 0 0 3px rgba(197, 205, 221, .22);
}

.dot-status.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(13, 148, 99, .16); }
.dot-status.busy { background: var(--warn); animation: pulse 1s infinite; box-shadow: 0 0 0 3px rgba(192, 122, 9, .16); }
.dot-status.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(192, 122, 9, .16); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

/* ---------------- Toast ---------------- */

#toast {
  position: fixed;
  /* 屏幕正中，而不是贴底：底部那条在长页面上离视线很远，
    用户点完按钮眼睛还在原地，等不到那行提示 */
  top: 50%;
  left: 50%;
  /* transform 恒为「正中」，不参与入场动画。以前把 +12px 的位移写在这里，
    动画没走完时盒子中心就还偏着 12px —— 截图时机一抖，居中就变成玄学。 */
  transform: translate(-50%, -50%);
  background: rgba(27, 34, 51, .96);
  color: #fff;
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease);
  /* 高于 .modal（1000）：居中之后就正好落在弹窗正中，
    压在下面等于点了「兑换」什么都看不见 */
  z-index: 1200;
  box-shadow: 0 12px 38px rgba(20, 30, 60, .34);
  backdrop-filter: blur(6px);
  max-width: min(78vw, 340px);
}

#toast.show { opacity: 1; }
/* 入场只淡入，不再做 scale 弹跳：居中的 translate(-50%) 按「未缩放宽度」
 * 算，缩放那 0.22 秒里中心会挪 2~3px（截图 / 自动化时机一抖就测出来）。
 * 对一条提示来说，稳稳居中比弹一下更重要。 */

/* ---------------- 账户与登录 ---------------- */

/* 顶栏账户按钮：和 .chip 同一行高，但它是可点的，所以做成有边界的按钮。
 *
 * 两个状态语义不同，长相也该不同：
 *   未登录 = 拉新入口（实心蓝 + 白字 + 阴影），登录后才有的身份牌才是浅底。
 *   以前两者都是浅底描边，在白色顶栏里几乎看不见，用户找不到登录在哪。
 * .dim 是第三种：连不上后端 / 本地副本时它不是 CTA（点了也导不出），
 * 退回描边样式，免得一颗「只读」蓝按钮骗人点。 */
.acct {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, #3f74f2 0%, #2453d8 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(43, 92, 230, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: background .16s, box-shadow .16s, transform .12s, color .16s, border-color .16s;
}
.acct:hover {
  background: linear-gradient(135deg, #4f81f7 0%, #2a5ae2 100%);
  box-shadow: 0 5px 14px rgba(43, 92, 230, .34), inset 0 1px 0 rgba(255, 255, 255, .24);
  transform: translateY(-1px);
}
.acct:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(43, 92, 230, .3); }
/* 键盘用户也要看得见焦点：白底浅蓝虚线圈在蓝按钮上看不清，用外描边 */
.acct:focus-visible { outline: 2px solid #9ab6ff; outline-offset: 2px; }

/* 已登录：身份牌，安静一点，权重让给顶栏里的手机号和积分 */
.acct.on {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #c6d7fb;
  box-shadow: none;
  letter-spacing: 0;
}
.acct.on:hover {
  background: #dfe8ff;
  border-color: #b3c8f8;
  box-shadow: 0 1px 3px rgba(43, 92, 230, .14);
  transform: none;
}
/* 离线 / 本地副本：不是 CTA，退回中性描边 */
.acct.dim {
  background: var(--panel);
  color: var(--muted);
  border-color: var(--border-strong);
  box-shadow: none;
  letter-spacing: 0;
}
.acct.dim:hover {
  background: var(--panel-2);
  color: var(--text-2);
  border-color: #b9c3d6;
  transform: none;
}

.acct-icon { display: inline-flex; width: 16px; height: 16px; opacity: .95; }
.acct-icon svg { display: block; width: 100%; height: 100%; }
/* 手机号里有空格（3-4-4），不锁 nowrap 会在窄屏断成两行 */
.acct-text { white-space: nowrap; }
.acct-points {
  padding-left: 7px;
  margin-left: 1px;
  border-left: 1px solid currentColor;
  font-variant-numeric: tabular-nums;
  opacity: .8;
}
.acct-points[hidden] { display: none; }

/* 教程按钮：帮助是次要入口，描边胶囊 + ? 图标，常驻（不挑登录态）。
 * 比积分超市再轻一档——没有底色，只有一圈淡边框。 */
.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s;
}
.help-btn svg { width: 15px; height: 15px; flex: none; }
.help-btn:hover { background: var(--panel-2); border-color: #b3c8f8; color: var(--primary); }
.help-btn:focus-visible { outline: 2px solid #9ab6ff; outline-offset: 2px; }

/* 积分超市按钮：和已登录的账户牌并排，但权重更轻（描边而非实心），
 * 免得顶栏两颗蓝按钮抢注意力。默认 hidden，登录后由 refreshAccount 放出来。 */
.shop-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #c6d7fb;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s, border-color .16s, transform .12s;
}
.shop-btn:hover { background: #dfe8ff; border-color: #b3c8f8; transform: translateY(-1px); }
.shop-btn:active { transform: translateY(0); }
.shop-btn:focus-visible { outline: 2px solid #9ab6ff; outline-offset: 2px; }
.shop-btn[hidden] { display: none; }
.shop-ico { display: inline-flex; width: 15px; height: 15px; }
.shop-ico svg { display: block; width: 100%; height: 100%; }

/* 代理合作按钮：比积分超市更轻一档（描边白底），招商入口不必抢主流程的注意力。
 * 窄屏（≤520px）把「合作」两字收掉，只留星形图标 —— 顶栏本来就不宽。 */
/* 合作/代理后台共用一个 <a>：代理态是 href="agent/" 的真链接，用户态由 JS 拦下来开弹窗 */
.partner-btn { background: #fff; border-color: var(--border); color: var(--text-2); text-decoration: none; }
.partner-btn:hover { background: var(--panel-2); border-color: #b3c8f8; color: var(--primary); }
@media (max-width: 520px) {
  .partner-btn { width: 32px; padding: 0; justify-content: center; }
  .partner-text { display: none; }
}

/* 后端连接状态：只有明确知道在线才变绿，未探测/断开都用灰。
 * 默认藏起来 —— 探活要几十毫秒，先露个「离线」再消失会闪一下。 */
#netChip[hidden] { display: none; }
#netChip.off { background: #f1f3f8; color: var(--muted); }
#netChip.on { background: var(--ok-soft); color: var(--ok); }

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal[hidden] { display: none; }

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(18, 24, 38, .42);
  backdrop-filter: blur(1.5px);
  animation: fadeIn .16s ease;
}

.modal-card {
  position: relative;
  width: 372px;
  max-width: calc(100vw - 32px);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  animation: popIn .18s cubic-bezier(.2, .9, .3, 1);
  /* 内容多了（账户页现在有身份、余额、扣费表、兑换码）就自己滚，
     不要让整块弹窗顶出屏幕 —— 矮一点的笔记本上会连「关闭」都点不到 */
  max-height: calc(100vh - 24px);
  overflow: hidden auto;
}

@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 11px;
}
.modal-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.2px;
}
.modal-x {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.modal-x:hover { background: var(--panel-2); color: var(--text); }

/* -------- 通用弹窗头部：图标 + 标题 + 副标题 --------
 * 分享、导出确认等普通弹窗统一用这套；市场(.mk-head)、教程(.help-head)、
 * 积分超市(.shop-hero)是各有主题的特例，保持自己的头部。
 * 之前分享弹窗用光秃秃一个 <h2>，而这里只定义了 .modal-head h3，
 * 标题根本没吃到样式 —— 换成 .dlg-head 后和市场/教程同一套视觉。 */
.dlg-head {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(115deg, var(--primary-soft), var(--panel) 46%);
}
.dlg-head-ico {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #4d7cff, var(--primary));
  box-shadow: 0 5px 14px rgba(43, 92, 230, .24);
}
.dlg-head-ico svg { width: 20px; height: 20px; }
.dlg-head-text { flex: 1; min-width: 0; }
.dlg-head-text h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.dlg-head-text p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.modal-body { padding: 0 18px 4px; }

/* -------- 代理合作弹窗（招商落地页，静态占位） --------
 * 只讲价值和怎么开始，不公开折扣数字（咨询后私下发）。
 * 主视觉用主题蓝渐变 + 错峰闪烁的星光点，克制地增加一点生气 —— 不和首页云雾抢戏。 */
.partner-card { width: min(500px, calc(100vw - 32px)); }
.partner-body { padding: 0 18px 18px; }
[data-ph] { position: relative; }
/* 占位标记：默认不显示，只在本地开发（file:// 或 ?dev）时描边提示哪里可改。
 * 生产环境不会露出这些虚线框，但搜索 data-ph 仍能一次定位全部可改文案。 */
body.dev-mark [data-ph] { outline: 1px dashed #c6d7fb; outline-offset: 2px; }

/* 主视觉：整块圆角渐变，靠边角光斑和顶部细纹撑质感 */
.pt-hero {
  position: relative; overflow: hidden;
  margin: 0 -18px 0; padding: 26px 22px 24px;
  background: linear-gradient(135deg, #1e3a8a 0%, var(--primary) 55%, #4d7cff 100%);
  color: #fff;
}
.pt-hero::after {
  content: ""; position: absolute; right: -40px; top: -60px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.20), transparent 68%);
  pointer-events: none;
}
.pt-eyebrow {
  display: inline-block; padding: 4px 10px; margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.38); border-radius: 999px;
  background: rgba(255,255,255,.12);
  font-size: 11px; font-weight: 600; letter-spacing: .5px;
}
.pt-headline { display: block; position: relative; font-size: 27px; font-weight: 800; line-height: 1.32; letter-spacing: -.6px; }
.pt-lede { position: relative; margin: 11px 0 0; max-width: 33em; font-size: 12.5px; line-height: 1.75; color: rgba(255,255,255,.88); }
.pt-sparks { position: absolute; inset: 0; pointer-events: none; }
/* 星光：每颗用不同周期和延迟错峰闪烁，避免整齐划一像在排队 */
.pt-sparks i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #fff; opacity: .3;
  box-shadow: 0 0 5px 1px rgba(255,255,255,.4);
  animation: pt-twinkle 2.6s ease-in-out infinite;
  will-change: opacity, transform;
}
@keyframes pt-twinkle {
  0%, 100% { opacity: .2; transform: scale(.7); box-shadow: 0 0 4px 0 rgba(255,255,255,.25); }
  50%      { opacity: 1;  transform: scale(1.3); box-shadow: 0 0 9px 2px rgba(255,255,255,.75); }
}
.pt-sparks i:nth-child(1) { left: 74%; top: 24%; animation-duration: 2.3s; animation-delay: 0s; }
.pt-sparks i:nth-child(2) { left: 84%; top: 46%; width: 2px; height: 2px; animation-duration: 3.1s; animation-delay: .6s; }
.pt-sparks i:nth-child(3) { left: 68%; top: 64%; width: 2px; height: 2px; animation-duration: 2.7s; animation-delay: 1.2s; }
.pt-sparks i:nth-child(4) { left: 90%; top: 72%; animation-duration: 3.4s; animation-delay: .3s; }
.pt-sparks i:nth-child(5) { left: 60%; top: 16%; width: 2px; height: 2px; animation-duration: 2.9s; animation-delay: 1.7s; }
/* 尊重系统的「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  .pt-sparks i { animation: none; opacity: .65; }
}

/* 三个卖点：等宽卡片，图标统一主题色 */
.pt-perks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 0 4px; }
.pt-perk {
  min-width: 0; padding: 13px 8px 12px; text-align: center;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
}
.pt-perk-ico {
  width: 30px; height: 30px; margin: 0 auto 8px; border-radius: 9px;
  display: grid; place-items: center; color: var(--primary);
  background: var(--primary-soft);
}
.pt-perk-ico svg { width: 17px; height: 17px; }
.pt-perk b { display: block; font-size: 13px; font-weight: 700; color: var(--text); }
.pt-perk p { margin: 5px 0 0; font-size: 11px; line-height: 1.55; color: var(--muted); }

/* 三步起步：圆点序号 + 连接线，暗示「很快就能开始」 */
.pt-steps {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; margin: 14px 0 4px; padding: 15px 6px 12px;
  border-radius: 12px; background: var(--panel-2);
}
.pt-steps::before {
  content: ""; position: absolute; left: 18%; right: 18%; top: 28px;
  height: 1px; background: var(--border-strong);
}
.pt-step { position: relative; text-align: center; }
.pt-step i {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 24px; height: 24px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 12px; font-style: normal; font-weight: 700;
  box-shadow: 0 0 0 4px var(--panel-2);
}
.pt-step b { display: block; font-size: 12px; font-weight: 650; color: var(--text); }
.pt-step span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); }

/* 底部行动区：客服二维码 + 一对一说明，浅蓝底和主视觉呼应 */
.pt-contact {
  display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 10px;
  border: 1px solid #c9d9ff; border-radius: 12px; background: var(--primary-soft);
}
.pt-qr {
  width: 95px; height: 95px; flex: none; border-radius: 10px;
  border: 1px dashed #8fabf5; background: #fff;
  display: grid; place-items: center; color: var(--muted); font-size: 11px;
}
.pt-qr img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }
.pt-contact-txt { min-width: 0; }
.pt-contact-txt b { font-size: 13px; font-weight: 700; color: var(--text); }
.pt-contact-txt p { margin: 4px 0 0; font-size: 11.5px; color: var(--text-2); line-height: 1.6; }
.pt-contact-id[hidden] { display: none; }

@media (max-width: 520px) {
  /* 手机端卖点维持三列但缩字号，避免竖排把弹窗拉得过长 */
  .pt-hero { padding: 22px 18px 20px; }
  .pt-headline { font-size: 23px; }
  .pt-perks { gap: 6px; }
  .pt-perk { padding: 11px 5px 10px; }
  .pt-perk-ico { width: 26px; height: 26px; }
  .pt-perk-ico svg { width: 15px; height: 15px; }
  .pt-perk p { font-size: 10px; }
  .pt-step span { font-size: 9.5px; }
}

/* 积分超市弹窗：800px 宽的货架窗 —— 四张卡挤一点但整窗更聚焦，
 * 顶部通栏 + 规格切换 + 四卡 + 兑换框，卡面只做档位展示、兑换统一走下方输入框。 */
.shop-card { width: min(800px, calc(100vw - 48px)); }
.shop-card .modal-body { padding: 0 16px 16px; }

/* -------- 使用教程弹窗：左侧目录 + 右侧图文 --------
 * 内容按真实流程分了 7 页，点目录切页；比一整篇长文聚焦。
 * 双栏只在宽屏出现，窄屏（<720px）自动堆成上下，目录横排可横向滚。 */
.help-card {
  width: min(860px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;   /* 圆角裁住顶栏底色；滚动交给 .help-body */
}
.help-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f7f9ff, #fff);
}
.help-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.help-brand-ico {
  flex: none;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}
.help-brand-ico svg { width: 20px; height: 20px; }
.help-head h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.help-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }

.help-body { flex: 1 1 auto; min-height: 0; display: flex; }

.help-nav {
  flex: 0 0 158px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 8px;
  border-right: 1px solid var(--border);
  background: #fafbfe;
  overflow-y: auto;
}
.help-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: background .13s, color .13s;
}
.help-nav-item:hover { background: #eef2fb; }
.help-nav-item:focus-visible { outline: 2px solid #9ab6ff; outline-offset: -1px; }
.help-nav-item.on { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.hn-num {
  flex: none;
  width: 21px; height: 21px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: #e9edf5;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.help-nav-item.on .hn-num { background: var(--primary); color: #fff; }

.help-panes { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: 20px 24px 24px; }
.help-pane[hidden] { display: none; }
.help-pane h4 { margin: 0 0 10px; font-size: 16px; font-weight: 700; line-height: 1.4; }
.help-pane p { margin: 0 0 12px; font-size: 13px; line-height: 1.75; color: var(--text-2); }
.help-pane b { color: var(--text); }

/* 三步流程图 */
.help-flow { display: flex; align-items: center; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.hflow-step {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  font-size: 12.5px;
}
.hflow-step b {
  width: 20px; height: 20px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;                 /* 抵消默认内边距，数字才不会偏 */
  line-height: 1; text-align: center;   /* 行高贴合字号，避免被顶偏 */
  border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 11px;
}
.hflow-arrow { color: #b6bed0; font-size: 15px; }

/* 提示 / 强调块 */
.help-callout {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #cfe0ff;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: #f2f6ff;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}
.help-callout b { color: var(--primary); }
.help-tip {
  display: flex; gap: 8px; align-items: baseline;
  margin: 14px 0 0;
  font-size: 12px; line-height: 1.7; color: var(--text-2);
}
.help-tip > span {
  flex: none;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 10.5px; font-weight: 700;
}
/* 提示文字要包一层容器：.help-tip 是 flex，裸写在里面的 <b> 会各自变成
 * flex item —— 一换行顺序就乱（标签跳到句尾）。容器只负责让文字正常折行。 */
.help-tip > div { flex: 1 1 auto; min-width: 0; }
.help-kbd {
  padding: 1px 6px;
  border: 1px solid #cfd7e6;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.help-list { margin: 0 0 12px; padding-left: 18px; }
.help-list li { margin-bottom: 9px; font-size: 12.5px; line-height: 1.7; color: var(--text-2); }
.help-list li::marker { color: var(--primary); }

/* 三张素材卡：一行一张，换行显示。
 * 内层卡片类名用 .hcard 而不是 .help-card —— 后者是弹窗外层的类名，
 * 共用会被 .help-card { width: min(860px,...) } 撑爆，横排溢出且文字不折行。 */
.help-cards { display: grid; grid-template-columns: 1fr; gap: 9px; margin: 14px 0; }
.hcard { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.hcard b { display: block; font-size: 13px; margin-bottom: 5px; }
.hcard p { margin: 0; font-size: 11.5px; line-height: 1.65; }

/* 导出格式 */
.help-formats { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.help-formats > div {
  display: flex; gap: 10px; align-items: baseline;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.help-formats b { flex: none; width: 92px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.help-formats span { font-size: 12px; line-height: 1.6; color: var(--text-2); }

/* FAQ 折叠 */
.help-faq { display: flex; flex-direction: column; gap: 8px; }
.help-faq details { border: 1px solid var(--border); border-radius: 9px; background: #fff; overflow: hidden; }
.help-faq summary {
  padding: 11px 13px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::after { content: '▾'; color: var(--muted); transition: transform .15s; }
.help-faq details[open] summary::after { transform: rotate(180deg); }
.help-faq details[open] summary { border-bottom: 1px solid var(--border); }
.help-faq details p { margin: 0; padding: 11px 13px 13px; font-size: 12.5px; }


/* 窄屏：双栏堆成上下，目录横排可横向滚；卡片吃满宽度 */
@media (max-width: 720px) {
  .help-card { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .help-body { flex-direction: column; }
  .help-nav {
    flex: none;
    flex-direction: row;
    gap: 6px;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .help-nav-item { width: auto; flex: none; white-space: nowrap; padding: 7px 10px; }
  .help-panes { padding: 16px 16px 20px; }
  .help-head { padding: 12px 14px; }
  .help-formats > div { flex-direction: column; gap: 3px; }
  .help-formats b { width: auto; }
}

.shop-hero {
  position: relative;
  padding: 14px 18px 13px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(120deg, #2b5ce6, #5b8cff);
  color: #fff;
  text-align: center;
  overflow: hidden;
}
/* 右上角一抹淡光，让通栏不至于是一整块死板的纯色 */
.shop-hero::after {
  content: "";
  position: absolute;
  top: -70px; right: -30px;
  width: 230px; height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), rgba(255,255,255,0) 68%);
  pointer-events: none;
}
.shop-hero-txt { position: relative; z-index: 1; }
.shop-hero h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.shop-hero p { margin: 4px 0 0; font-size: 11px; opacity: .88; }
.shop-hero .shop-sub {
  margin-left: 7px;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .82);
}
.shop-x { position: absolute; top: 9px; right: 11px; z-index: 2; color: #fff; }
.shop-x:hover { background: rgba(255, 255, 255, .18); color: #fff; }

/* 规格切换并进「每张卡能导几次」这张卡，做卡片头部：标题在左、
 * 规格和折合单价在右，一条分隔线把表体分开。只在这里出现一次。 */
.shop-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.shop-specs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 99px;
  background: #eef2fa;
}
.shop-spec {
  min-width: 56px;
  padding: 4px 10px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.shop-spec:hover { color: var(--primary); }
/* 头部是白底，原来的白胶囊会融进去；选中态改实心蓝，和横幅 / 兑换按钮同色系 */
.shop-spec.on {
  background: var(--primary);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(43, 92, 230, .3);
}
.shop-spec.on:hover { color: #fff; }
/* 折合单价只是说明文字，不做账户页那种悬浮全规格表 */
.shop-unit { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* 边框流光用的角度变量：注册成 <angle> 才能被 keyframes 平滑插值。
 * 只动渐变角度、不旋转伪元素本身，避免旋转矩形时四角露馅。 */
@property --shop-spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@keyframes shop-tier-border {
  to { --shop-spin: 360deg; }
}

.shop-tiers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 11px;
}
.shop-tier {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px 11px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f8faff);
  overflow: hidden;
}
.shop-tier.featured {
  border-color: #8ca8ff;
  box-shadow: 0 0 0 1px #8ca8ff inset, var(--shadow-1);
}
/* 一圈柔和的蓝紫光晕沿边框循环扫过；mask 挖空中间只留 1.5px 描边。
 * 刻意做成「宽而淡」：亮区拉到 200°+ 并多级缓入缓出，峰值只用半透明色，
 * 远看是若有若无的光晕，不会像一道实心光带那样抢眼。 */
.shop-tier::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--shop-spin),
    transparent 0deg,
    rgba(169, 191, 255, .10) 150deg,
    rgba(124, 92, 255, .26) 235deg,
    rgba(122, 75, 255, .40) 290deg,
    rgba(43, 92, 230, .24) 330deg,
    transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  animation: shop-tier-border 3.4s linear infinite;
}
/* 四张卡错开起跑，避免齐刷刷同步转 */
.shop-tier:nth-child(2)::after { animation-delay: -.85s; }
.shop-tier:nth-child(3)::after { animation-delay: -1.7s; }
.shop-tier:nth-child(4)::after { animation-delay: -2.55s; }
/* 主推档光晕稍浓一点、扫得更快，但同样保持半透明不刺眼 */
.shop-tier.featured::after {
  background: conic-gradient(from var(--shop-spin),
    transparent 0deg,
    rgba(124, 92, 255, .14) 135deg,
    rgba(124, 92, 255, .34) 220deg,
    rgba(43, 92, 230, .48) 285deg,
    rgba(43, 92, 230, .26) 330deg,
    transparent 360deg);
  animation-duration: 2.6s;
}
@media (prefers-reduced-motion: reduce) {
  .shop-tier::after, .shop-tier.featured::after { animation: none; }
}
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.st-name { font-size: 12px; font-weight: 650; white-space: nowrap; }
.st-badge {
  flex: none;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
/* 积分是卡片主视觉：卡头已写「N 元充值卡」，不再重复摆大号面值，
 * 这里把到账积分放大到全卡最醒目，用户一眼比的是能拿到多少分。 */
.st-pts { margin-top: 13px; }
.st-pts-label { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.st-pts-value { display: flex; align-items: baseline; gap: 4px; margin-top: 2px; flex-wrap: wrap; }
.st-pts .tier-pts b {
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -.7px;
  line-height: 1.15;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.st-unit { font-size: 11.5px; color: var(--text-2); }
.st-pts .tier-gift { margin-left: 2px; }
/* 底部「约 N 次 + 进度条」成组贴底：卡片高度由最高那档撑齐，
 * 虚线和上面的积分分开，去掉按钮后层级反而更清楚。 */
.st-times {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
}
.shop-tier .tier-times {
  margin-top: 0;
  text-align: left;
  color: var(--text-2);
  font-size: 11.5px;
}
.st-bar {
  height: 4px;
  margin: 6px 0 0;
  border-radius: 99px;
  background: #e8edf7;
  overflow: hidden;
}
.st-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2b5ce6, #8f6bff);
}
/* 下半区左右并排：左边全规格表（六列要宽一点）、右边兑换框。
 * 行高完全由矩阵的内容决定 —— 右列 min-content 压到最低（公告视窗
 * min-height:0），所以 stretch 时是右列跟着矩阵走，矩阵不会被拉出空白。
 * 窄屏（≤620）再退回上下堆叠。 */
.shop-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  margin-top: 11px;
}
/* 四张卡下面那张全规格表：复用账户页浮层的 tiers-all-* 排版类，
 * 这里只按大弹窗放大字号 / 行距 —— 用户就是来看「哪个档位导几次」的。 */
.shop-matrix {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
  overflow: hidden; /* 头部浅底齐着卡片圆角裁切 */
}
/* 头部标题独占左侧，规格和单价被 auto 外边距推到右边 */
.shop-matrix .tiers-all-cap {
  margin: 0 auto 0 0;
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}
/* 表体单独给内边距：头部横条要通栏，不能让卡片整体 padding 把它框住 */
.shop-matrix-body { padding: 9px 12px 8px; }
.shop-matrix .tiers-all-table th,
.shop-matrix .tiers-all-table td { padding: 4.5px 0; font-size: 11.5px; }
.shop-matrix .tiers-all-table .tiers-all-k { width: 24%; }
.shop-matrix .tiers-all-pts { font-size: 10px; }
.shop-matrix .tiers-all-table tbody td { font-size: 12.5px; }
.shop-matrix .tiers-all-note { margin-top: 6px; font-size: 10.5px; }
/* 右列：公告在上吃掉剩余高度、兑换框在下固定，整列和左边表格等高。
 * min-height:0 是关键 —— 否则 flex 子项撑不下时不会收缩，两列高度会错位。 */
.shop-side {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 0;
}
/* 滚动到账公告：固定视窗 + 轨道无缝上滚，鼠标悬停暂停 */
.shop-notice {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f5f9ff, #fff);
  overflow: hidden;
}
.shop-notice-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  font-size: 11px;
  font-weight: 650;
  color: var(--text-2);
}
/* 呼吸小绿点，表示「实时」 */
.notice-live {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
  animation: noticePulse 1.8s ease-in-out infinite;
}
@keyframes noticePulse { 50% { box-shadow: 0 0 0 5px rgba(13, 148, 99, .12); } }
.shop-notice-view {
  position: relative;
  flex: 1 1 auto;
  /* 不设最小高度：这一列的最小贡献要压到比矩阵还矮，行高才会由矩阵决定，
   * 矩阵不会被拉高留白。分到多少高度就滚多少，公告本来就是滚动展示。 */
  min-height: 0;
  overflow: hidden;
  /* 上下渐隐，滚动到边缘不突兀 */
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}
/* 轨道脱离文档流：16 条假数据本身很高，若留在流里会撑起公告 → 撑起右列 →
 * 撑起 grid 行，矩阵被跟着拉高、下面留一大片空白。绝对定位后视窗高度完全
 * 由 flex 分配（吃掉右列剩余），矩阵只按自己的内容定高。 */
.shop-notice-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  /* 一直滚：鼠标移上去也不暂停，营业场景里公告始终在动 */
  animation: shopNoticeRoll 16s linear infinite;
}
@keyframes shopNoticeRoll { to { transform: translateY(-50%); } }
.shop-notice-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
}
.shop-notice-item b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.shop-notice-item em { font-style: normal; font-weight: 650; color: var(--primary); font-variant-numeric: tabular-nums; }
/* 兑换框缩小：不再垂直铺满整列，自然高度贴底即可。
 * 用 .redeem.shop-redeem 提高优先级 —— 后面的通用 .redeem{margin:2px 0 6px}
 * 会盖掉单类选择器的 margin:0，让兑换框底部多出 6px、右列贴不齐。 */
.redeem.shop-redeem { flex: 0 0 auto; margin: 0; padding: 10px 11px; }
.shop-redeem .redeem-head { margin-bottom: 8px; }

@media (max-width: 1080px) {
  .shop-card { width: calc(100vw - 32px); }
  .shop-tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 并排后每列变窄：表格六列和兑换输入行字号收一档，免得挤到换行 */
@media (max-width: 860px) {
  .shop-matrix .shop-toolbar { gap: 8px; }
  .shop-matrix .tiers-all-cap { font-size: 11.5px; }
  .shop-matrix .tiers-all-table th,
  .shop-matrix .tiers-all-table td { font-size: 10.5px; padding: 4px 0; }
  .shop-matrix .tiers-all-table tbody td { font-size: 11.5px; }
  .shop-redeem .redeem-head { gap: 7px; margin-bottom: 8px; }
  .shop-redeem .redeem-txt b { font-size: 12.5px; }
  .shop-redeem .redeem-txt em { font-size: 10.5px; }
  .shop-redeem .redeem-row input { font-size: 12px; padding: 0 9px; }
  .shop-redeem .redeem-row .btn { padding: 0 12px; }
}
@media (max-width: 620px) {
  .shop-card { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .shop-card .modal-body { padding: 0 12px 12px; }
  .shop-hero { padding: 12px 12px 11px; }
  .shop-hero h3 { font-size: 16px; }
  .shop-hero p { font-size: 11px; }
  /* 手机窄屏左右塞不下，退回上下：表格整行、兑换框整行 */
  .shop-lower { grid-template-columns: 1fr; gap: 10px; }
  .shop-matrix .shop-toolbar { justify-content: center; gap: 9px; padding: 9px 12px; }
  .shop-matrix .tiers-all-cap { width: 100%; margin: 0; text-align: left; font-size: 12px; }
  .shop-matrix .tiers-all-table th,
  .shop-matrix .tiers-all-table td { font-size: 11.5px; padding: 4.5px 0; }
  .shop-matrix .tiers-all-table tbody td { font-size: 12.5px; }
  .shop-unit { width: 100%; text-align: center; }
  .shop-tiers { grid-template-columns: 1fr; }
}

.modal-note {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.fld { display: block; margin-bottom: 12px; }
.fld > span:first-child {
  display: block;
  margin-bottom: 5px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}
.fld input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.fld input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.fld input::placeholder { color: #aab2c2; }
.fld input:disabled { background: var(--panel-2); color: var(--muted); }

.fld-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.fld-row .btn { height: 36px; white-space: nowrap; }
/* 图形验证码：图片当第二列，可点换一张。hidden 属性要显式压过 grid 布局 */
.fld[hidden] { display: none; }
.captcha-img {
  display: block;
  height: 36px;
  width: 108px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #f4f7fb;
  cursor: pointer;
  object-fit: fill;
  transition: border-color .15s;
}
.captcha-img:hover { border-color: var(--primary); }
.captcha-row input { min-width: 0; text-transform: uppercase; letter-spacing: 2px; }

/* 图形验证码弹窗：叠在账户弹窗之上（1000）→ 1100，toast 1200 仍在其上。
   独立的遮罩关闭键走 data-capclose，不碰登录弹窗。 */
.cap-modal { z-index: 1100; }
.cap-card { width: 340px; }
.cap-tip {
  margin: 12px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}
.cap-card .captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.cap-card .captcha-row input {
  width: 100%; height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.cap-card .captcha-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cap-card .captcha-img { height: 44px; width: 128px; }
.cap-actions { margin: 12px 0; }
.cap-actions .btn { width: 100%; height: 42px; }

/* 提示条：失败红、成功绿 —— 只用一个元素，靠 data-tone 切换 */
.modal-err {
  margin: 2px 0 8px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.55;
}
.modal-err[hidden] { display: none; }
.modal-err[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); }
.modal-err[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }

.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 15px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  background: var(--panel-2);
}
.modal-spacer { flex: 1; }

/* 余额：账户页最该被看见的数字，所以给它一张自己的卡 ——
 * 左边硬币图标，中间「积分余额 + 约能导几次」，右边大号数字和单位徽章。
 * 右上角压一层很淡的主色光晕：整块淡蓝底不至于平得像一行灰字。 */
.acct-balance {
  position: relative;
  /* 建层叠上下文：下面那颗漂移光点要沉到卡片底色之上、内容之下 */
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  margin-bottom: 12px;
  border: 1px solid #dbe5fb;
  border-radius: var(--radius);
  background:
    radial-gradient(130px 96px at 97% -34%, rgba(43, 92, 230, .14), rgba(43, 92, 230, 0) 72%),
    linear-gradient(135deg, #eef3ff, #f8fbff 58%, #fff);
  overflow: hidden;
}
/* 卡内一颗缓慢漂移的淡蓝光点：余额卡是全页唯一的「数字」卡，给它一点动静，
 * 和登录框那两团光是一套语言。z-index:-1 + isolation 让它压在卡自身底色之上、
 * 内容之下；卡片本来就有 overflow:hidden，圆角照旧裁切。 */
.acct-balance::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -44px;
  top: -76px;
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 92, 230, .17), rgba(43, 92, 230, 0) 70%);
  pointer-events: none;
  animation: balOrb 11s ease-in-out infinite alternate;
}
@keyframes balOrb {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-28px, 20px, 0) scale(1.2); }
}

.acct-balance-ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--primary);
  border: 1px solid #e2eafc;
  box-shadow: 0 1px 2px rgba(43, 92, 230, .08);
}
.acct-balance-ico svg { width: 19px; height: 19px; }
.acct-balance-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.acct-balance-label { color: var(--text-2); font-size: 12px; font-weight: 600; }
/* 折算那行会写「2×2 / 3×3 / 单个图案」，窄屏宁可省略号也别折成两行
 * 把卡片撑高 —— 高度一变，下面签到条和档位表就跟着跳。 */
.acct-balance-hint {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-balance-num { flex: none; display: flex; align-items: baseline; gap: 5px; }
.acct-balance strong {
  color: var(--primary);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.6px;
}
/* 单位做成小徽章而不是裸文字：数字一长（100,000）时它跟着数字右移，
 * 不会被「积分」两个字挤成换行 */
.acct-balance-num em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  color: #2f5fe0;
  background: #e6edff;
  border: 1px solid #d8e3ff;
}

/* 「我是谁」：顶栏只写昵称，换个号登录后得有个地方能看见完整手机号 */
.acct-me {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 12px;
}
.acct-ava {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.acct-ava svg { width: 19px; height: 19px; }
.acct-me-txt { min-width: 0; }
.acct-me-txt b {
  display: block;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.acct-me-txt em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}
/* 退出登录靠身份行的右缘；btn 是 ghost，不跟余额卡抢视觉 */
.acct-logout { margin-left: auto; flex: none; white-space: nowrap; }

/* 底部按钮条拆掉后，账户页最后剩「兑换码」贴着卡片底边 —— 给回一点
 * 呼吸空间。只补这一页：登录页有自己的操作行，流水页有滚动列表。 */
#paneAccount { padding-bottom: 12px; }

/* 未登录页的操作行：原来在 .modal-foot 里，容器拆掉后跟着输入框走 */
.acct-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 4px 0 12px;
  padding-top: 13px;
}
.acct-actions .btn { min-width: 78px; justify-content: center; }

/* ---------------- 登录页 ----------------
 * 只影响 #paneLogin：账户页的 .acct-me / 余额卡 / 兑换卡各有各的样式，
 * 把这里的选择器全部挂在 .login-pane 下，免得改登录框把已登录那几页带跑偏。 */
.login-pane {
  position: relative;
  /* 顶栏在未登录时不占位（.acct-tabs.login-mode），这里补一点上边距，
     让头图离卡片顶边和右上角那颗关闭键都有口气 */
  padding-top: 15px;
  padding-bottom: 14px;
  /* 建一个层叠上下文，好让 .login-bg 的 z-index:-1 只沉到内容下面，
     而不是穿到弹窗背后去（否则白卡片上什么都看不见） */
  isolation: isolate;
}

/* ---- 背景动效层 ----
 * 灵感来自宣传页：网格 + 光斑，但这里是浅色弹窗，所以全部降到
 * 「看得见但不抢字」的透明度（网格 5.8%、光斑 17% 以内）。
 * 早先还有一条从上到下的扫描带，用户反馈像「有条线一直在扫」太抢眼，已删；
 * 现在只留会漂的两团光斑 + 一层几乎看不见的网格。
 * inset 取 0：.login-pane 的 padding box 本身就是卡片边，往外多吃 18/16px
 * 会把 .modal-card 的 scrollWidth/scrollHeight 撑大（实测多出 18×16），
 * 于是卡片里凭空多一条纵向滚动条 —— 背景层再好看也不该改变弹窗尺寸。 */
.login-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
/* 网格：越靠上越清楚，到底部淡出，不干扰输入框区域 */
.login-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(43, 92, 230, .058) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 92, 230, .058) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(122% 84% at 50% -8%, #000 6%, transparent 74%);
  mask-image: radial-gradient(122% 84% at 50% -8%, #000 6%, transparent 74%);
}
/* 两团光斑：一蓝一橙（和主色、logo 同一对颜色），19 / 23 秒互相错开地漂移，
 * 周期取质数级别的差别，看久了不会同步成「一起呼吸」的节奏 */
.login-bg i {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
.login-bg i:nth-child(1) {
  left: -78px;
  top: -92px;
  width: 210px;
  height: 210px;
  background: radial-gradient(circle, rgba(43, 92, 230, .17), rgba(43, 92, 230, 0) 70%);
  animation: loginOrbA 19s ease-in-out infinite alternate;
}
.login-bg i:nth-child(2) {
  right: -66px;
  top: 46px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 118, 44, .115), rgba(255, 118, 44, 0) 70%);
  animation: loginOrbB 23s ease-in-out infinite alternate;
}
@keyframes loginOrbA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(28px, 36px, 0) scale(1.16); }
}
@keyframes loginOrbB {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to { transform: translate3d(-24px, 30px, 0) scale(.92); }
}

/* 头图：圆角方块的渐变图标 + 一句主标题 + 一句解释 */
.login-hero {
  padding: 4px 0 15px;
  text-align: center;
}
.login-hero-ico {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 11px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #4a7cf5, #2453d8);
  /* 和顶栏那颗登录按钮同一套「实心蓝 + 顶部高光」，点开浮层再点登录，
     配色能接得上，不会像换了个产品 */
  box-shadow: 0 6px 16px rgba(37, 84, 216, .26), inset 0 1px 0 rgba(255, 255, 255, .3);
}
/* 两圈从图标边缘荡开的光环（宣传页那颗「状态点」的放大版）：
 * 错开 2.1 秒，看起来像设备在找信号。z-index:-1 + isolation 让光环沉到
 * 蓝方块下面，只在露出去的那一圈可见，不会在图标上糊一层膜。 */
.login-hero-ico::before,
.login-hero-ico::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 16px;
  border: 1px solid rgba(43, 92, 230, .34);
  pointer-events: none;
  animation: heroPing 4.2s cubic-bezier(.2, .6, .3, 1) infinite;
}
.login-hero-ico::after { animation-delay: 2.1s; border-color: rgba(43, 92, 230, .22); }
@keyframes heroPing {
  0% { transform: scale(1); opacity: .6; }
  70% { transform: scale(1.62); opacity: 0; }
  100% { transform: scale(1.62); opacity: 0; }
}
.login-hero-ico svg { width: 25px; height: 25px; }
.login-hero b {
  display: block;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -.2px;
  color: var(--text);
}
.login-hero em {
  display: block;
  margin-top: 5px;
  padding: 0 8px;
  font-style: normal;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  /* 窄屏上最后一行只剩一两个字（「…跟着号走」的「走」）很难看，
   * 有这个属性就让浏览器把字匀到两行里去 */
  text-wrap: pretty;
}

/* 赠礼徽章：淡蓝底 + 细边框，数字用主色，签到那句再降一级 */
.login-gift {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #dde7fc;
  border-radius: 10px;
  background: linear-gradient(180deg, #f6f9ff, #eef4ff);
}
.login-gift-ico { flex: none; width: 17px; height: 17px; margin-top: 1px; color: #dd8a2b; }
.login-gift-ico svg { display: block; width: 100%; height: 100%; }
.login-gift-txt { min-width: 0; }
.lg-main { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.lg-main b {
  color: var(--primary);
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lg-sub { display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.lg-sub b { color: #cf7c1c; font-weight: 650; font-variant-numeric: tabular-nums; }
/* 后台把赠礼和签到都关掉时整块去掉，不留一个「送 0 分」的框 */
.login-gift[hidden] { display: none; }

/* 前置原因（积分不足 / 登录过期）：单独一条黄条，不混进赠礼文案 */
.login-why {
  margin: -6px 0 12px;
  padding: 7px 11px;
  border: 1px solid #f2e2bf;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  line-height: 1.55;
}
.login-why[hidden] { display: none; }

/* 输入框：42px 高度 + 左侧图标。图标用绝对定位而不是假 icon 字体，
 * 换主题只改 color，形状不会变成豆腐块。 */
.login-pane .fld { margin-bottom: 13px; }
.login-pane .fld input { height: 42px; font-size: 14px; }
.fld-wrap { position: relative; display: block; }
.fld-ico-i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #9aa5ba;
  pointer-events: none;
  transition: color .15s;
}
.fld-ico-i svg { display: block; width: 100%; height: 100%; }
.login-pane .fld-wrap input { padding-left: 38px; }
/* 输入框拿到焦点时图标跟着变蓝：视线落在哪一行，一眼看得出来 */
.fld-wrap:focus-within .fld-ico-i { color: var(--primary); }

/* 「获取验证码」：浅蓝底的主色按钮，和灰底 ghost 拉开 —— 它是个动作，不是取消。
 * 高度要盖过 .fld-row .btn 的 36px，所以选择器带上 .login-pane；
 * 宽度锁 100px：「60 秒后重发」比「获取验证码」长，不锁会在倒计时里左右跳。 */
.login-pane .fld-row .code-btn {
  height: 42px;
  min-width: 100px;
  padding: 0 12px;
  border: 1px solid #cfdcfb;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.login-pane .fld-row .code-btn:hover:not(:disabled) { background: #e2ebfe; border-color: #b7cbf8; }
.login-pane .fld-row .code-btn:disabled { opacity: .6; cursor: not-allowed; }

/* 操作行：主按钮全宽在上，取消降级成文字按钮在下 */
.login-actions {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  margin: 2px 0 0;
  padding-top: 14px;
}
.login-actions .btn { width: 100%; min-width: 0; }
.login-actions .btn.primary {
  height: 42px;
  font-size: 14px;
  font-weight: 650;
  background: linear-gradient(135deg, #3f74f2, #2453d8);
  box-shadow: 0 6px 16px rgba(37, 84, 216, .24), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.login-actions .btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4a7cf5, #2a5ade);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 84, 216, .3), inset 0 1px 0 rgba(255, 255, 255, .24);
}
.login-actions .btn.primary:active { transform: translateY(0); }
.login-cancel {
  height: 34px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
.login-cancel:hover { background: var(--panel-2); color: var(--text-2); }

/* 余额不够时的原因。原来它顶掉的是扣费说明，现在扣费说明成了表，
 * 这句就单独占一条 —— 两件事不该抢同一个位置。 */
.acct-reason {
  margin: 0 0 12px;
  padding: 8px 11px;
  border: 1px solid #f2e2bf;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  line-height: 1.55;
}
.acct-reason[hidden] { display: none; }

/* 扣费表：一眼比出三个档位，比一句「2×2 = 99，3×3 = 199…」好读得多 */
.acct-price {
  margin: 0 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.acct-price-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.acct-price-head b { font-size: 12px; font-weight: 650; color: var(--text-2); }
.acct-price-head em { font-style: normal; font-size: 11px; color: var(--muted); }

.price-table { width: 100%; border-collapse: collapse; }
.price-table td {
  padding: 9px 12px;
  color: var(--text-2);
  font-size: 12.5px;
  border-top: 1px dashed var(--border);
}
.price-table tbody tr:first-child td { border-top: 0; }
.price-table td:first-child b { font-size: 13px; font-weight: 650; color: var(--text); }
.price-table td:first-child span { margin-left: 1px; font-size: 11px; color: var(--muted); }
.price-table td:last-child { text-align: right; white-space: nowrap; }
.price-table td:last-child b {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}


.acct-price-free {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid #d3f0e4;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
}
.acct-price-free::before { content: "✓"; font-size: 11px; font-weight: 700; }
/* 后台把免费重导窗口关掉（0 小时）时，这条不能还挂着绿勾 */
.acct-price-free.off {
  border-top-color: var(--border);
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 500;
}
.acct-price-free.off::before { content: "—"; }

/* 档位数字：账户页那张充值表已移除，这几个类现在只给积分超市的
 * 货架卡片用（.st-pts / .shop-tier 在此基础上覆盖成卡片的大号排版）。 */
.tier-pts { color: var(--text-2); }
.tier-pts b { font-size: 13.5px; font-weight: 650; color: var(--text); }
.tier-gift {
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 99px;
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
  color: var(--ok);
  background: var(--ok-soft);
}
.tier-times { text-align: right; white-space: nowrap; color: var(--text-2); }

/* ---------------- 全规格次数表（积分超市）----------------
 * 账户页表头那张「移上去」的浮层已移除。下面这批 .tiers-all-* 排版类
 * 现在归积分超市 .shop-matrix 的全规格表用：标题 / 表头 / 单元格共用一套。 */
.tiers-all-cap {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text-2);
}
.tiers-all-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tiers-all-table th,
.tiers-all-table td { padding: 2.5px 0; text-align: center; font-size: 11px; }
.tiers-all-table .tiers-all-k { width: 30%; text-align: left; }
.tiers-all-pts {
  margin-left: 4px;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.tiers-all-table thead th { font-weight: 600; font-size: 10.5px; color: var(--muted); }
.tiers-all-table tbody th { font-weight: 600; color: var(--text-2); }
.tiers-all-table tbody td { font-weight: 650; font-size: 11.5px; color: var(--text); }
.tiers-all-table tbody tr + tr th,
.tiers-all-table tbody tr + tr td { border-top: 1px dashed var(--border); }
/* 当前规格那列和主表同一个口径，标出来省得用户自己数第几列 */
.tiers-all-table .is-cur { color: var(--primary); background: var(--primary-soft); }
.tiers-all-note {
  margin: 6px 0 0;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--muted);
}
/* ---------------- 每日签到 ----------------
 * 和余额卡并排会抢注意力，所以放在余额下面、做成一条横向小卡：
 * 左边一个日历图标，中间一句「今天能得多少」，右边一颗按钮。
 * 签过之后整条换成绿色系、按钮变灰，不再留第二颗可点的按钮。 */
.checkin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #f0e3c8;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fffaf1, #fff);
  transition: background .18s, border-color .18s;
}
.checkin[hidden] { display: none !important; }
.checkin-ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--warn-soft);
  color: var(--warn);
  transition: background .18s, color .18s;
}
.checkin-ico svg { width: 19px; height: 19px; }
.checkin-txt { flex: 1; min-width: 0; }
.checkin-txt b { display: block; font-size: 13px; font-weight: 650; color: var(--text); }
.checkin-txt em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}
/* 待签到：黄底深字，和左边那颗黄日历图标同调。
 * 白色字压在黄底上看不清（对比不到 3:1），所以文字走深棕，
 * 顶部再加一道 inset 高光，让它看着像颗按得下去的实体按钮。 */
.checkin-btn {
  flex: none;
  white-space: nowrap;
  background: linear-gradient(180deg, #f8c34c, #e5a013);
  color: #4d3504;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(168, 116, 8, .3), inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: filter .15s, transform .1s, box-shadow .15s;
}
.checkin-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 2px 5px rgba(168, 116, 8, .34), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.checkin-btn:active:not(:disabled) { transform: translateY(1px); }
/* 已签到：整条卡已经转绿，按钮跟着变绿、并停在那儿。
 * opacity 必须显式写 1 —— .btn:disabled 默认把它压到 .45，
 * 绿色被冲成灰绿，看着像「签到没成功」。 */
.checkin.done .checkin-btn {
  background: linear-gradient(180deg, #12a06f, #0a7a53);
  color: #fff;
  box-shadow: 0 1px 2px rgba(10, 122, 83, .26);
  opacity: 1;
  cursor: default;
}
/* 已签到：整体退成绿色，视觉上「这件事今天结束了」 */
.checkin.done { border-color: #cfeadd; background: linear-gradient(135deg, #f2fbf7, #fff); }
.checkin.done .checkin-ico { background: var(--ok-soft); color: var(--ok); }

/* ---------------- 兑换码 ----------------
 * 拿到实体卡的人第一件事就是找这个框。原来只是账户页底部的一行普通表单，
 * 和上面那张充值卡表分家、也不像能操作 —— 现在单独一张卡：图标 + 标题 +
 * 大号等宽输入框 + 主色按钮，一眼看见「这里是兑卡的地方」。 */
.redeem {
  margin: 2px 0 6px;
  padding: 12px;
  border: 1px solid #d9e3fb;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f7faff, #fff);
}
.redeem-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.redeem-ico {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.redeem-ico svg { width: 18px; height: 18px; }
.redeem-txt { min-width: 0; }
.redeem-txt b { display: block; font-size: 13.5px; font-weight: 650; }
.redeem-txt em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}
.redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.redeem-row input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.redeem-row input::placeholder {
  color: #aab2c2;
  font-weight: 500;
  letter-spacing: .06em;
}
.redeem-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.redeem-row .btn {
  height: 40px;
  padding: 0 18px;
  white-space: nowrap;
}
.redeem .modal-err { margin: 9px 0 0; }

/* 卖家联系卡：做成一张「联系名片」——淡蓝底 + 左侧色条，和上方纯灰的兑换框
   一眼区分开，让用户认出「这是能联系到人的地方」。信息量仍克制，
   分量弱于「兑换」这个主操作，别抢戏。 */
.seller-card {
  position: relative;
  margin: 10px 0 4px;
  padding: 13px 14px 13px 16px;
  border: 1px solid #dbe4ff;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f6f9ff 0%, #eef3ff 100%);
  overflow: hidden;
}
/* 左侧竖色条：名片的「身份」标记，圆角由 overflow 裁出 */
.seller-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #5b86f5, #2b5ce6);
}
.seller-card[hidden] { display: none; }
.seller-head {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 11px;
}
.seller-ico {
  flex: none; width: 32px; height: 32px;
  border-radius: 10px; display: grid; place-items: center;
  background: #fff;
  border: 1px solid #dbe4ff;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(43, 92, 230, .08);
}
.seller-ico svg { width: 18px; height: 18px; }
.seller-txt { min-width: 0; }
.seller-txt b { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); }
.seller-txt em {
  display: block; margin-top: 2px;
  font-style: normal; font-size: 11px; color: var(--muted);
}
.seller-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
/* 名字是这张卡的主角：放大加粗，让用户一眼确认「就是这个人」 */
.seller-name {
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: .2px;
}
/* 电话是这张卡唯一动作 —— 做成实心主按钮，和「兑换」同级的可点感，
   不再用描边款（描边太弱，用户看不出能拨打）。 */
.seller-phone {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #3d70f0, #2556dd);
  border: 1px solid #2556dd;
  color: #fff;
  box-shadow: 0 1px 2px rgba(31, 66, 170, .26), inset 0 1px 0 rgba(255, 255, 255, .2);
  font-size: 13px; font-weight: 650;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: filter .15s var(--ease), transform .1s var(--ease);
}
.seller-phone:hover { filter: brightness(1.07); }
.seller-phone:active { transform: translateY(1px); }
.seller-phone svg { width: 14px; height: 14px; flex: none; }

/* ---------------- 未登录 · 登录领好礼 ----------------
 * 挂在顶栏「登录」按钮下面的一次性浮层，不遮页面：用户可以无视它继续排版。
 * 尖角指回按钮，避免「这是哪来的弹窗」；同一会话关掉就不再弹（app.js 管）。 */
.promo {
  position: fixed;
  top: 62px;
  right: 10px;
  z-index: 900;
  /* 和右栏那张 .report 卡同宽（= 右栏 − 10px 内边距 ×2 − 4px 滚动条），
   * 浮层右沿 14px、报告卡右沿 10px，两者视觉上齐着一条竖线 */
  width: calc(var(--right-col) - 20px);
  max-width: calc(100vw - 20px);
  padding: 17px 19px 14px;
  /* 两团很淡的光（蓝 / 橙）压在右下角和左下角：给这张「礼物卡」一点科技感，
   * 也让它和白色面板区分开。刻意避开右上角 —— 那里的尖角是纯 var(--panel)，
   * 光斑打上去会露出一条接缝。 */
  background:
    radial-gradient(240px 160px at 108% 78%, rgba(43, 92, 230, .10), transparent 72%),
    radial-gradient(190px 140px at -14% 102%, rgba(255, 118, 44, .085), transparent 74%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(16, 24, 44, .16), 0 2px 8px rgba(16, 24, 44, .05);
  animation: promoIn .2s cubic-bezier(.2, .9, .3, 1);
}
.promo[hidden] { display: none !important; }
/* 尖角：正方形转 45°，只留上、左两条边，指向顶栏那颗按钮。
 * right 的算法：按钮右沿离窗口 18px、宽 77px → 圆心在 56.5px；
 * 浮层自身右沿 14px、尖角宽 13px → right = 56.5 - 6.5 - 14 ≈ 36。
 * 按钮改成实心蓝后宽了一点，这里跟着挪，否则尖角会指到按钮左边外面。 */
.promo::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 36px;
  width: 13px;
  height: 13px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 2px 0 0 0;
  transform: rotate(45deg);
}
@keyframes promoIn {
  from { opacity: 0; transform: translateY(-7px) scale(.985); }
}
.promo-title {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--text);
}
.promo-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.promo-x:hover { background: var(--panel-2); color: var(--text); }
.promo-sec + .promo-sec { margin-top: 13px; }
.promo-sec > b {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.promo-sec ul {
  margin: 6px 0 0;
  padding-left: 17px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.95;
}
.promo-sec li::marker { color: #a7b2c8; }
.promo-sec em {
  font-style: normal;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.promo-cta {
  width: 100%;
  height: 40px;
  margin-top: 15px;
  font-size: 14px;
  justify-content: center;
}
.promo-foot {
  margin: 8px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* 价目卡本体只是悬浮层的内容源，平时不渲染；放进 .tip-layer 后复用
 * .acct-price-head / .price-table / .acct-price-free 的样式，浮层自己
 * 不再垫 padding，否则卡片内边距会翻倍。 */
.price-card[hidden] { display: none; }
.tip-layer.price-tip {
  padding: 0;
  /* 定宽：靠内容撑开时只有 ~190px，底部绿条会把最后一个字挤成孤行 */
  width: 252px;
  max-width: 252px;
  overflow: hidden;
  border-radius: 10px;
  line-height: 1.5;
  /* 卡片是只读的，但允许鼠标移上去细看：否则从胶囊挪到卡上就收起了 */
  pointer-events: auto;
}
.tip-layer.price-tip .acct-price-head { padding: 8px 12px; }
.tip-layer.price-tip .price-table td { padding: 8px 12px; }
.tip-layer.price-tip .acct-price-free { padding: 8px 12px; }

/* ---------------- 账户顶栏：页签 + 关闭 ----------------
 * 用页签而不是一路往下堆：流水和记录会无限长，堆在账户页底下会把
 * 「兑换码」顶出屏幕。这条顶栏取代了原来的 .modal-head —— 未登录时
 * 三个页签让位给「登录」标题，关闭按钮两种状态都在最右。 */
.acct-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 13px;
}
/* 容器设了 display:flex，hidden 会失效 —— 保险起见自己关掉 */
.acct-tabs[hidden] { display: none; }

/* 登录页（未登录）：这条栏不占位，只把关闭键留在卡片右上角。
 * 不用 display:none —— 关掉就没有关闭入口了；改成绝对定位，
 * 下面 .login-pane 直接从卡片顶边开始排，省下的 57px 刚好把
 * 之前被顶出来的那条纵向滚动条也一起消掉。 */
.acct-tabs.login-mode {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 3;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  /* 头图里有「登录智能建模助手」了，这里不再重复一遍标题 */
}
.acct-tabs.login-mode .acct-tabs-title { display: none !important; }
/* 半透明白底 + 细边 + 轻阴影的关闭键：现在是全局默认款，不再限定父级。
 * 登录/教程/市场/分享/导出确认弹窗的 × 都挂了 .atab-x，统一用这一颗。
 * 放在 .modal-x 之后覆盖其透明样式 —— 这就是「所有弹窗关闭键都一样」。 */
.atab-x {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(43, 92, 230, .12);
  background: rgba(255, 255, 255, .74);
  color: var(--text-2);
  font-size: 17px;
  box-shadow: 0 1px 3px rgba(23, 33, 56, .07);
  backdrop-filter: blur(6px);
  transition: background .14s, color .14s, border-color .14s, transform .14s;
}
.atab-x:hover {
  background: #fff;
  color: var(--text);
  border-color: rgba(43, 92, 230, .24);
}
.atab-x:active { transform: scale(.94); }

.acct-tablist { display: flex; align-self: stretch; gap: 2px; min-width: 0; }
.acct-tablist[hidden] { display: none !important; }
.acct-tabs-title {
  flex: 1;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.2px;
}
.acct-tabs-title[hidden] { display: none !important; }
/* 关闭按钮顶到最右：页签长短会变，靠 margin-left:auto 而不是固定间距 */
.atab-x { margin-left: auto; flex: none; }

.atab {
  position: relative;
  display: flex;
  align-items: center;
  /* 撑满顶栏高度，下面那条 2px 选中线才贴得住 .acct-tabs 的底线 */
  padding: 0 10px;
  border: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.atab:hover { background: var(--panel-2); color: var(--text); }
.atab.on { color: var(--primary); }
/* 贴住容器那道底线：用 -1px 把它盖住，页签才和分隔线连成一条 */
.atab.on::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
}

/* ---------------- 明细 / 记录列表 ----------------
 * 每行两栏：左边说「是什么、什么时候、剩多少」，右边只放金额。
 * 金额单列一栏是为了能竖着扫一眼 —— 混在句子里就成了一堆数字。 */
.hist-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 2px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
}
.hist-row:first-child { border-top: 0; padding-top: 2px; }
/* .hist-row 自带 display:flex，会盖掉 UA 的 [hidden]，筛选时得显式关掉 */
.hist-row[hidden] { display: none; }

/* -------- 记录列表骨架屏 --------
 * 首屏要同时等列表、总账、可出售集合三个接口，空着像卡死。
 * 骨架放在独立容器里，不进 #jobsList —— 那边的 children.length 管着
 * 空态和「加载更多」，混入占位行会算错。 */
.hist-skeleton { padding: 2px 0; }
.hist-skeleton[hidden] { display: none; }
.sk-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 2px; border-top: 1px dashed var(--border);
}
.sk-row:first-child { border-top: 0; padding-top: 2px; }
.sk-cover { flex: none; width: 46px; height: 46px; border-radius: 8px; }
.sk-main { flex: 1; min-width: 0; }
.sk-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.sk-title { display: block; width: 58%; height: 12px; margin-top: 2px; }
.sk-sub { display: block; width: 42%; height: 10px; margin-top: 9px; }
.sk-amt { display: block; width: 46px; height: 13px; }
.sk-btn { display: block; width: 40px; height: 20px; border-radius: 6px; }
.sk-cover, .sk-title, .sk-sub, .sk-amt, .sk-btn {
  background: linear-gradient(100deg,
    var(--panel-2) 20%, var(--border) 42%, var(--panel-2) 64%);
  background-size: 220% 100%;
  animation: sk-shimmer 1.25s ease-in-out infinite;
}
@keyframes sk-shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
/* 降级：关掉动画的系统就留静态占位；两行按钮高度和真实行对齐 */
@media (prefers-reduced-motion: reduce) {
  .sk-cover, .sk-title, .sk-sub, .sk-amt, .sk-btn { animation: none; }
}

/* 列表自己滚，页签和底部按钮留在原位。
   让整张卡滚的话，翻到第二十条时标题和页签都滚出屏幕了，
   想换页得先滚回顶上 —— 而且那时「关闭」也够不着。 */
#ledgerList, #jobsList {
  max-height: min(46vh, 372px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hist-main { flex: 1; min-width: 0; }
.hist-main b {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -.1px;
}
.hist-main > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.hist-main em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 11.5px;
  color: var(--text-2);
}
.hist-bad { color: var(--danger) !important; }

.hist-tag {
  flex: none;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--warn-soft);
  color: var(--warn);
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.hist-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.hist-amt {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.2px;
  white-space: nowrap;
}
/* 入账用绿，扣费用正文色：扣分是常态，标红读起来像出错 */
.hist-amt.up { color: var(--ok); }
.hist-amt.down { color: var(--text); }
.hist-amt.free { font-size: 12px; font-weight: 600; color: var(--muted); }

.hist-dl {
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.hist-dl:hover { border-color: var(--primary); color: var(--primary); }
.hist-dl:disabled { opacity: .55; cursor: default; }

/* 导出记录左侧封面：固定小方图，无封面的老记录用占位块保持对齐 */
.hist-cover {
  flex: none; width: 46px; height: 46px; object-fit: cover;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2);
}
.hist-cover.ph {
  display: grid; place-items: center; color: var(--border-strong); font-size: 18px;
}
/* 出售：和下载并排，主色描边突出「能把作品卖出去」 */
.hist-sell {
  padding: 3px 8px;
  border: 1px solid var(--primary); border-radius: 6px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.hist-sell:hover { background: var(--primary); color: #fff; }
/* 两个按钮横向并排：下载在左、出售在右；金额独占上方右对齐 */
.hist-btns { display: flex; gap: 8px; align-items: center; }

.hist-empty {
  margin: 22px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.hist-empty[hidden] { display: none; }

/* .btn 自带 display，[hidden] 对它无效，得单独关 */
.hist-more {
  width: 100%;
  margin: 8px 0 4px;
  justify-content: center;
}
.hist-more[hidden] { display: none; }

/* ---------------- 导出记录：总账与筛选 ----------------
 * 账户弹窗只有 372px 宽：总账四格用 2×2 的compact 排法别挤成一行长数字；
 * 筛选两组 chip 和搜索框允许折行，宁可多占一行也别把按钮压扁。 */
.jobs-sum {
  margin: 2px 0 12px;
  padding: 11px 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.jobs-sum[hidden], .jobs-filter[hidden],
.jobs-filter-stat[hidden], .jobs-filter-empty[hidden] { display: none; }
.jobs-sum-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 9px;
}
.jobs-sum-top b { font-size: 13px; font-weight: 650; color: var(--text); }
.jobs-sum-top strong {
  font-size: 16px; color: var(--primary); font-variant-numeric: tabular-nums;
}
.jobs-sum-top > span { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.jobs-sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.jobs-sum-cell {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--panel);
}
.jobs-sum-cell em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.jobs-sum-cell b {
  font-size: 15px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.jobs-sum-note { margin: 8px 0 0; font-size: 10.5px; color: var(--text-2); }
.jobs-sum-note b { color: var(--primary); font-weight: 650; }

.jobs-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.jobs-fgroup {
  display: inline-flex; gap: 2px; padding: 2px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--panel-2);
}
.jobs-chip {
  padding: 3px 8px; border: 0; border-radius: 5px; background: transparent;
  color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.jobs-chip:hover { color: var(--text); }
.jobs-chip.on {
  background: var(--panel); color: var(--primary);
  box-shadow: 0 1px 3px rgba(23, 33, 56, .08);
}
.jobs-search-wrap { position: relative; flex: 1 1 140px; min-width: 120px; }
.jobs-search {
  width: 100%; box-sizing: border-box; padding: 5px 26px 5px 9px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--panel); color: var(--text);
  font-size: 11.5px; outline: none;
}
.jobs-search::placeholder { color: var(--muted); }
.jobs-search:focus { border-color: var(--primary); }
.jobs-search-clear {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: var(--panel-2); color: var(--muted);
  font-size: 14px; line-height: 1; cursor: pointer;
}
.jobs-search-clear[hidden] { display: none; }
.jobs-filter-stat { margin: 0 0 4px; font-size: 10.5px; color: var(--muted); }
.jobs-filter-empty {
  margin: 18px 0; font-size: 11.5px; color: var(--muted); text-align: center;
}

/* 订单号跟在第一行标题后面，小一号灰字；详情行只说大小/体积/耗时 */
.hist-id {
  font-size: 10.5px; font-weight: 500; color: var(--muted);
  font-style: normal; white-space: nowrap;
}
.hist-detail {
  display: block; margin-top: 3px; font-size: 10.5px; color: var(--text-2);
}

@media (max-width: 420px) {
  .jobs-sum-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- 导出确认（扣费）弹窗 ----------------
 * 信息顺序照着用户的疑问排：导什么 → 多大 → 扣多少 → 扣完还剩多少。
 * 免费重导单独一行绿条，因为「这次没扣钱」比「扣了多少」更怕误解。 */
/* ---------------- 导出确认窗：先看「下载的是什么」，再看钱 ----------------
 * 96px 方图 + 右侧说明做成横排，弹窗几乎不增高 —— 付款窗的「确认导出」
 * 必须一屏可见，不能让用户滚一下才找得到主按钮。 */
.pay-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.pay-thumb {
  flex: none;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.pay-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pay-thumb img[hidden] { display: none; }
.pay-thumb.empty::after { content: "暂无预览"; color: var(--muted); font-size: 11.5px; }
.pay-preview-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; line-height: 1.5; }
.pay-preview-info b { font-size: 13px; font-weight: 650; color: var(--text); }
.pay-preview-info span { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pay-preview-info em { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* 可打印性结论：绿 = 封闭实体可直接打，琥珀 = 预检没过 */
.pay-ready {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
}
.pay-ready[hidden] { display: none; }
.pay-ready::before {
  content: "✓";
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
  color: #fff;
  font-weight: 700;
}
.pay-ready.ok { color: #0a6b47; background: var(--ok-soft); border: 1px solid #c9ebdb; }
.pay-ready.ok::before { background: #0d9463; }
.pay-ready.bad { color: #8a5a08; background: var(--warn-soft); border: 1px solid #f0dfb8; }
.pay-ready.bad::before { content: "!"; background: #ba7517; }

.pay-file {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 500;
  word-break: break-all;
}
.pay-tip {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.6;
}
.pay-tip[hidden] { display: none; }

.pay-list {
  padding: 4px 0 2px;
  margin-bottom: 4px;
}
.pay-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.pay-item:last-child { border-bottom: 0; }
.pay-item > span { color: var(--muted); flex: 0 0 auto; }
.pay-item > b {
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
/* 「文件标题」可自己起个标题：视觉上仍落在右侧那一列，点一下就能改。
 * 框内内容右对齐，跟下面几行的值保持同一条右边界；留空时 placeholder 顶默认文字。
 * 只作备注 —— 下面「文件名」那行和真正下载的名字都不看它。 */
.pay-item-title { align-items: center; }
.pay-title-input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 190px;
  box-sizing: border-box;
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.3;
  text-align: right;
  transition: border-color .13s, box-shadow .13s;
}
.pay-title-input:hover { border-color: var(--border-strong); }
.pay-title-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.pay-title-input::placeholder { color: var(--muted); }

/* 扣费是这扇窗唯一的主角，比别的行都大一号 */
.pay-cost {
  font-size: 19px;
  letter-spacing: -.3px;
  color: var(--primary);
}
.pay-cost.free { color: var(--ok); }
.pay-cost.short { color: var(--danger); }
/* 购买确认里的作品标题可能很长，单行截断不把账目挤歪 */
.buy-work-name { max-width: 68%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pay-free, .pay-warn {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
}
.pay-free {
  color: #0a6b47;
  background: var(--ok-soft);
  border: 1px solid #c9ebdb;
}
.pay-warn {
  color: #9c2b2b;
  background: var(--danger-soft);
  border: 1px solid #f6d3d3;
}
/* 排队提示：蓝色信息条，和绿色的「免费重导」、红色的「积分不足」区分开 */
.pay-busy {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
  color: #1c4fa8;
  background: var(--primary-soft);
  border: 1px solid #c9d9fb;
}
.pay-busy[hidden] { display: none; }

/* -------- 生成等待窗 --------
 * 请求在途时唯一可见的反馈。只放一个转圈不够 —— 秒数一直在走、
 * 排队人数看得到，用户才知道系统还活着，而不是「点了没反应」。 */
.gen-card { width: 340px; }
.gen-body { text-align: center; padding: 20px 18px 22px; }
.gen-spinner {
  width: 42px; height: 42px; margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: genSpin .8s linear infinite;
}
@keyframes genSpin { to { transform: rotate(360deg); } }
.gen-elapsed { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.gen-elapsed b { font-size: 20px; color: var(--primary); margin: 0 2px; }
.gen-queue {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border: 1px solid #f0dfb8;
  color: #8a5a08;
  font-size: 12px;
  line-height: 1.55;
}
.gen-queue[hidden] { display: none; }
.gen-note { margin-top: 12px; color: var(--muted); font-size: 11.5px; }
/* 余额不足时按钮会变成「去充值」而不是变灰 —— 变灰等于把用户卡死在这里。
 * 这条保留作兜底：万一以后又出现需要禁用的状态，别让它看起来还能点。 */
#btnPayOk:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ---------------- 动效层 ----------------
 * 全是「锦上添花」的装饰：去掉功能一点不少。所以集中放一处，既看得全，
 * 也能被下面 prefers-reduced-motion 那一条规则一把停掉。
 *
 * 写新动效时守三条：
 *   1. 只碰 transform / opacity / background-position，不碰 width/height/top，
 *      否则每帧重排会带着左栏滚动位置一起抖；
 *   2. 幅度小、周期长（5 秒起），工具是拿来干活的，屏幕一直在动很累人；
 *   3. 装饰层一律 pointer-events:none，绝不挡点击。
 */

/* ---- 顶栏：底边流光 + logo 高光 ----
 * 顶栏是长时间挂在视野里的东西：动效一重就从「精致」变成「烦」。
 * 所以只留两件极小的事，峰值都压在 55% 上下。
 *
 * 这里曾经还铺过一层「网格 + 蓝橙两团漂移光斑」（.head-bg），看着像技术仪表，
 * 但顶栏只有 54px 高、底色又是纯白：光斑铺不满就成一块擦不掉的蓝印子，
 * 网格也只露得出两行线 —— 读起来像「没洗干净」，不像「有科技感」，已整体移除。
 * 顶栏保持干净的白，装饰只走底边那条细光和 logo 上的高光。 */

header { position: relative; }

/* 底边流光：一条 34% 宽的细光从左扫到右。
 * 走 transform 而不是 background-position —— 后者每帧都要重绘整条顶栏，
 * 1px 高的小线在合成层上平移才真的顺；will-change 提前把它提到一层。
 * 缓动两端留了 5% 的速度（y 从 .04 起步、.96 收尾）：标准 ease-in-out
 * 两端导数为 0，视觉上就是「停一下再窜出去」，慢周期时读起来像卡顿。 */
header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 34%;
  height: 1px;
  pointer-events: none;
  background-image: linear-gradient(90deg,
    transparent 0%,
    rgba(43, 92, 230, .06) 22%,
    rgba(43, 92, 230, .55) 50%,
    rgba(43, 92, 230, .06) 78%,
    transparent 100%);
  transform: translate3d(-115%, 0, 0);
  animation: headSweep 6.2s cubic-bezier(.45, .04, .55, .96) infinite;
  will-change: transform;
}
/* 6.2 秒走完一轮（原来 11 秒）：位移铺满整个周期，只在头尾各留半拍淡入淡出 */
@keyframes headSweep {
  0% { transform: translate3d(-115%, 0, 0); opacity: 0; }
  4% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translate3d(400%, 0, 0); opacity: 0; }
}

.brand-mark { position: relative; overflow: hidden; }
.brand-mark::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -66%;
  width: 62%;
  height: 140%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(0) skewX(-18deg);
  animation: logoShine 7.2s ease-in-out infinite;
}
/* 前 60% 静着，后面 0.6 秒扫过去 —— 一颗 30px 的方块频繁发光会很吵 */
@keyframes logoShine {
  0%, 60% { transform: translateX(0) skewX(-18deg); opacity: 0; }
  64% { opacity: 1; }
  86%, 100% { transform: translateX(300%) skewX(-18deg); opacity: 0; }
}

/* ---- 主按钮的流光 ----
 * 光带 z-index:-1 沉到按钮底色之上、文字之下（靠 isolation 建上下文），
 * 扫过时只把蓝色提亮一档，不会把白字冲糊 —— 宣传页那颗 CTA 就是把文字
 * 另包一层 span 压在上面的，这里不必为了装饰去改 DOM。 */
.login-actions .btn.primary,
.promo-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.login-actions .btn.primary::after,
.promo-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg,
    transparent 30%, rgba(255, 255, 255, .40) 48%, transparent 66%);
  transform: translateX(-130%);
  animation: btnShine 6.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btnShine {
  0%, 62% { transform: translateX(-130%); }
  86%, 100% { transform: translateX(130%); }
}

/* ---- 导出区深蓝标题栏：一道横向扫过的光 ----
 * 全页最深的一块底色，加流光最像「机器在跑」；换到浅色卡片上会显得脏。 */
.panel.left > .export-dock .sec-head {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.panel.left > .export-dock .sec-head::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg,
    transparent 32%, rgba(255, 255, 255, .19) 50%, transparent 68%);
  transform: translateX(-120%);
  animation: dockSweep 9s cubic-bezier(.4, 0, .6, 1) infinite;
  pointer-events: none;
}
@keyframes dockSweep {
  0%, 72% { transform: translateX(-120%); }
  96%, 100% { transform: translateX(120%); }
}

/* ---- 空画布标语：渐变里一道很慢的流光 ----
 * 常驻装饰，不是开场动画；动画名 sloganFlow 供冒烟测试校验。 */
@keyframes sloganFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .empty-stage .slogan-line { animation: none; background-position: 50% 50%; }
}

/* ---- 余额数字：变了才跳一下 ----
 * .bump 由 app.js 的 pulseOnce() 临时挂上（兑换、签到、扣费都走 renderBalance），
 * 常驻会变成「数字一直在抖」。 */
#acctBalance.bump {
  animation: numBump .52s cubic-bezier(.2, .8, .3, 1);
}
@keyframes numBump {
  0% { transform: scale(1); }
  38% { transform: scale(1.18); color: var(--primary); }
  100% { transform: scale(1); }
}

/* ---- 签到成功：绿色涟漪往外交代一次「加上了」 ---- */
.checkin-btn.just-done { animation: checkinRipple .75s ease-out; }
@keyframes checkinRipple {
  0% { box-shadow: 0 1px 2px rgba(10, 122, 83, .26), 0 0 0 0 rgba(18, 160, 111, .45); }
  100% { box-shadow: 0 1px 2px rgba(10, 122, 83, .26), 0 0 0 15px rgba(18, 160, 111, 0); }
}

/* ---------------- 响应式 ---------------- */

/* 系统开了「减少动态效果」时，所有过渡压到 1ms：
 * 滑块拖动、卡片展开、toast 淡入都用 transition，前庭敏感的人会被这些位移晃到 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1280px) {
  /* 右栏收窄，礼包浮层跟着收 —— 两边量的是同一个变量，不会一边 374 一边 330 */
  :root { --right-col: 330px; }
  .main { grid-template-columns: 300px minmax(0, 1fr) var(--right-col); }
}

/* 矮窗口（小笔记本、浏览器缩放、分屏）：登录页的内容 481px，而卡片顶到
 * 「视口高 - 24」。窗口一矮就超出去，一打开就带一条滚动条 —— 用户第一眼
 * 看到的不是「登录」，而是右侧那根灰条。这里把四处间距收一档、图标缩到 44px，
 * 整体压到 ~443px；正常窗口（≥ 540 高）完全不受影响。 */
@media (max-height: 540px) {
  .login-pane { padding-top: 11px; padding-bottom: 12px; }
  .login-hero { padding: 0 0 10px; }
  .login-hero-ico { width: 44px; height: 44px; margin-bottom: 8px; border-radius: 13px; }
  .login-hero-ico svg { width: 22px; height: 22px; }
  .login-gift { margin-bottom: 10px; padding: 8px 11px; }
  .login-actions { padding-top: 10px; }
  /* 新增的协议勾选行（~15px）要在这段里抵消掉，否则矮窗口又带出滚动条 */
  .login-agree { line-height: 1.3; }
  .login-pane { padding-bottom: 8px; }
  .login-gift { margin-bottom: 6px; }
}

@media (max-width: 1080px) {
  .main {
    grid-template-columns: 290px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .panel.right { display: none; }
}

/* 窄屏：浮层贴边铺满，尖角跟着账号按钮挪到最右 */
@media (max-width: 520px) {
  /* 顶栏只有 354px 可用：品牌副标题是装饰，先让位给「未连接服务器」和登录按钮，
   * 否则「未连接服务器」会被挤成「未连接服务 / 器」两行 */
  .brand small { display: none; }
  .chip { white-space: nowrap; }
  .promo {
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }
  /* 窄屏浮层贴左右各 10px，尖角跟着重算：56.5 - 6.5 - 10 = 40 */
  .promo::before { right: 40px; }
}

/* ============================================================
 * 申请上架弹窗（模具市场 M1）
 * 复用 .modal 体系：遮罩/×/Esc 关闭都走全局 data-close 逻辑。
 * 内部是窄表单， widths 走百分比 + flex，窄屏自然堆叠。
 * ============================================================ */
.pub-row { margin: 15px 0; }
.pub-label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 7px;
}
.pub-label .dim { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.pub-fee-hint { margin: 6px 0 0; color: var(--muted); font-size: 11px; opacity: .85; }
.pub-input {
  width: 100%; height: 36px; padding: 0 11px; box-sizing: border-box;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text); font: inherit; font-size: 13px;
  transition: border-color .13s, box-shadow .13s;
}
.pub-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
/* 自定义导出作品下拉：原生 option 放不了封面，这里按钮+列表自己画。
 * 隐藏的 #pubJob 仍是值载体，视觉全靠这一组。 */
.pub-pick { position: relative; }
.pub-pick-btn {
  width: 100%; min-height: 36px; padding: 4px 10px; box-sizing: border-box;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text); font: inherit; font-size: 13px;
  cursor: pointer; text-align: left;
}
.pub-pick-btn:hover { border-color: var(--primary); }
.pub-pick-btn[aria-expanded="true"] { border-color: var(--primary); box-shadow: var(--ring); }
.pub-pick-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.pub-pick-label > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pub-pick-arrow { flex: none; color: var(--muted); font-size: 11px; }
.pub-pick-cover {
  flex: none; width: 26px; height: 26px; object-fit: cover;
  border: 1px solid var(--border); border-radius: 5px; background: var(--panel-2);
}
.pub-pick-cover.ph { display: grid; place-items: center; color: var(--border-strong); font-size: 12px; }
.pub-pick-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 8;
  max-height: 260px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--panel); box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,.16));
}
.pub-pick-menu[hidden] { display: none; }
.pub-pick-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px;
  border-bottom: 1px dashed var(--border); cursor: pointer;
}
.pub-pick-item:last-child { border-bottom: 0; }
.pub-pick-item:hover, .pub-pick-item.on { background: var(--primary-soft); }
.pub-pick-item.off { opacity: .5; cursor: not-allowed; }
.pub-pick-item .pub-pick-cover { width: 38px; height: 38px; }
.pub-pick-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pub-pick-text b { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pub-pick-text small { font-size: 11px; color: var(--muted); }
.pub-pick-dis { color: var(--warn); }
/* 选中导出记录后的那一小行：封面/格位/板宽/格式一眼扫完，不占大块空间 */
.pub-jobinfo {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-top: 7px; font-size: 11.5px; color: var(--muted);
}
.pub-jobinfo .pub-job-ok { color: var(--ok); font-weight: 600; }
.pub-param {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 11.5px; color: var(--text-2); line-height: 1.7; margin-top: -8px;
  margin-bottom: 15px;
}
.pub-param b { color: var(--primary); }
.pub-consent {
  display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-2);
  line-height: 1.6; margin-bottom: 10px; cursor: pointer;
}
.pub-consent input { margin-top: 2px; flex: none; }

/* ============================================================
 * 模具市场弹窗：主站内的一张大窗，不是新页面。
 * 封面撑起卡片气质，信息/价格分层；详情在同一张卡里换屏，
 * 窄屏两列、详情上下堆，不出现双层遮罩。
 * ============================================================ */
.mk-card {
  width: min(940px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.mk-head {
  display: flex; align-items: center; gap: 12px; flex: none;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(115deg, var(--primary-soft), var(--panel) 46%);
}
.mk-head-ico {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #4d7cff, var(--primary));
  box-shadow: 0 5px 14px rgba(43, 92, 230, .24);
}
.mk-head-ico svg { width: 20px; height: 20px; }
.mk-head-text { flex: 1; min-width: 0; }
.mk-head-text h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.mk-head-text p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.mk-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.mk-toolbar { display: flex; align-items: center; gap: 10px; padding: 13px 18px 10px; flex: none; }
.mk-tabs {
  display: inline-flex; gap: 3px; padding: 3px; flex: 0 1 auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2);
}
.mk-tabs::-webkit-scrollbar { display: none; }
/* 窄屏横向可滑：右侧还有页签时渐隐一截，暗示能滑（滑到底由 JS 去掉 class） */
.mk-tabs.has-more { -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%); }
.mk-tab {
  border: 0; background: transparent; color: var(--muted);
  border-radius: 7px; padding: 6px 15px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: color .14s, background .14s;
}
.mk-tab:hover { color: var(--primary); }
.mk-tab.on { background: var(--panel); color: var(--primary); box-shadow: var(--shadow-1); }
.mk-share {
  margin-left: auto; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--panel); color: var(--text-2); padding: 7px 12px;
  font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.mk-share:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.mk-filterbar { display: flex; align-items: center; gap: 9px; padding: 0 18px 11px; flex: none; }
.mk-filter-label { color: var(--muted); font-size: 12px; flex: none; }
.mk-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.mk-chip {
  border: 1px solid var(--border); border-radius: 7px; background: var(--panel);
  color: var(--text-2); padding: 5px 11px; font-size: 12px; cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}
.mk-chip:hover { border-color: var(--primary); color: var(--primary); }
.mk-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.mk-count { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.mk-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; }

.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.mk-item {
  position: relative; border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: var(--panel); box-shadow: var(--shadow-1); cursor: pointer;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.mk-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: #b9cbfa; }
.mk-cover-wrap { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--panel-2); }
.mk-cover { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.mk-item:hover .mk-cover { transform: scale(1.03); }
.mk-cover-ph {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: linear-gradient(135deg, #eef2ff, #f7f9ff);
  color: rgba(43, 92, 230, .18); font-size: 52px; font-weight: 800;
}
.mk-badge {
  position: absolute; top: 9px; right: 9px; padding: 4px 9px; border-radius: 99px;
  color: #fff; background: rgba(24, 32, 50, .68); backdrop-filter: blur(4px);
  font-size: 11px; font-weight: 600;
}
.mk-badge.review { background: rgba(192, 122, 9, .92); }
.mk-badge.online { background: rgba(13, 148, 99, .92); }
.mk-badge.rejected { background: rgba(214, 59, 59, .92); }
.mk-item-body { padding: 10px 12px 11px; }
/* 规格徽章：把 P50 / P55 从灰色小字提成一眼可见的主色标签。
 * 详情用 .lg 放大；不抢标题的视觉权重，但比标签/日期醒目。 */
.mk-spec-badge {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content;
  padding: 3px 8px 3px 6px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 11px; line-height: 1.4; font-weight: 600;
}
.mk-spec-ico { display: inline-flex; width: 13px; height: 13px; flex: none; }
.mk-spec-ico svg { width: 100%; height: 100%; }
.mk-spec-label { color: var(--text-2); font-weight: 500; }
.mk-spec-val { font-size: 12.5px; font-weight: 800; letter-spacing: .2px; }
.mk-spec-badge.lg { gap: 5px; padding: 3px 9px 3px 7px; border-radius: 6px; font-size: 11px; }
.mk-spec-badge.lg .mk-spec-ico { width: 13px; height: 13px; }
.mk-spec-badge.lg .mk-spec-val { font-size: 12.5px; }
/* 列表里的规格徽章并进 meta 行，比详情那枚小一号，不再占标题上方的位置 */
.mk-item-meta .mk-spec-badge { gap: 4px; padding: 2px 6px 2px 5px; border-radius: 5px; font-size: 10px; }
.mk-item-meta .mk-spec-ico { width: 11px; height: 11px; }
.mk-item-meta .mk-spec-val { font-size: 11px; }
/* 格数徽章：紧跟规格徽章，但用中性色 —— 格数是排版选择、不是规格身份 */
.mk-cells-badge {
  display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--border); color: var(--text-2);
  font-size: 10px; line-height: 1.4; font-weight: 600; white-space: nowrap;
}
.mk-item-title { margin: 0; font-size: 14px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* 列表也按详情的节奏：规格 + 标签 + 日期同一行排完 */
.mk-item-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.mk-item-meta .mk-tags { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.mk-item-date { white-space: nowrap; }
.mk-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.mk-tag { border-radius: 5px; background: var(--panel-2); color: var(--text-2); padding: 3px 7px; font-size: 10.5px; }
.mk-prices { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border); }
/* 日期放价格行右侧：不另加图标，用淡色日期填掉原先的空白 */
.mk-prices .mk-item-date { margin-left: auto; color: var(--muted); font-size: 10.5px; }
.mk-price { display: flex; align-items: baseline; gap: 6px; border-radius: 7px; background: var(--panel-2); padding: 6px 9px; }
.mk-price span { color: var(--muted); font-size: 10px; }
.mk-price b { color: var(--primary); font-size: 13px; }
.mk-price b small { font-size: 10px; font-weight: 500; }
.mk-price.off b { color: var(--muted); font-weight: 500; }
.mk-reason { margin: 8px 0 0; color: var(--danger); font-size: 11px; line-height: 1.5; }

.mk-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 280px; padding: 32px 16px; text-align: center; }
.mk-empty-ico { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); font-size: 26px; }
.mk-empty-ico svg { display: block; width: 26px; height: 26px; }
.mk-empty b { font-size: 15px; }
.mk-empty p { margin: 7px 0 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.mk-empty-btn { border: 0; border-radius: 8px; background: var(--primary); color: #fff; padding: 9px 16px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mk-empty-btn.ghost { border: 1px solid #c6d7fb; background: var(--panel); color: var(--primary); }
/* 市场列表「加载更多」：居中一条，失败时按钮文案变「重试」，不重建已加载卡片 */
.mk-more-wrap { display: flex; justify-content: center; margin-top: 14px; }
.mk-more-btn {
  border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel-2);
  color: var(--text); padding: 8px 18px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.mk-more-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.mk-more-btn:disabled { opacity: .6; cursor: default; }
.mk-ph { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel); }
.mk-ph-cover { aspect-ratio: 4 / 3; background: var(--panel-2); }
.mk-ph-lines { padding: 12px; }
.mk-ph-line { height: 9px; margin-bottom: 8px; border-radius: 4px; background: var(--panel-2); }
.mk-ph-line.short { width: 55%; }
.mk-ph, .mk-ph-cover, .mk-ph-line { animation: mkPulse 1.2s ease-in-out infinite; }
@keyframes mkPulse { 50% { opacity: .55; } }

/* 返回键浮在信息区右上角，不占内容的一行 */
.mk-back { position: absolute; right: 0; top: -2px; z-index: 5;
  display: inline-flex; align-items: center; margin: 0; padding: 5px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--muted); font-size: 12px; cursor: pointer; }
.mk-back:hover { color: var(--primary); border-color: var(--primary); }
.mk-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.mk-detail-stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--panel-2); }
.mk-detail-3d { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.mk-detail-3d[hidden] { display: none; }
/* 加载动画盖住整个舞台：3D 没渲染好之前不露空画布，也不再闪封面 */
.mk-3d-loading, .mk-3d-fail {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: var(--panel-2); color: var(--muted); font-size: 12px;
}
.mk-3d-loading[hidden], .mk-3d-fail[hidden] { display: none; }
.mk-3d-spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: mkSpin .8s linear infinite; }
@keyframes mkSpin { to { transform: rotate(360deg); } }
.mk-3d-fail::before { content: '!'; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-size: 18px; font-weight: 700; }
.mk-3d-fail b { color: var(--text); font-size: 13px; }
.mk-3d-tip { position: absolute; left: 10px; right: 10px; top: 10px; z-index: 3; padding: 4px 8px; border: 1px solid var(--border); border-radius: 99px; background: rgba(255,255,255,.86); color: var(--muted); font-size: 11px; text-align: center; pointer-events: none; }
.mk-3d-tip[hidden] { display: none; }
.mk-detail-info { position: relative; min-width: 0; display: flex; flex-direction: column; }
.mk-detail-status { align-self: flex-start; display: inline-block; border-radius: 99px; padding: 4px 9px; background: var(--panel-2); color: var(--muted); font-size: 11px; font-weight: 600; }
.mk-detail-status.review { background: var(--warn-soft); color: var(--warn); }
.mk-detail-status.online { background: var(--ok-soft); color: var(--ok); }
.mk-detail-status.rejected { background: var(--danger-soft); color: var(--danger); }
.mk-detail-title { margin: 6px 0 0; font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.mk-detail-info > .mk-detail-title:first-child { margin-top: 0; }
/* 标签 + 更新时间并一行：标签在前、时间在后，时间不换行往右靠。 */
.mk-detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 8px; }
.mk-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-detail-sub { color: var(--muted); font-size: 11.5px; }
.mk-detail-params { margin-top: 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); padding: 10px 13px; }
.mk-detail-params[hidden] { display: none; }
/* 参数区头行：标题在左、规格徽章在右，一行排完不再各占一行 */
.mk-params-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; margin-bottom: 9px; }
.mk-params-head > b { font-size: 12px; flex: none; }
.mk-param-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.mk-param-grid span { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 11.5px; }
.mk-param-grid i { flex: none; font-style: normal; color: var(--muted); }
.mk-detail-note { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); padding: 11px 13px; color: var(--text-2); font-size: 11.5px; line-height: 1.7; }
.mk-detail-note.bad { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.mk-note-list { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.mk-note-list span { white-space: nowrap; }
.mk-note-list .no { color: var(--danger); }
/* 操作条贴在信息区右下角：内容不满时用 auto 外边距顶到底，按钮靠右 */
.mk-detail-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: auto; padding-top: 16px; }
.mk-buy-balance { display: inline-flex; align-items: center; gap: 6px; margin-right: auto;
  padding: 6px 11px; border: 1px solid var(--border); border-radius: 99px;
  background: var(--panel-2); color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.mk-buy-balance svg { flex: none; width: 13px; height: 13px; fill: var(--primary); }
.mk-buy-balance b { color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: -.2px; }
.mk-buy-balance.off { opacity: .65; }
.mk-buy-balance.off svg { fill: var(--muted); }
.mk-buy-balance.off b { color: var(--muted); }
.mk-btn { border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); color: var(--text-2); padding: 9px 15px; font-size: 12.5px; cursor: pointer; }
.mk-btn:hover { border-color: var(--primary); color: var(--primary); }
.mk-btn.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.mk-btn.primary:hover { background: var(--primary-hover); color: #fff; }
.mk-btn:disabled { opacity: .5; cursor: wait; }
.mk-btn.buy { border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 600; padding: 11px 20px; }
.mk-btn.buy:hover { background: var(--primary-hover); color: #fff; }
/* 下载次数用尽后的灰按钮：不转圈、明确不可点 */
.mk-btn.buy.off, .mk-btn.buy.off:disabled { background: var(--panel-2); border-color: var(--border);
  color: var(--muted); opacity: 1; cursor: not-allowed; }

/* M2 · 我的订单 / 售出记录 */
.mk-earn-banner { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 14px; padding: 13px 16px;
  border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--border); }
.mk-earn-banner span { color: var(--text-2); font-size: 12.5px; }
.mk-earn-banner b { color: var(--primary); font-size: 24px; line-height: 1; }
.mk-earn-banner small { color: var(--muted); font-size: 11px; }
.mk-order-buy { display: flex; align-items: center; gap: 7px; margin-top: 11px; padding-top: 10px;
  border-top: 1px dashed var(--border); font-size: 12px; color: var(--text-2); }
.mk-order-buy b { color: var(--text); font-size: 13px; }
.mk-order-status { margin-left: auto; padding: 2px 7px; border-radius: 20px; font-size: 10.5px; }
.mk-order-status.done { background: var(--ok-soft, #e7f7ee); color: var(--ok, #1a7f43); }
.mk-order-status.failed { background: var(--danger-soft, #fdeaea); color: var(--danger); }
.mk-order-status.pending, .mk-order-status.off { background: var(--muted-soft, #eef0f3); color: var(--muted); }
.mk-order-sub { margin-top: 5px; color: var(--muted); font-size: 11px; }
.mk-order-sub.bad { color: var(--danger); }
.mk-order-fee { opacity: .8; }
.mk-order-actions { margin-top: 10px; }
.mk-order-actions .mk-btn { width: 100%; text-align: center; }
.mk-order-actions .mk-btn.off { background: var(--panel-2); border-color: var(--border); color: var(--muted); cursor: not-allowed; opacity: 1; }
.mk-order-earn { margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text-2); }
.mk-order-earn b { color: var(--primary); font-size: 15px; }

@media (max-width: 720px) {
  .mk-card { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 14px; }
  .mk-head { padding: 12px 14px 11px; }
  .mk-head-ico { width: 34px; height: 34px; border-radius: 10px; }
  .mk-head-text p { display: none; }
  .dlg-head { padding: 12px 14px 11px; }
  .dlg-head-ico { width: 34px; height: 34px; border-radius: 10px; }
  .dlg-head-text p { display: none; }
  .mk-toolbar { padding: 11px 14px 8px; gap: 7px; }
  .mk-tabs { flex: 1 1 auto; }
  .mk-tab { padding: 6px 10px; font-size: 11.5px; white-space: nowrap; }
  .mk-share { padding: 7px 9px; font-size: 11px; flex: none; }
  .mk-filterbar { padding: 0 14px 10px; }
  .mk-scroll { padding: 2px 14px 14px; }
  .mk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mk-item-title { font-size: 13px; }
  .mk-price { padding: 5px 7px; }
  .mk-price b { font-size: 12px; }
  .mk-detail-layout { grid-template-columns: 1fr; gap: 14px; }
  .mk-detail-stage { aspect-ratio: 16 / 9; }
  .mk-detail-title { font-size: 18px; }
}
@media (max-width: 380px) {
  .mk-grid { grid-template-columns: 1fr; }
}

/* ============================================================
 * 协议阅读弹窗 + 各处入口（纯前端，看看为主）
 * ============================================================ */
#policyModal { z-index: 1200; }               /* 盖在 login/buy/publish（1000）之上 */
.policy-card { width: 460px; }
.policy-body { max-height: 60vh; overflow: auto; padding: 4px 12px; }
.policy-sec { margin-bottom: 14px; }
.policy-sec:last-child { margin-bottom: 0; }
.policy-sec h4 {
  margin: 0 0 5px; font-size: 12.5px; font-weight: 600; color: var(--text);
}
.policy-sec p {
  margin: 0; font-size: 12px; line-height: 1.65; color: var(--text-2);
}

/* 链接态按钮：长得像文字链接，但保留 button 的键盘可达性。
 * 所有协议入口统一用它，别给原生 <a> 塞 href —— 避免触发页面跳转。 */
.plink {
  display: inline; padding: 0; border: 0; background: none;
  color: var(--primary); font: inherit; font-size: inherit;
  cursor: pointer;
}
.plink:hover { opacity: .82; }
.plink:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }

/* 出售弹窗：合规提示（淡） */
.pub-legal {
  margin: 10px 0 0; font-size: 11px; line-height: 1.6;
  color: var(--muted); opacity: .9;
}

/* 登录弹窗：协议勾选（淡，贴着按钮上方） */
.login-agree {
  display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap;
  margin: 0; font-size: 11px; line-height: 1.4; color: var(--muted);
}
.login-agree input { margin: 1px 0 0; flex: none; accent-color: var(--primary); }
/* 这一行是新增内容（约 15px）。矮窗口的登录框原本压到 ~443px 刚好不滚，
 * 加它之后会溢出，媒体查询里再收 16px 抵消（见 max-height:540px 那段）。 */

/* 页脚：协议入口夹在公司名前面，用小字分隔 */
.foot-mid .plink { margin-right: 12px; }

@media (max-width: 720px) {
  .policy-card { width: calc(100vw - 24px); }
  .policy-body { max-height: 64vh; }
}

/* ==================== 我的字板规格（本地保存） ====================
 * 保存入口只在「自定义」态出现；我的规格不塞进 seg（多了放不下），
 * 收进旁边一个「我的规格 ▾」下拉，点击展开，点名称套用、点 × 删除。
 * 面板内联展开独占一整行（不用绝对定位）—— 祖先 .sec 有 overflow:hidden，
 * 浮层会被裁；撑开高度的方式和字体下拉 .font-picker-panel 一致。 */
.spec-save-link {
  display: inline-block; margin: 7px 0 0; font-size: 11.5px;
}
.spec-save-link[hidden] { display: none; }
/* 规格主按钮（字板另存 / 框体覆盖）已挪到「预制规格」行上方，靠这条和下面的
 * 规格行拉开距离。全局 [hidden]{display:none!important} 保证隐藏时不占这 14px。 */
.spec-save-btn { margin-bottom: 14px; }

/* 官方 seg + 我的规格按钮同一行；我的规格按钮宽度只按内容，不跟着均分。
 * align-items:stretch 让「我的规格」和 seg 自动等高 —— 面板已移出这一行、
 * flex-basis:100% 换行独占第二行，不会再像以前那样把 seg 一起撑成竖排。 */
.preset-line { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.preset-line .seg { flex: 1 1 0; min-width: 0; }
.mine-spec-menu { flex: none; display: flex; }
.mine-spec-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  flex: none; height: 100%; box-sizing: border-box;
  padding: 6px 10px; border: 1px solid #dfe6f1; border-radius: 9px;
  background: var(--panel); color: var(--text-2);
  font: inherit; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  cursor: pointer;
  transition: border-color .14s var(--ease), color .14s var(--ease), box-shadow .14s var(--ease);
}
.mine-spec-btn:hover,
.mine-spec-btn[aria-expanded="true"] {
  border-color: var(--primary); color: var(--primary);
  box-shadow: 0 1px 2px rgba(30, 50, 100, .1), 0 0 0 1px rgba(43, 92, 230, .1);
}
.mine-spec-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.msm-caret { font-size: 10px; line-height: 1; transition: transform .16s var(--ease); }
.mine-spec-btn[aria-expanded="true"] .msm-caret { transform: rotate(180deg); }

/* 面板：内联撑开，不覆盖、不裁切；列表限高内部滚动 */
.mine-spec-panel[hidden] { display: none; }
.mine-spec-panel {
  flex: 1 1 100%;    /* 换行独占一整行，不挤 seg */
  margin-top: 0; padding: 9px 10px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fbfcfe; box-shadow: var(--shadow-2);
}
.msm-head {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 7px; font-size: 11.5px; font-weight: 650; color: var(--text-2);
}
.msm-list { display: flex; flex-direction: column; gap: 5px; max-height: 268px; overflow-y: auto; }
.msm-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--text); font: inherit; text-align: left;
  cursor: pointer;
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.msm-item:hover { border-color: var(--primary); background: #f5f8ff; }
.msm-item.on {
  border-color: var(--primary); background: #f2f6ff;
  box-shadow: inset 3px 0 0 var(--primary);
}
.msm-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msm-txt b {
  font-size: 12.5px; font-weight: 650; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msm-txt small { font-size: 11px; color: var(--muted); }
.msm-del {
  flex: none; font-style: normal; font-weight: 700; font-size: 15px; line-height: 1;
  color: var(--muted); opacity: .6; padding: 2px 4px; border-radius: 5px;
}
.msm-del:hover { color: #c0392b; opacity: 1; background: rgba(192, 57, 43, .08); }

/* 命名弹窗：一行输入 + 已存列表，沿用通用 .modal / .dlg-head */
.spec-body { padding-bottom: 14px;padding-top: 14px; }
.spec-label {
  display: block; margin: 0 0 6px; font-size: 12.5px;
  font-weight: 600; color: var(--text-2);
}
.spec-input {
  width: 100%; height: 40px; box-sizing: border-box;
  padding: 0 11px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel); color: var(--text);
  font: inherit; font-size: 13.5px;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.spec-input::placeholder { color: var(--muted); }
.spec-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.spec-tip {
  margin-top: 7px; font-size: 11.5px; line-height: 1.55; color: var(--muted);
}
/* 存素材前的拔模风险：预检没过就红着说清楚，别让带病路径和好路径存成一样 */
.asset-draft-warn {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid rgba(214, 59, 59, .28); background: rgba(214, 59, 59, .07);
  color: var(--bad, #d63b3b); font-weight: 600;
}
.asset-draft-warn[hidden] { display: none; }
.spec-list-wrap { margin-top: 14px; }
.spec-list-wrap[hidden] { display: none; }
.spec-sub {
  margin-bottom: 7px; font-size: 12px; font-weight: 600; color: var(--text-2);
}
.spec-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 190px; overflow: auto;
}
.spec-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel-2);
}
.spec-item-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.spec-item-txt b {
  font-size: 13px; font-weight: 650; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.spec-item-txt span { font-size: 11px; color: var(--muted); }
.spec-item-del { flex: none; font-size: 11.5px; color: var(--danger, #c0392b); }

/* ==================== 素材库（编辑台定死路径 → 字板逐格取用） ==================== */
/* 编辑台「存入素材库」按钮行 */
.asset-save-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border);
}
/* 「存入素材库」是本区唯一的主操作：蓝色 + 撑满整行。
 * 原来是 ghost 小白按钮，跟旁边「更换」同款描边，一眼看不出该点哪个。
 * 光加 .btn.wide 不够：那是 width:100%，而 flex 行里 .btn 的 flex-basis 仍是
 * auto，按钮会被右侧说明文字挤回去 —— 这里显式给 flex-basis 100%，
 * 说明文字自然换到下一行（小屏本来就换行，两边行为一致）。 */
.asset-save-row > .btn.wide {
  flex: 1 0 100%;
  width: 100%;
}
.asset-save-row .btn svg { vertical-align: -2px; }
.asset-save-tip { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* 字板素材条：横向可选素材卡 */
.asset-lib-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; font-weight: 650; color: var(--text-2); margin: 2px 0 8px;
}
.asset-lib-actions { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.asset-lib-actions .btn.ghost.sm { white-space: nowrap; padding: 4px 8px; font-size: 11px; }
.asset-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px;
  scrollbar-width: thin;
}
.asset-empty { font-size: 12px; color: var(--muted); padding: 8px 0; line-height: 1.6; }
.asset-card {
  flex: none; width: 92px; cursor: pointer; user-select: none;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--panel-2); padding: 7px; text-align: center;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.asset-card:hover { border-color: var(--primary); }
.asset-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.asset-card.stale { border-color: var(--warn, #e08b17); background: rgba(224,139,23,.07); }
.asset-card.stale.on { box-shadow: 0 0 0 3px rgba(224,139,23,.18); }
.asset-card img {
  width: 100%; height: 62px; object-fit: contain; display: block;
  background: #fff; border-radius: 6px; border: 1px solid var(--border);
}
.asset-card.nothumb img { display: none; }
.asset-card.nothumb .asset-card-ph { display: flex; }
.asset-card-ph {
  display: none; width: 100%; height: 62px; border-radius: 6px; border: 1px solid var(--border);
  background: #fff; align-items: center; justify-content: center;
  font-size: 22px; color: var(--muted);
}
.asset-card b {
  display: block; margin-top: 5px; font-size: 11.5px; font-weight: 650; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.asset-card .asset-card-meta { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.asset-card .asset-card-warn { display: block; font-size: 10px; color: var(--warn, #e08b17); margin-top: 2px; line-height: 1.3; }
/* 未过拔模是硬伤（字板里会做成直壁），用红色和「参数已变」的黄色区分开 */
.asset-card .asset-card-warn.bad { color: var(--bad, #d63b3b); }
.asset-card.draft-bad { border-color: rgba(214, 59, 59, .45); }

/* 槽位不再单画一套：操作发生在画布上，说明只在下方黄色框里出现一次。
 * 原先这里还有 .asset-slot-head + 「清空格子」按钮，已按用户要求整块删除。 */

/* 弹窗里的素材管理列表 */
.asset-modal-list { display: flex; flex-direction: column; gap: 6px; max-height: 230px; overflow: auto; }
.asset-modal-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-2);
}
.asset-modal-item img {
  width: 46px; height: 46px; flex: none; object-fit: contain;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
}
.asset-modal-item .ami-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.asset-modal-item .ami-txt b { font-size: 13px; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-modal-item .ami-txt span { font-size: 11px; color: var(--muted); }
.asset-modal-item .ami-txt .stale { color: var(--warn, #e08b17); }
.asset-modal-item .ami-txt .stale.bad { color: var(--bad, #d63b3b); }
.asset-modal-item .spec-item-del { cursor: pointer; background: none; border: 0; font: inherit; }
.asset-modal-empty { font-size: 12px; color: var(--muted); padding: 10px 0; }

@media (max-width: 860px) {
  .asset-save-tip { flex-basis: 100%; }
}
