/* 表单功能模块复刻 —— 扁平极简风格 */

/* ------------------------------------------------------------
   设计令牌已统一迁移至 tokens.css（全站单一来源）。
   此处不再重复定义颜色/圆角/阴影，避免后加载覆盖新令牌。
   加载顺序：tokens.css → styles.css → theme.css
   本文件职责：布局骨架与结构（网格、三栏、断点、DOM 相关规则）
   ------------------------------------------------------------ */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

button, input, textarea, select { font-family: inherit; font-size: 14px; }

/* ---------- 顶栏（毛玻璃） ---------- */
.topbar {
  height: 56px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(26, 29, 36, 0.04), 0 4px 16px rgba(26, 29, 36, 0.04);
}
.topbar-brand { display: flex; align-items: center; gap: 8px; }
.logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--primary); color: #fff; flex: 0 0 auto;
}
.brand-text { font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 12px; color: var(--text-mute); }
.topbar-nav { display: flex; gap: 2px; }

/* 顶栏分组下拉（二维码 / 管理） */
.nav-group { position: relative; }
.nav-group[hidden] { display: none; }
.nav-group-end { margin-left: 2px; }
.nav-group-btn { display: inline-flex; align-items: center; gap: 5px; }
.caret { font-size: 9px; opacity: .55; transform: translateY(-1px); }
.nav-group-btn[aria-expanded='true'] .caret { transform: rotate(180deg) translateY(0); }
.nav-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 148px;
  display: flex; flex-direction: column; gap: 1px; padding: 5px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.nav-menu[hidden] { display: none; }
.nav-menu.is-right { left: auto; right: 0; }
.nav-menu-sep {
  margin: 4px 2px 2px; padding: 6px 8px 2px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-mute); white-space: normal; line-height: 1.5; max-width: 210px;
}
.nav-menu-item {
  text-align: left; border: none; background: none; padding: 8px 10px;
  border-radius: 6px; font-size: 13px; color: var(--text-sub); cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-menu-item:hover { background: var(--row-hover); color: var(--text); }
.nav-menu-item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-btn {
  border: none; background: transparent; color: var(--text-sub);
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
  font-weight: 500;
}
.nav-btn:hover { background: var(--bg); color: var(--text); }
.nav-btn.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.topbar-right { margin-left: auto; }
.badge-note {
  font-size: 12px; color: var(--text-mute);
  background: var(--bg); padding: 4px 12px; border-radius: 20px;
}

/* 窄屏：顶栏压缩，避免按钮文字竖排 */
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 8px 12px; gap: 8px 14px; }
  .topbar-brand { flex-wrap: wrap; }
  .brand-sub { display: none; }
  .topbar-nav { flex-wrap: nowrap; gap: 2px; overflow-x: auto; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .topbar-nav::-webkit-scrollbar { display: none; }
  .nav-btn { padding: 5px 9px; font-size: 13px; white-space: nowrap; }
  .view { height: auto; min-height: calc(100vh - 52px); }
}

/* ---------- 视图 ---------- */
.view { display: none; height: calc(100vh - 52px); }
.view.is-active { display: block; }
#view-designer.is-active { height: calc(100vh - 52px); }
#view-filler.is-active, #view-records.is-active, #view-templates.is-active,
#view-dashboard.is-active, #view-status.is-active, #view-qrcode.is-active,
#view-batch.is-active, #view-dashboard2.is-active, #view-qrwork.is-active,
#view-platform.is-active, #view-api.is-active, #view-ocr.is-active {
  height: auto; min-height: calc(100vh - 52px); overflow: auto;
}

/* ---------- 设计器三栏 ---------- */
.dz { display: grid; grid-template-columns: 264px 1fr 300px; height: 100%; }

.dz-lib, .dz-prop {
  background: var(--panel);
  display: flex; flex-direction: column;
  min-height: 0;
}
.dz-lib { border-right: 1px solid var(--border); }
.dz-prop { border-left: 1px solid var(--border); }

.dz-lib-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.dz-title-input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 7px 10px; font-weight: 600; outline: none;
}
.dz-title-input:focus { border-color: var(--primary); }
.dz-sub { font-size: 12px; color: var(--text-mute); margin-top: 8px; }

.dz-lib-scroll { overflow: auto; padding: 8px 0 24px; flex: 1; }
.dz-cat { margin-bottom: 6px; }
.dz-cat-title {
  font-size: 12px; color: var(--text-mute); padding: 8px 16px 6px;
  font-weight: 500; position: sticky; top: 0; background: var(--panel); z-index: 1;
}
.dz-cat-items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 12px; }
.dz-comp {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 6px; display: flex; flex-direction: column; align-items: center;
  gap: 4px; cursor: grab; background: var(--panel); user-select: none;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.dz-comp:hover { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--shadow-sm); }
.dz-comp:active { cursor: grabbing; }
.dz-comp-icon { display: inline-flex; color: var(--text-sub); height: 18px; }
.dz-comp:hover .dz-comp-icon { color: var(--primary); }
.dz-comp-icon svg { display: block; }
.dz-comp-label { font-size: 12px; color: var(--text-sub); text-align: center; line-height: 1.3; }
.dz-card-icon { display: inline-flex; align-items: center; margin-right: 6px; color: var(--text-sub); vertical-align: -2px; }

.dz-canvas { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.dz-canvas-head {
  height: 48px; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
}
.dz-count { font-size: 13px; color: var(--text-sub); }
.dz-status { margin-left: 10px; }

/* 状态面板（模块 3.2） */
.st-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  padding: 2px 10px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--bg); cursor: pointer; user-select: none;
  transition: all .2s var(--ease);
}
.st-chip.is-on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.st-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.st-row input[type='color'] {
  width: 32px; height: 28px; padding: 0; flex: none;
  border: 1px solid var(--border); border-radius: var(--radius); background: none; cursor: pointer;
}
.dz-status-tag {
  font-size: 11px; color: var(--text-mute); background: var(--bg);
  border: 1px solid var(--border); padding: 2px 8px; border-radius: 8px;
}
.dz-status-tag.is-pub { color: var(--success); background: #f0fbf0; border-color: #c6e9c6; }
.dash-status {
  font-size: 11px; padding: 1px 6px; border-radius: 8px; margin-left: 8px;
  color: var(--text-mute); background: var(--bg); border: 1px solid var(--border);
}
.dash-status.is-pub { color: var(--success); background: #f0fbf0; border-color: #c6e9c6; }
.dz-actions { margin-left: auto; display: flex; gap: 8px; }
.dz-canvas-scroll { flex: 1; overflow: auto; padding: 16px; }

.dz-empty {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 60px 20px; text-align: center; color: var(--text-mute);
}
.dz-empty-title { font-size: 14px; margin-bottom: 6px; }
.dz-empty-sub { font-size: 12px; }

.dz-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  margin-bottom: 12px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.dz-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.dz-card.is-selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.dz-card-bar {
  display: flex; align-items: center; padding: 8px 14px;
  border-bottom: 1px solid var(--border); background: var(--bg-elev);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.dz-card-type { font-size: 12px; color: var(--text-mute); }
.dz-card-ops { margin-left: auto; display: flex; gap: 4px; opacity: 0; }
.dz-card:hover .dz-card-ops, .dz-card.is-selected .dz-card-ops { opacity: 1; }
.dz-op {
  border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius);
  width: 22px; height: 22px; cursor: pointer; color: var(--text-sub); line-height: 1;
  transition: all .2s var(--ease);
}
.dz-op:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); }
.dz-op-del:hover { border-color: var(--danger); color: var(--danger); }
.dz-card-body { padding: 12px; }
.dz-card-title { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.dz-card-desc { font-size: 12px; color: var(--text-mute); margin-top: 4px; }
.dz-card-opts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.dz-card-opts span {
  font-size: 11px; background: var(--bg); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 8px; color: var(--text-sub);
}
.dz-badge {
  font-size: 11px; color: var(--primary); background: var(--primary-soft);
  padding: 1px 8px; border-radius: 8px; font-weight: 400;
}
.dz-children { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--border); }

/* ---------- 属性面板 ---------- */
.dz-prop-head {
  height: 48px; display: flex; align-items: center; padding: 0 16px;
  border-bottom: 1px solid var(--border); font-weight: 500;
}
.dz-prop-body { overflow: auto; padding: 0 0 24px; flex: 1; }
.dz-prop-empty { padding: 40px 20px; text-align: center; color: var(--text-mute); font-size: 13px; line-height: 1.8; }
.dz-prop-sec { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dz-sec-title { font-size: 12px; color: var(--text-mute); margin-bottom: 10px; font-weight: 500; }
.dz-field { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.dz-field > span { font-size: 13px; color: var(--text-sub); flex: 0 0 66px; }
.dz-field input:not([type=radio]):not([type=checkbox]):not(.dz-input-fixed), .dz-field select, .dz-field textarea {
  flex: 1; border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 6px 8px; outline: none; min-width: 0; background: var(--panel);
  color: var(--text); caret-color: var(--text);
}
/* 单选/复选不参与「拉满整行」：否则控件被撑宽，圆点飘到行中间、文字被推到最右 */
.dz-field input[type=radio], .dz-field input[type=checkbox] { flex: none; }
.dz-field input:-webkit-autofill,
.dz-field input:-webkit-autofill:hover,
.dz-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  caret-color: var(--text);
}
.dz-field input:focus, .dz-field select:focus, .dz-field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.dz-field-block { display: block; }
.dz-field-block > span { display: block; margin-bottom: 6px; }
.dz-check { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 8px; font-size: 13px; color: var(--text-sub); cursor: pointer; }
.dz-check input { margin-top: 2px; }
.dz-hint { font-size: 12px; color: var(--text-mute); }
.dz-list-row { display: flex; gap: 5px; margin-bottom: 5px; }
.dz-list-row input { flex: 1; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 5px 8px; outline: none; min-width: 0; }
.dz-list-row input:focus { border-color: var(--primary); }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
  transition: all .2s var(--ease);
  font-weight: 500;
}
.btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 2px 8px rgba(59, 110, 245, 0.12); }
.btn-primary {
  background: var(--primary-grad);
  border: none; color: #fff;
  box-shadow: 0 1px 2px rgba(26, 29, 36, 0.12);
}
.btn-primary:hover { color: #fff; background: var(--primary-hover); }
.btn-block { width: 100%; padding: 11px; }
.btn-mini {
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text-sub);
  padding: 4px 12px; border-radius: var(--radius); cursor: pointer; font-size: 12px;
  transition: all .2s var(--ease);
}
.btn-mini:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-ghost { border: none; background: transparent; color: var(--text-sub); padding: 4px 8px; border-radius: 8px; font-size: 16px; line-height: 1; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
a.btn-mini { display: inline-block; text-decoration: none; line-height: 1.4; }

.dz-toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: rgba(26,29,36,.9); color: #fff; padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; opacity: 0; transition: .2s var(--ease); pointer-events: none; z-index: 200;
}
.dz-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 全局轻提示 */
.wb-toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: rgba(26,29,36,.92); color: #fff; padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; opacity: 0; transition: .2s var(--ease); pointer-events: none; z-index: 300;
  max-width: 80vw; text-align: center;
}
.wb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 预览弹窗 ---------- */
.dz-preview-mask {
  position: fixed; inset: 0; background: rgba(26,29,36,.45);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px;
}
.dz-preview {
  background: var(--panel); border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.dz-preview-head {
  display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.dz-preview-title { font-weight: 600; }
.dz-preview-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.dz-preview-head .btn { margin-left: auto; }
.dz-preview-body { padding: 18px; overflow: auto; }

/* ---------- 填写端 ---------- */
.filler { max-width: 560px; margin: 0 auto; padding: 24px 16px 60px; }
.filler-head { margin-bottom: 20px; }
.filler-title { font-size: 20px; margin: 0 0 6px; }
.filler-desc { font-size: 13px; color: var(--text-sub); }
.filler-body { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); }

.f-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.f-item:last-of-type { border-bottom: none; }
.f-label { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.req-star { color: var(--danger); margin-right: 3px; }
.f-desc { font-size: 12px; color: var(--text-mute); margin-bottom: 7px; }
.f-control { margin-top: 8px; }
.f-input, .f-textarea, .f-select {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 9px 12px; outline: none; background: var(--panel);
  color: var(--text); caret-color: var(--primary);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.f-input:focus, .f-textarea:focus, .f-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.f-input-sm { padding: 4px 7px; font-size: 13px; }
.f-select-sm { width: auto; padding: 4px 7px; font-size: 13px; }
.f-textarea { resize: vertical; min-height: 84px; }
.f-inline { display: flex; align-items: center; gap: 8px; }
.f-unit { font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.f-opt { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; }
.f-opt input { width: 16px; height: 16px; }
.f-check-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.f-check-row .f-opt { flex: 1; }
.f-checklist-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.f-checklist-hint { font-size: 12px; color: var(--text-mute); }
.fw-perm-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.fw-perm-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.fw-perm-row b { min-width: 90px; }
.fw-perm-row .qw-radio { margin: 0; }
/* 记录协作弹窗 */
.fw-timeline { max-height: 42vh; overflow-y: auto; padding: 4px 2px 8px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.fw-tl-row { position: relative; display: flex; gap: 10px; padding: 6px 0 6px 14px; font-size: 13px; }
.fw-tl-row time { color: var(--text-mute); min-width: 118px; font-size: 12px; }
.fw-tl-dot { position: absolute; left: 2px; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.fw-tl-row b { font-weight: 500; }
.fw-tl-row i { color: var(--text-mute); font-style: normal; margin-left: 6px; font-size: 12px; }
.fw-tl-sep { font-size: 12px; color: var(--text-mute); margin: 10px 0 6px; }
.fw-tl-note { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; }
.fw-tl-note-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-mute); margin-bottom: 4px; }
.fw-tl-note-head span { padding: 0 6px; border-radius: 10px; background: var(--bg-soft); }
.fw-tl-note-body { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.fw-collab-form { display: flex; flex-direction: column; gap: 8px; }
.fw-modal-err:empty { display: none; }
.f-matrix { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.f-matrix th, .f-matrix td { border: 1px solid var(--border); padding: 6px 8px; font-size: 13px; text-align: center; }
.f-matrix th { background: var(--bg-elev); font-weight: 500; }
.f-matrix-add { display: flex; gap: 8px; }
.f-upload { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 14px; text-align: center; }
.f-upload-tip { font-size: 12px; color: var(--text-mute); margin-bottom: 10px; }
.f-upload-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.f-upload-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); padding: 6px 10px; border-radius: var(--radius); font-size: 12px; text-align: left;
}
.f-upload-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius); flex: 0 0 40px; border: 1px solid var(--border); }
.f-upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-upload-size { color: var(--text-mute); flex: 0 0 auto; }
.f-upload-del {
  border: none; background: transparent; color: var(--text-mute);
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; flex: 0 0 auto;
}

/* OCR 识别结果（展示结构化键值 + 状态提示） */
.f-ocr-result {
  margin: 0 0 10px; padding: 8px 12px; text-align: left;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
}
.f-ocr-kv { display: flex; gap: 10px; font-size: 13px; padding: 2px 0; line-height: 1.5; }
.f-ocr-kv span { color: var(--text-mute); flex: 0 0 auto; min-width: 72px; }
.f-ocr-kv b { font-weight: 500; word-break: break-all; }
.f-ocr-status { font-size: 13px; color: var(--text-mute); }
.f-ocr-status.is-err { color: var(--danger); }
.f-ocr-status.is-warn { color: var(--warning); }
.f-upload-del:hover { color: var(--danger); }
.f-upload-item[data-uploading="1"] { opacity: 0.6; }
.f-sign-canvas { width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); touch-action: none; display: block; }
.f-sign-bar { margin-top: 8px; text-align: right; }
.f-rich { font-size: 13px; color: var(--text-sub); line-height: 1.7; }

.f-item.has-error .f-input, .f-item.has-error .f-textarea, .f-item.has-error .f-select { border-color: var(--danger); }
.filler-errors { margin: 12px 0; }
.err-item { font-size: 12px; color: var(--danger); padding: 4px 0; }
.filler-done { text-align: center; padding: 50px 20px; }
.done-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.done-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.done-sub { font-size: 13px; color: var(--text-mute); }

/* 核销码 */
.done-ticket {
  margin-top: 16px; padding: 16px; background: var(--bg);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.done-ticket-label { font-size: 12px; color: var(--text-mute); margin-bottom: 6px; }
.done-ticket-code {
  font-size: 28px; font-weight: 700; letter-spacing: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--primary); margin: 8px 0;
}
.done-ticket-tip { font-size: 12px; color: var(--text-mute); }

/* ---------- 记录列表 ---------- */
.rec { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }
.rec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.rec-head h2 { font-size: 18px; margin: 0; }
.rec-count { font-size: 13px; color: var(--text-mute); }
.rec-ops { margin-left: auto; display: flex; gap: 8px; }
.rec-ops .btn { text-decoration: none; }
/* 列表行规范：与工作台 .wb-list 一致（无缝行 + 分隔线 + 统一内边距/悬停） */
.rec-list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.rec-item { padding: 14px 18px; min-height: 64px; border-bottom: 1px solid var(--border); transition: background .15s var(--ease); }
.rec-item:last-child { border-bottom: none; }
.rec-item:hover { background: var(--row-hover); }
.rec-item-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.rec-submitter { font-weight: 500; }
.rec-time { font-size: 12px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.rec-item-body { font-size: 13px; color: var(--text-sub); line-height: 1.7; }
.rec-empty { color: var(--text-mute); font-size: 12px; }
.rec-item-ops { margin-top: 10px; display: flex; gap: 8px; }
.kv { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv .k { color: var(--text-mute); flex: 0 0 120px; }
.kv .v { flex: 1; word-break: break-all; position: relative; }

@media (max-width: 720px) {
  .rec { padding: 14px 12px 40px; }
  .rec-head { flex-wrap: wrap; gap: 8px; }
  .rec-ops { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .rec-item { padding: 12px 14px; }
}

/* 记录页统计 tab */
.rec-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.rec-tabs::-webkit-scrollbar { display: none; }
.rec-tab { background: none; border: none; padding: 12px 14px; font-size: 14px; color: var(--text-sub); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .2s var(--ease), border-color .2s var(--ease); }
.rec-tab:hover { color: var(--text); }
.rec-tab.is-on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.rec-pane { min-height: 120px; }
.rec-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; font-size: 13px; }
.rec-table th, .rec-table td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.rec-table th { background: var(--bg-elev); color: var(--text-sub); font-weight: 500; font-size: 12px; }
.rec-table tbody tr:last-child td { border-bottom: none; }
.rec-table tbody tr:hover { background: var(--row-hover); }

/* ---------- 问卷题型：评分 / NPS ---------- */
.f-rate { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.f-rate-star { cursor: pointer; }
.f-rate-star input { position: absolute; opacity: 0; width: 0; height: 0; }
.f-rate-star span { font-size: 26px; line-height: 1.2; color: #d5dae3; transition: color .12s var(--ease); }
/* row-reverse 下，DOM 中靠后的 label 显示在左侧（分值更低）→ 选中/悬停时把低分星一并点亮 */
.f-rate-star:hover span, .f-rate-star:hover ~ .f-rate-star span { color: #e8a33d; }
.f-rate-star:has(input:checked) span, .f-rate-star:has(input:checked) ~ .f-rate-star span { color: #e8a33d; }
.f-rate-star:focus-within span { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: 4px; }

.f-nps { display: flex; gap: 6px; flex-wrap: wrap; }
.f-nps-btn input { position: absolute; opacity: 0; width: 0; height: 0; }
.f-nps-btn span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px; font-size: 13px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border-strong); color: var(--text-sub);
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.f-nps-btn:hover span { border-color: var(--primary); color: var(--primary); }
.f-nps-btn:has(input:checked) span { background: var(--primary); border-color: var(--primary); color: #fff; }
.f-nps-btn:focus-within span { outline: 2px solid var(--primary); outline-offset: 1px; }
.f-nps-labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-mute); }

/* ---------- 接龙名单（填写页公开） ---------- */
.relay-list {
  margin: 0 0 16px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.relay-head { padding: 10px 14px; font-size: 13px; color: var(--text-sub); border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.relay-head b { color: var(--primary); font-variant-numeric: tabular-nums; }
.relay-loading { padding: 12px 14px; font-size: 12px; color: var(--text-mute); }
.relay-row {
  display: flex; align-items: baseline; gap: 8px; padding: 8px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.relay-row:last-child { border-bottom: none; }
.relay-no { flex: 0 0 28px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.relay-name { font-weight: 500; color: var(--text); }
.relay-summary { flex: 1; min-width: 0; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relay-time { flex: 0 0 auto; font-size: 12px; color: var(--text-mute); font-variant-numeric: tabular-nums; }

/* ---------- 字段统计（问卷选项分布） ---------- */
.fst-block { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 12px; }
.fst-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }
.fst-title span { font-size: 12px; font-weight: 400; color: var(--text-mute); }
.fst-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.fst-label { flex: 0 0 130px; font-size: 13px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fst-bar { flex: 1; height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.fst-bar i { display: block; height: 100%; background: var(--primary); border-radius: 5px; min-width: 0; transition: width .3s var(--ease); }
.fst-num { flex: 0 0 76px; text-align: right; font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.fst-num em { font-style: normal; color: var(--text-mute); }
@media (max-width: 640px) {
  .fst-label { flex-basis: 88px; }
  .fst-num { flex-basis: 64px; }
}
.rec-qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rec-qr-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.rec-qr-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.rec-qr-title { font-weight: 600; margin-bottom: 6px; }
.rec-qr-meta { font-size: 12px; color: var(--text-mute); line-height: 1.7; }
.rec-act { margin-top: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.rec-act-title { font-weight: 600; margin-bottom: 8px; }
.rec-act-item { font-size: 13px; color: var(--text-sub); padding: 6px 0; border-bottom: 1px solid var(--border); }
.rec-act-item:last-child { border-bottom: none; }

/* 填写规则的时间段输入 */
.dz-fs-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dz-fs-range input { flex: 1; min-width: 140px; }
/* 分页填写 */
.f-steps { display: flex; align-items: center; gap: 8px; padding: 10px 0 14px; flex-wrap: wrap; }
.f-step { font-size: 13px; color: var(--text-sub); padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); }
.f-step.is-on { color: #fff; background: linear-gradient(135deg, var(--primary), #6366f1); border-color: transparent; }
.f-step.is-done { color: var(--primary); border-color: var(--primary); }
.f-step-sep { color: var(--text-mute); }
.f-page-title { font-size: 15px; font-weight: 600; margin: 4px 0 12px; padding-left: 8px; border-left: 3px solid var(--primary); }
.f-page-nav { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.f-page-nav .btn { flex: 1; }
.f-page-indicator { font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.f-page-break { text-align: center; font-size: 13px; color: var(--text-sub); padding: 8px; border-top: 2px dashed var(--border); border-bottom: 2px dashed var(--border); border-radius: 6px; background: var(--bg); }
/* 记录搜索框 + 时间范围 + 批量操作 */
.rec-search { width: 180px; padding: 5px 10px; font-size: 13px; }
.rec-date { width: 128px; padding: 4px 8px; font-size: 13px; }
.rec-date-sep { font-size: 12px; color: var(--text-mute); }
.rec-ops { flex-wrap: wrap; align-items: center; }
.rec-bulk { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rec-bulk .dz-check { font-size: 13px; }
.rec-pick { display: inline-flex; align-items: center; margin-right: 2px; }
.rec-pick input { margin: 0; }
.dz-col-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 16px; }
.ru-status-on { color: #16a34a; font-size: 12px; }
.ru-status-off { color: var(--text-mute); font-size: 12px; }
.ru-ops { white-space: nowrap; }
.ru-ops .btn-mini { margin-right: 4px; }

/* ---------- 模板库 ---------- */
.tpl { max-width: 1240px; margin: 0 auto; padding: 24px 16px 60px; }
.tpl-head h2 { font-size: 18px; margin: 0 0 6px; }
.tpl-sub { font-size: 13px; color: var(--text-mute); margin-bottom: 18px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tpl-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.tpl-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.tpl-title { font-weight: 600; margin-bottom: 4px; }
.tpl-desc { font-size: 12px; color: var(--text-mute); margin-bottom: 10px; }
.tpl-fields { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.tpl-fields span { font-size: 11px; background: var(--bg); border: 1px solid var(--border); padding: 2px 8px; border-radius: 8px; color: var(--text-sub); }

@media (max-width: 1100px) {
  .dz { grid-template-columns: 200px 1fr 260px; }
}

/* 窄屏：设计器三栏改为纵向堆叠，避免整页横向滚动 */
@media (max-width: 860px) {
  .dz {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: 100%;
  }
  .dz-lib, .dz-prop {
    border: none;
    border-bottom: 1px solid var(--border);
    max-height: 40vh;
  }
  .dz-canvas { min-height: 50vh; }
  .dz-canvas-head {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 8px;
  }
  .dz-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .dz-actions .btn { flex: 1; min-width: 84px; }
  .dz-comp-items { grid-template-columns: repeat(3, 1fr); }
  .f-matrix { display: block; overflow-x: auto; white-space: nowrap; }
  .f-matrix th, .f-matrix td { min-width: 72px; }
}

/* ---------- 仪表盘 ---------- */
.dash { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 28px; }
.dash-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); }
.dash-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.dash-num { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.2; font-variant-numeric: tabular-nums; }
.dash-label { font-size: 13px; color: var(--text-sub); margin-top: 6px; }
.dash-sec h3 { font-size: 15px; margin: 0 0 12px; }
.dash-list { display: flex; flex-direction: column; gap: 10px; }
.dash-item { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.dash-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.dash-item-title { font-weight: 500; margin-bottom: 4px; }
.dash-item-meta { font-size: 12px; color: var(--text-mute); }
.dash-item-ops { margin-top: 10px; display: flex; gap: 8px; }
.user-name { font-size: 13px; color: var(--text-sub); margin-right: 6px; }

/* ---------- 二维码生成 ---------- */
.qrgen { max-width: 860px; margin: 0 auto; padding: 24px 16px 60px; display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.qrgen-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.qrgen-panel h3 { font-size: 15px; margin: 0 0 14px; }
.qrgen-opts { display: flex; gap: 12px; }
.qrgen-opts .dz-field { flex: 1; }
.qrgen-preview { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; text-align: center; box-shadow: var(--shadow-sm); }
.qrgen-preview img { image-rendering: pixelated; max-width: 100%; }

/* ---------- 公开填写页（/f/:formId） ---------- */
.public-body { background: var(--bg); }
.public-loading, .public-error { max-width: 560px; margin: 80px auto; padding: 0 16px; text-align: center; color: var(--text-mute); }
.public-error-title { font-size: 16px; color: var(--text); font-weight: 600; margin-bottom: 8px; }
.public-error-msg { font-size: 13px; }
.public-error-tip { font-size: 12px; color: var(--text-mute); margin-top: 16px; }
.public-body .filler { padding-top: 20px; }
.public-body .filler-title { font-size: 19px; }
.public-body .filler-body { padding: 16px; }

/* ---------- 表单二维码弹窗 ---------- */
.qrform-qr { display: block; margin: 0 auto 14px; image-rendering: pixelated; }
.qrform-url {
  font-size: 12px; color: var(--text-sub); word-break: break-all;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; margin-bottom: 12px; text-align: center;
}
.qrform-ops { display: flex; gap: 8px; }
.qrform-ops .btn { flex: 1; }

/* ---------- 记录附件链接 ---------- */
.kv-file { color: var(--primary); text-decoration: none; border-bottom: 1px solid var(--primary-soft); }
.kv-file:hover { border-bottom-color: var(--primary); }
.f-upload-item.is-error { color: var(--danger); }
.f-upload-item.is-error .f-upload-size { color: var(--danger); }

@media (max-width: 820px) {
  .qrgen { grid-template-columns: 1fr; }
}

/* ==================== 访客身份识别 ==================== */

/* 公开页顶部的提示条 */
.visitor-banner {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 14px; margin: 0 0 14px;
  font-size: 13px; line-height: 1.55;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-sub);
}
.visitor-banner-icon {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; margin-top: 1px;
}
.visitor-banner.is-new { background: #f5f8ff; border-color: #cfe0ff; color: #2b5a9e; }
.visitor-banner.is-new .visitor-banner-icon { background: #2b5a9e; color: #fff; }
.visitor-banner.is-recognized { background: #f0fbf0; border-color: #c6e9c6; color: #1f7a1f; }
.visitor-banner.is-recognized .visitor-banner-icon { background: #1f7a1f; color: #fff; }

/* 已锁定字段 */
.f-item.is-locked .f-control input,
.f-item.is-locked .f-control textarea,
.f-item.is-locked .f-control select {
  background: #f6f7f9; color: var(--text-sub);
  border-style: dashed;
}
.f-locked-tip {
  margin-top: 5px; font-size: 11px; color: var(--success);
  display: flex; align-items: center; gap: 4px;
}

/* 提交成功后的「已记住」提示 */
.done-tip {
  margin-top: 8px; padding: 8px 12px; border-radius: var(--radius);
  background: #f0fbf0; color: #1f7a1f; font-size: 12px;
  border: 1px solid #c6e9c6;
}

/* ==================== 平台管理（后端操作平台） ==================== */

.plat { display: block; padding: 22px 26px 32px; max-width: 1320px; }
/* 只有后台（带左侧二级导航）才横排；班组页是上下结构，不能被子元素挤成两列 */
.plat.has-nav { display: flex; gap: 26px; align-items: flex-start; }
/* 左侧二级导航（分组）：替代原来 10 个平铺页签，避免宽度挤压 */
.plat-nav {
  flex: 0 0 188px; width: 188px; position: sticky; top: 16px;
  padding: 12px 8px 16px; border-right: 1px solid var(--border);
}
.plat-nav-group { margin-bottom: 18px; }
.plat-nav-label {
  font-size: 11px; font-weight: 600; letter-spacing: .1em; color: var(--text-mute);
  padding: 0 12px; margin-bottom: 6px;
}
.plat-nav-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 12px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-sub); font-size: 13px; line-height: 1.4; cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.plat-nav-item:hover { background: var(--primary-softer); color: var(--primary-700); }
.plat-nav-item.is-active {
  background: var(--primary-soft); color: var(--primary-700); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--primary-200);
}
.plat-nav-item:focus-visible,
.plat-toolbar input:focus-visible,
.plat-toolbar select:focus-visible {
  outline: 2px solid var(--border-focus); outline-offset: 2px;
}
.plat-main { flex: 1; min-width: 0; }
.plat-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.plat-title { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; color: var(--text); }
.plat-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--text-mute); line-height: 1.5; }
.plat-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.plat-body { display: flex; flex-direction: column; gap: 16px; }
/* 分组卡片：把每组配置收进一张卡，扫读成本明显下降 */
.plat-group {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow-xs);
}
.plat-h3 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--text);
}
.plat-h3::before {
  content: ''; width: 3px; height: 14px; border-radius: 2px;
  background: var(--primary-grad); flex: 0 0 auto;
}
.plat-hint {
  margin-bottom: 12px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--primary-softer); border: 1px solid var(--primary-100);
  color: var(--text-sub); font-size: 12.5px; line-height: 1.7;
}
.plat-detail { color: var(--text-mute); font-size: 12px; }
/* 表格：表头分段底色 + 行悬浮过渡，长表更好扫 */
.plat-body .dz-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.plat-body .dz-table thead th {
  background: var(--bg-sunken); color: var(--text-sub);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  padding: 9px 12px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.plat-body .dz-table tbody td {
  padding: 10px 12px; vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.plat-body .dz-table tbody tr { transition: background .14s ease; }
.plat-body .dz-table tbody tr:hover { background: var(--primary-softer); }
.plat-body .dz-table tbody tr:last-child td { border-bottom: 0; }
.plat-body .dz-table tbody tr.is-revoked { opacity: .55; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
/* 加载骨架：切换页签时不再闪白 */
.plat-skeleton { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.plat-skeleton span {
  display: block; height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 25%, var(--primary-soft) 37%, var(--border) 63%);
  background-size: 400% 100%; animation: platShimmer 1.2s ease infinite;
}
.plat-skeleton span:nth-child(2) { height: 180px; }
.plat-skeleton span:nth-child(3) { width: 60%; }
@keyframes platShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
/* 表格行悬浮（危险按钮样式沿用 theme.css 的 .btn-danger 约定） */
.plat-body .dz-table tbody tr:hover { background: var(--primary-soft); }
/* 列表页工具栏与分页 */
.plat-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.plat-toolbar input[type=search],
.plat-toolbar select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 13px;
}
.plat-toolbar input[type=search] { min-width: 220px; }
.plat-toolbar input:focus, .plat-toolbar select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.plat-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ---------- 积分管理页（points tab） ---------- */
/* 空状态：表格行内的空态，居中且不抢视觉焦点 */
.plat-body .dz-table td.pts-empty {
  text-align: center; padding: 28px 12px;
  color: var(--text-mute); font-size: 13px; font-style: italic;
}
/* 独立的空状态卡片（如兑换订单无数据时） */
.pts-empty-box {
  text-align: center; padding: 32px 16px;
  background: var(--bg-sunken); border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--text-mute); font-size: 13px;
}
.pts-empty-ico { font-size: 28px; margin-bottom: 6px; opacity: .55; }
/* 表格底部按钮栏：与表格间留出稳定间距 */
.plat-foot-bar { margin-top: 14px; }
/* 积分/天数列：右对齐，数字更易扫读 */
.plat-body .dz-table .pts-col-val,
.plat-body .dz-table .pts-col-days { text-align: right; white-space: nowrap; }
.plat-body .dz-table td.pts-col-val,
.plat-body .dz-table td.pts-col-days { font-variant-numeric: tabular-nums; }
/* 积分规则/定价里的数字输入框统一宽度 */
.plat-body [data-rule],
.plat-body [data-price-points],
.plat-body [data-price-days] { width: 100px; }

/* 切页淡入：避免内容瞬间替换造成的跳动感 */
@keyframes platFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.plat-main { animation: platFade .2s ease; }

/* 危险操作确认弹窗：替代浏览器 prompt，可键盘操作、可读性更好 */
.plat-modal-mask {
  position: fixed; inset: 0; z-index: 9999; padding: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 24, 32, .42); backdrop-filter: blur(2px);
  animation: platFade .15s ease;
}
.plat-modal {
  width: min(420px, 100%); padding: 20px 22px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.plat-modal-title { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--text); }
.plat-modal-desc { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: var(--text-sub); }
.plat-modal-tip { margin: 0 0 8px; font-size: 12.5px; color: #b25e09; }
.plat-modal-input {
  width: 100%; box-sizing: border-box; margin-bottom: 14px;
  padding: 9px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; background: var(--surface);
  color: var(--text);
}
.plat-modal-input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.plat-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (prefers-reduced-motion: reduce) {
  .plat-main, .plat-modal-mask { animation: none; }
  .plat-nav-item, .plat-body .dz-table tbody tr { transition: none; }
}
@media (max-width: 900px) {
  .plat.has-nav { flex-direction: column; gap: 14px; }
  .plat-nav {
    position: static; width: 100%; flex: none;
    display: flex; gap: 8px; overflow-x: auto;
    padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--border);
  }
  .plat-nav-group { margin-bottom: 0; display: flex; align-items: center; gap: 4px; }
  .plat-nav-label { display: none; }
  .plat-nav-item { white-space: nowrap; }
}
.plat-tabs {
  display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.plat-tab {
  padding: 8px 16px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: var(--text-sub); border-bottom: 2px solid transparent;
}
.plat-tab:hover { color: var(--primary); }
.plat-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.plat-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.plat-dirty { font-size: 12px; color: var(--warning); font-weight: 600; }

.plat-body { padding-bottom: 40px; }
.plat-group {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.plat-h3 {
  font-size: 13px; font-weight: 600; color: var(--text-sub);
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.plat-hint {
  font-size: 12px; color: var(--text-mute); line-height: 1.75;
  padding: 10px 12px; background: var(--bg); border-radius: var(--radius); margin-bottom: 12px;
}
.plat-hint code, .plat-hint a { font-size: 12px; }

.plat-item { margin-bottom: 16px; }
.plat-item:last-child { margin-bottom: 0; }
.plat-item-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.plat-item-label { font-size: 13px; font-weight: 500; }
.plat-item-key {
  font-size: 11px; color: var(--text-mute); background: var(--bg);
  padding: 1px 8px; border-radius: 8px;
}
.plat-item input[type=text], .plat-item input[type=number], .plat-item textarea {
  width: 100%; padding: 7px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius); font-family: inherit;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.plat-item input:focus, .plat-item textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.plat-item textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.plat-item-desc { font-size: 12px; color: var(--text-mute); margin-top: 5px; line-height: 1.6; }
.plat-tag {
  font-size: 10px; color: #b45309; background: #fef3c7;
  padding: 1px 8px; border-radius: 8px;
}

/* 合规体检 */
.plat-score {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; border-radius: var(--radius-lg); margin-bottom: 16px;
  border: 1px solid;
}
.plat-score.is-pass { background: #f0fbf0; border-color: #c6e9c6; }
.plat-score.is-fail { background: #fef2f2; border-color: #fecaca; }
.plat-score-num { font-size: 34px; font-weight: 700; line-height: 1; }
.plat-score.is-pass .plat-score-num { color: #1f7a1f; }
.plat-score.is-fail .plat-score-num { color: #dc2626; }
.plat-score-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.plat-score-sub { font-size: 12px; color: var(--text-mute); }
.plat-ok { color: #1f7a1f; font-weight: 700; }
.plat-bad { color: #dc2626; font-weight: 700; }
.plat-req { font-size: 10px; color: #b45309; background: #fef3c7; padding: 1px 8px; border-radius: 8px; }
.plat-detail { font-size: 12px; color: var(--text-mute); max-width: 460px; word-break: break-all; }
.plat-violation { padding: 10px 12px; border-radius: var(--radius); margin-bottom: 8px; border-left: 3px solid; }
.plat-violation.is-error { background: #fef2f2; border-color: #dc2626; }
.plat-violation.is-warning { background: #fffbeb; border-color: #d97706; }
.plat-violation-msg { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.plat-violation-fix { font-size: 12px; color: var(--text-mute); line-height: 1.6; }
.plat-feature {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.plat-feature:last-child { border-bottom: none; }
.plat-feature-status { font-size: 12px; color: var(--text-mute); }

/* 密钥 */
.plat-scope {
  display: inline-block; font-size: 11px; padding: 1px 8px; margin-right: 4px;
  background: var(--primary-soft); color: var(--primary); border-radius: 8px;
}
.plat-key-plain {
  width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
}
tr.is-revoked td { opacity: .5; }

/* 页脚备案号（第十三条：主页底部中央位置） */
.site-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: flex; justify-content: center; align-items: center; gap: 14px;
  padding: 6px 12px; font-size: 12px; color: var(--text-mute);
  background: rgba(255, 255, 255, .94); border-top: 1px solid var(--border);
  backdrop-filter: blur(4px);
}
.site-beian { color: var(--text-mute); text-decoration: none; }
.site-beian:hover { color: var(--primary); }
.site-footer-extra { color: var(--text-mute); }
.site-footer-notice { color: #b45309; }

/* 后台表格（访客档案等） */
.dz-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.dz-table th, .dz-table td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border);
}
.dz-table th { color: var(--text-mute); font-weight: 500; background: var(--bg); }
.dz-table tr:hover td { background: var(--bg); }

/* 批量模板视图 */
.bz-in {
  width: 100%; box-sizing: border-box; padding: 6px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: inherit;
  font-family: inherit; transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.bz-in:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.bz-in { resize: vertical; font-family: ui-monospace, monospace; line-height: 1.6; }
.bz-form { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.bz-form label { display: flex; flex-direction: column; gap: 4px; color: var(--text-sub); }
.bz-fields td { vertical-align: middle; }
.bz-fields .btn-mini[disabled] { opacity: 0.35; pointer-events: none; }
.bz-qr canvas { border: 1px solid var(--border); border-radius: var(--radius); }

/* 设计器：访客身份配置区 */
.dz-visitor-hint {
  font-size: 12px; color: var(--text-mute); line-height: 1.6;
  padding: 8px 10px; background: var(--bg); border-radius: var(--radius);
  margin-bottom: 10px;
}
.dz-field-select-list {
  max-height: 180px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px;
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9ccd1; border-radius: var(--radius); }
::-webkit-scrollbar-thumb:hover { background: #b0b4bc; }
* { scrollbar-width: thin; scrollbar-color: #c9ccd1 transparent; }

/* ==================== 扫码 / 图片识别填空 ==================== */
.f-input-wrap { position: relative; display: flex; align-items: center; }
.f-input-wrap .f-input { padding-right: 68px; }
/* 两个按钮的容器：绝对定位到输入框右侧，内部横排 */
.f-scan-actions {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 2px;
}
.f-scan-btn, .f-scan-img-btn {
  width: 30px; height: 30px; border: none; background: var(--primary-soft);
  color: var(--primary); border-radius: var(--radius); cursor: pointer;
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.f-scan-btn:hover, .f-scan-img-btn:hover { background: var(--primary); color: #fff; }
.f-scan-btn:disabled, .f-scan-img-btn:disabled { opacity: .5; cursor: default; }

/* 矩阵单元格小号按钮：各自绝对定位，扫码在右、图片在更右外侧 */
.f-scan-sm, .f-scan-img-sm {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; font-size: 12px;
}
.f-scan-img-sm { right: 2px; }
.f-input-wrap .f-input.f-input-sm { padding-right: 50px; }

/* 扫码弹窗 */
.scan-mask {
  position: fixed; inset: 0; background: rgba(26, 29, 36, 0.55);
  backdrop-filter: blur(6px); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.scan-box {
  background: var(--panel); border-radius: var(--radius-lg);
  width: 100%; max-width: 420px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.scan-head {
  display: flex; align-items: center; padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.scan-title { font-weight: 600; }
.scan-close {
  margin-left: auto; border: none; background: transparent; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--text-mute); width: 32px; height: 32px;
  border-radius: 8px; transition: background .2s var(--ease);
}
.scan-close:hover { background: var(--bg); color: var(--text); }
.scan-stage {
  position: relative; background: #111; aspect-ratio: 4 / 3; overflow: hidden;
}
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame {
  position: absolute; inset: 18%;
  border: 2px solid var(--primary); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  animation: scan-pulse 2s var(--ease) infinite;
}
@keyframes scan-pulse {
  0%, 100% { border-color: var(--primary); }
  50% { border-color: #8b9dff; }
}
.scan-tip {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,.5);
  background: rgba(0,0,0,.35); padding: 5px 14px; border-radius: 20px;
}
.scan-foot { padding: 14px 18px; display: flex; justify-content: center; }

/* ==================== API 开放平台 ==================== */
.api-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.api-tab {
  border: none; background: transparent; color: var(--text-sub);
  padding: 8px 16px; cursor: pointer; font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent; transition: all .2s var(--ease);
}
.api-tab:hover { color: var(--text); }
.api-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }

.api-panel { min-height: 300px; }
.api-loading, .api-empty, .api-error {
  padding: 40px; text-align: center; color: var(--text-mute); font-size: 14px;
}
.api-error { color: var(--danger); }
.api-actions { margin-bottom: 16px; display: flex; justify-content: flex-end; }

.api-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--panel); border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.api-table th {
  text-align: left; padding: 10px 14px; font-weight: 600; font-size: 12px;
  color: var(--text-sub); background: var(--bg-elev); border-bottom: 1px solid var(--border);
}
.api-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.api-table tr:last-child td { border-bottom: none; }
.api-table tr:hover td { background: #f8f9fb; }

.api-status {
  display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 500;
}
.api-status.active { background: #f0fbf0; color: #1f7a1f; }
.api-status.revoked { background: #fef2f2; color: #dc2626; }

.api-key-display {
  display: flex; align-items: center; gap: 8px; margin: 12px 0;
  padding: 10px 14px; background: var(--bg); border-radius: var(--radius);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px;
  word-break: break-all;
}
.api-key-display code { flex: 1; color: var(--primary); font-weight: 600; }

.api-docs h3 {
  font-size: 15px; margin: 24px 0 8px; color: var(--text);
  border-left: 3px solid var(--primary); padding-left: 10px;
}
.api-docs p { font-size: 13px; color: var(--text-sub); line-height: 1.7; }
.api-docs pre {
  background: #1a1d24; color: #e6e9f0; padding: 14px 16px; border-radius: var(--radius);
  overflow-x: auto; font-size: 12px; line-height: 1.6; margin: 8px 0;
}
.api-docs pre code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.api-docs .api-table { margin: 8px 0; }

/* ==================== OCR 智能填表 ==================== */
.page-sub {
  font-size: 13px; color: var(--text-mute); margin-top: 4px;
}
.ocr-config-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; max-width: 560px; box-shadow: var(--shadow-sm);
}
.ocr-config-card .dz-field { margin-bottom: 16px; }
.ocr-config-card .dz-field label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; }
.ocr-config-card .dz-field-desc { font-size: 12px; margin-top: 6px; }
.ocr-config-card .dz-field-desc a { color: var(--primary); text-decoration: none; }
.ocr-config-card .dz-field-desc a:hover { text-decoration: underline; }
.ocr-actions { display: flex; gap: 10px; margin-top: 20px; }
/* 服务商选择：三张可点卡片，当前项描边高亮 */
.ocr-provider-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.ocr-provider {
  text-align: left; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--panel); cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
}
.ocr-provider b { font-size: 13px; font-weight: 600; }
.ocr-provider span { font-size: 11px; color: var(--text-mute); line-height: 1.45; }
.ocr-provider.is-on { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12); }
.ocr-provider:disabled { cursor: default; opacity: 0.65; }
.ocr-chip {
  display: inline-block; font-size: 11px; font-weight: 400; line-height: 1.6;
  padding: 0 6px; border-radius: 4px; background: var(--bg); color: var(--text-mute);
  border: 1px solid var(--border); vertical-align: 1px;
}
.ocr-chip.is-on { color: var(--success, #1a7f37); border-color: currentColor; background: transparent; }
.ocr-chip.is-off { color: var(--text-mute); }
.ocr-readonly {
  max-width: 560px; margin-bottom: 16px; padding: 10px 14px; font-size: 13px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-mute);
}
.ocr-test-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; margin-top: 20px; max-width: 560px; box-shadow: var(--shadow-sm);
}
.ocr-test-card h3 { font-size: 15px; margin: 0 0 14px; }
.ocr-test-area { display: flex; align-items: center; gap: 10px; }
.ocr-test-result pre {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  line-height: 1.6; white-space: pre-wrap; word-break: break-all;
}

/* ==================== 数据看板 ==================== */
.dash-selector {
  display: flex; gap: 10px; align-items: center; margin-bottom: 20px;
}
.dash-content { min-height: 400px; }
.dash-empty, .dash-loading, .dash-error {
  padding: 60px; text-align: center; color: var(--text-mute); font-size: 14px;
}
.dash-error { color: var(--danger); }

.dash-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px;
}
.dash-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; text-align: center; box-shadow: var(--shadow-sm);
}
.dash-num { font-size: 32px; font-weight: 700; color: var(--text); line-height: 1.2; font-variant-numeric: tabular-nums; }
.dash-label { font-size: 13px; color: var(--text-sub); margin-top: 6px; }

.dash-charts { display: flex; flex-direction: column; gap: 20px; }
.dash-chart-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.dash-chart-box h3 { font-size: 15px; margin: 0 0 16px; }

.dash-bar-list { display: flex; flex-direction: column; gap: 10px; }
.dash-bar-item { display: flex; align-items: center; gap: 10px; }
.dash-bar-label { width: 120px; font-size: 13px; text-align: right; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-track { flex: 1; height: 24px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.dash-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s var(--ease); }
.dash-bar-value { width: 50px; font-size: 13px; font-weight: 600; color: var(--text); }

/* 扫码截取区间输入 */
.dz-scan-range {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px; margin: 4px 0 8px; font-size: 12px; color: var(--text-sub);
  background: var(--bg); border-radius: var(--radius);
}
.dz-scan-range input[type="number"] {
  width: 56px; padding: 4px 6px; text-align: center;
  border: 1px solid var(--border); border-radius: 6px; font-size: 12px;
  color: var(--text); background: var(--panel); outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.dz-scan-range input[type="number"]:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,110,245,.12);
}

.dash-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dash-stat { text-align: center; padding: 12px; background: var(--bg); border-radius: var(--radius); }
.dash-stat-label { display: block; font-size: 12px; color: var(--text-mute); margin-bottom: 4px; }
.dash-stat-value { display: block; font-size: 18px; font-weight: 600; color: var(--text); }

/* ==================== 工作台首页（对齐草料工作台布局） ==================== */
.wb { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; display: flex; flex-direction: column; gap: 18px; }
.wb-head { display: flex; align-items: center; gap: 16px; }
.wb-head h2 { font-size: 18px; margin: 0; }
.wb-period { margin-left: auto; display: inline-flex; padding: 3px; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; }
.wb-period button {
  border: none; background: none; padding: 5px 14px; border-radius: 999px;
  font-size: 13px; color: var(--text-sub); cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.wb-period button:hover { color: var(--text); }
.wb-period button.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.wb-period button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.wb-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.wb-card {
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 120px; padding: 18px 20px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.wb-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.wb-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.wb-card-label { font-size: 13px; color: var(--text-sub); }
.wb-card-val { font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.wb-card-sub { font-size: 12px; color: var(--text-mute); }
.wb-card-cta {
  background: linear-gradient(180deg, #2b3242 0%, #202634 100%);
  border-color: transparent; color: #fff;
  justify-content: center; gap: 6px;
}
.wb-card-cta:hover { border-color: transparent; box-shadow: 0 2px 10px rgba(26, 29, 36, .18); }
.wb-card-cta-title { font-size: 15px; font-weight: 600; }
.wb-card-cta-sub { font-size: 12px; opacity: .88; }
.wb-card-cta-link { font-size: 12px; margin-top: 6px; opacity: .95; }

.wb-panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.wb-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.wb-tab {
  background: none; border: none; padding: 13px 14px; font-size: 14px; color: var(--text-sub);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s var(--ease), border-color .2s var(--ease);
}
.wb-tab i { font-style: normal; font-size: 12px; color: var(--text-mute); margin-left: 4px; font-variant-numeric: tabular-nums; }
.wb-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.wb-tab.is-active i { color: var(--primary); }
.wb-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 6px; }
.wb-toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.wb-search { width: 220px; }
.wb-scope { width: 140px; }
.wb-toolbar-spacer { flex: 1; }
.wb-list { min-height: 120px; }
.wb-row {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px; min-height: 64px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s var(--ease);
}
.wb-row:last-child { border-bottom: none; }
.wb-row:hover, .wb-row:focus-within { background: var(--row-hover); }
.wb-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--row-hover); }
.wb-row-icon {
  flex: 0 0 52px; height: 52px; border-radius: var(--radius); display: flex; align-items: center;
  justify-content: center; color: var(--text-sub); background: var(--bg-elev); border: 1px solid var(--border);
}
.wb-row-main { flex: 1 1 240px; min-width: 0; }
.wb-row-title { font-size: 14px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; }
.wb-row-meta { font-size: 12px; color: var(--text-mute); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-tag { font-size: 12px; font-weight: 400; line-height: 18px; padding: 1px 8px; border-radius: 9px; background: var(--bg); color: var(--text-sub); border: 1px solid var(--border); white-space: nowrap; }
.wb-tag.is-on { color: #15803d; background: #f0fbf0; border-color: #c6e9c6; }
.wb-tag.is-off { color: #b45151; background: #fff3f3; border-color: #f2d2d2; }
.wb-row-stats { flex: 0 0 152px; display: flex; gap: 10px; font-size: 12px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.wb-row-stats b { color: var(--text); font-weight: 600; }
.wb-row-block { flex: 0 0 150px; min-width: 0; }
.wb-row-label { font-size: 11px; color: var(--text-mute); margin-bottom: 3px; }
.wb-row-value { font-size: 12px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-row-ops { flex: 0 0 auto; display: flex; gap: 6px; }
.wb-empty {
  padding: 44px 20px 48px; text-align: center; color: var(--text-mute); font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

@media (max-width: 1100px) {
  .wb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-row-block { display: none; }
}
/* ---------- 表单外观：头图 / 背景色 ---------- */
.filler-banner { display: block; width: calc(100% + 32px); margin: -24px -16px 16px; max-height: 220px; object-fit: cover; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.dz-banner-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dz-banner-row .f-input { flex: 1; min-width: 0; }
.dz-banner-preview { display: block; width: 100%; max-height: 140px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 8px; }

/* ---------- 字段统计图表（饼图 / 折线） ---------- */
.fst-visual { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.fst-pie { flex: 0 0 auto; }
.fst-pie-svg { width: 120px; height: 120px; display: block; }
.fst-legend { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 4px; }
.fst-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.fst-legend-row i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 2px; }
.fst-legend-label { flex: 1; min-width: 0; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fst-legend-num { flex: 0 0 auto; color: var(--text); font-variant-numeric: tabular-nums; }
.fst-bars { flex: 1 1 240px; min-width: 200px; }
.fst-trend { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.fst-trend-title { font-size: 12px; color: var(--text-mute); margin-bottom: 6px; }
.fst-line-svg { width: 100%; height: 96px; display: block; }
.fst-line-labels { display: flex; justify-content: space-between; gap: 2px; margin-top: 4px; }
.fst-line-labels span { font-size: 10px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.fst-empty { padding: 16px; text-align: center; font-size: 13px; color: var(--text-mute); }

/* ---------- 回收中心 ---------- */
.rec-recycle { width: min(640px, 94vw); }
.rec-recycle-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rec-recycle-row:last-child { border-bottom: none; }
.rec-recycle-main { flex: 1; min-width: 0; }
.rec-recycle-title { font-weight: 600; }
.rec-recycle-meta { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.rec-recycle-ops { flex: 0 0 auto; display: flex; gap: 6px; }

/* ========== 表单设计器：Tab 栏 / 预览 / 设置面板 ========== */
.dz-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* 顶部 Tab 栏 */
.dz-formtabs {
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px; height: 52px; flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.dz-formtabs-title { font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; }
.dz-formtabs-bar { display: flex; align-items: center; gap: 4px; }
.dz-formtab {
  position: relative; border: none; background: transparent; cursor: pointer;
  padding: 8px 14px; font-size: 14px; color: var(--text-mute);
  border-radius: 8px; transition: all .15s; white-space: nowrap;
}
.dz-formtab:hover { color: var(--text); background: var(--hover); }
.dz-formtab.is-active { color: var(--primary); background: rgba(24,144,255,.08); font-weight: 600; }

/* 内容区：仅显示 active 的 pane */
.dz-tabpane { display: none; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.dz-tabpane.is-active { display: flex; flex-direction: column; }

/* 预览面板：左右两栏（填表页 / 提交成功页） */
.dz-prev-grid { display: flex; gap: 32px; justify-content: center; padding: 28px 20px; overflow: auto; flex: 1; }
.dz-prev-col { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dz-prev-label { font-size: 13px; color: var(--text-mute); font-weight: 500; }

/* 手机外壳 */
.dz-phone {
  width: 320px; height: 600px; background: #000; border-radius: 36px;
  padding: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
}
.dz-phone-bar {
  display: flex; justify-content: space-between; align-items: center;
  height: 24px; padding: 0 16px; color: #fff; font-size: 12px; flex: 0 0 auto;
}
.dz-phone > .filler {
  flex: 1; border-radius: 26px; overflow: auto; background: var(--fill-bg, #f5f6f7);
}

/* 提交成功页 */
.filler-done { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 32px 20px; text-align: center; }
.done-icon {
  width: 64px; height: 64px; border-radius: 50%; background: #52c41a; color: #fff;
  font-size: 36px; line-height: 64px; margin-bottom: 16px;
}
.done-title { font-size: 20px; font-weight: 600; color: var(--text); }
.done-sub { font-size: 14px; color: var(--text-mute); margin-top: 8px; line-height: 1.6; }
.done-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }

/* 设置面板（内联） */
.dz-settings-body { padding: 20px 24px; overflow: auto; flex: 1; max-width: 860px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.dz-settings-foot { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; background: var(--bg); }

/* 设置分组 */
.dz-setgroup { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.dz-setgroup-head { padding: 12px 16px; background: var(--hover); }
.dz-setgroup-title { font-size: 14px; font-weight: 600; color: var(--text); }

/* 设置行：标签 + 状态标签 + 内容 */
.dz-setrow {
  display: grid; grid-template-columns: 140px 90px 1fr; gap: 12px; align-items: start;
  padding: 14px 16px; border-top: 1px solid var(--border);
}
.dz-setrow:first-child { border-top: none; }
.dz-setrow-label { font-size: 14px; color: var(--text); padding-top: 2px; }
.dz-setrow-state {
  display: inline-block; padding: 2px 10px; font-size: 12px; border-radius: 10px;
  background: var(--border); color: var(--text-mute); text-align: center; white-space: nowrap;
}
.dz-setrow-state.is-on { background: rgba(24,144,255,.12); color: var(--primary); }
.dz-setrow-body { display: flex; flex-direction: column; gap: 10px; }

.dz-fs-range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dz-field-select-list { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; padding: 8px; }

/* 字段提示图：设计器属性面板 + 填写端展示 */
.dz-hintimg { display: flex; flex-direction: column; gap: 8px; }
.dz-hintimg-preview { max-width: 160px; max-height: 110px; border-radius: 8px; border: 1px solid var(--border); object-fit: contain; background: #fff; }
.dz-hintimg-empty { font-size: 12px; color: var(--text-mute); }
.dz-hintimg-ops { display: flex; gap: 8px; }
.f-hint-img { display: block; max-width: 200px; max-height: 140px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--border); object-fit: contain; background: #fff; }

/* 快速搭建：场景模板卡片 */
.tpl-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tpl-tab { padding: 6px 14px; border: 1px solid var(--border); border-radius: 18px; background: var(--bg); color: var(--text-mute); font-size: 13px; cursor: pointer; transition: all .15s; }
.tpl-tab:hover { border-color: var(--primary); color: var(--primary); }
.tpl-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tpl-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); transition: all .15s; }
.tpl-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(24,144,255,.08); }
.tpl-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.tpl-card-desc { font-size: 12px; color: var(--text-mute); line-height: 1.5; min-height: 36px; }
.tpl-card-fields { font-size: 11px; color: var(--text-mute); opacity: .75; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tpl-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border-light, var(--border)); }
.tpl-card-meta { font-size: 12px; color: var(--text-mute); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 班组质量概览 */
.ov-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 10px; }
.ov-card { padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.ov-card-label { font-size: 12px; color: var(--text-mute); margin-bottom: 4px; }
.ov-card-val { font-size: 24px; font-weight: 700; line-height: 1.2; }
.ov-card-unit { font-size: 12px; font-weight: 400; margin-left: 2px; opacity: .7; }
.ov-kinds { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ov-kind { padding: 2px 10px; border-radius: 12px; background: rgba(24,144,255,.1); color: var(--primary); font-size: 12px; }
.ov-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--border-light, var(--border)); }

/* 工具点检状态 */
.tool-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tool-stat { text-align: center; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.tool-stat-num { font-size: 24px; font-weight: 700; line-height: 1.2; }
.tool-stat-label { font-size: 12px; color: var(--text-mute); margin-top: 4px; }
.tool-abnormal { margin-top: 8px; }
.tool-tag { display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 4px; background: #fff1f0; color: #f5222d; font-size: 12px; }

/* 关键岗位实时卡片 */
.kp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.kp-card { padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.kp-card-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.kp-card-vals { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.kp-val { font-size: 13px; color: var(--text); }
.kp-val.kp-over { color: #f5222d; font-weight: 600; }
.kp-card-meta { font-size: 11px; color: var(--text-mute); }

/* 趋势图（纯 CSS 柱状图） */
.trend-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 8px 0; }
.trend-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.trend-bar { width: 100%; max-width: 40px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s; }
.trend-label { font-size: 10px; color: var(--text-mute); margin-top: 4px; text-align: center; }

/* 不良 TOP */
.top-list { display: flex; flex-direction: column; gap: 6px; }
.top-row { display: flex; align-items: center; gap: 8px; }
.top-rank { width: 20px; text-align: center; font-weight: 600; color: var(--text-mute); font-size: 12px; }
.top-name { width: 80px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar-wrap { flex: 1; height: 16px; background: var(--border-light, #f0f0f0); border-radius: 4px; overflow: hidden; }
.top-bar { height: 100%; background: var(--primary); border-radius: 4px; min-width: 2px; transition: width .3s; }
.top-val { width: 50px; text-align: right; font-size: 12px; color: var(--text-mute); }

/* 质量管理工具箱 */
.qt-section { margin-bottom: 8px; }
.qt-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.qt-list { display: flex; flex-direction: column; gap: 6px; }
.qt-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.qt-row-title { font-size: 13px; font-weight: 500; }
.qt-row-meta { font-size: 11px; color: var(--text-mute); margin-top: 4px; }
.qt-tag { padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.qt-open { background: #fff7e6; color: #fa8c16; }
.qt-closed { background: #f6ffed; color: #52c41a; }

@media (max-width: 720px) {
  .wb { padding: 14px 12px 40px; gap: 12px; }
  .wb-cards { grid-template-columns: 1fr; gap: 10px; }
  .wb-card { min-height: 96px; padding: 14px 16px; }
  .wb-card-val { font-size: 26px; }
  .wb-card-cta { min-height: 92px; }
  .wb-toolbar { flex-wrap: wrap; }
  .wb-search { flex: 1 1 auto; width: auto; min-width: 120px; }
  .wb-scope { display: none; }
  /* 小屏：图标+正文占首行，统计与操作折到下方整行，按钮始终可见 */
  .wb-row {
    display: grid; grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px 12px; padding: 12px 14px; align-items: start;
  }
  .wb-row-icon { flex: none; width: 44px; height: 44px; }
  .wb-row-stats { grid-column: 1 / -1; justify-content: flex-start; gap: 14px; }
  .wb-row-ops { grid-column: 1 / -1; justify-content: flex-end; }
  .wb-row-block { display: none; }
}

/* ==================== 微信 H5 适配 ==================== */
.is-mobile .topbar { height: 48px; padding: 0 12px; }
.is-mobile .topbar-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.is-mobile .nav-btn { padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.is-mobile .dash-cards { grid-template-columns: 1fr; }
.is-mobile .dash-stat-grid { grid-template-columns: repeat(2, 1fr); }
.is-mobile .api-table { font-size: 12px; }
.is-mobile .api-table th, .is-mobile .api-table td { padding: 8px 10px; }
.is-mobile .ocr-config-card, .is-mobile .ocr-test-card { max-width: 100%; }

/* 微信浏览器特定 */
.is-wechat .topbar { padding-top: env(safe-area-inset-top); }
.is-wechat .scan-stage { aspect-ratio: 3/4; } /* 竖屏更适合扫码 */

/* 小屏手机 */
@media (max-width: 480px) {
  .dash-cards { grid-template-columns: 1fr; }
  .dash-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .api-table { display: block; overflow-x: auto; }
  .api-table thead, .api-table tbody, .api-table tr { display: block; }
  .api-table td { display: flex; justify-content: space-between; }
  .api-table td::before { content: attr(data-label); font-weight: 600; color: var(--text-sub); }
}

/* ==================== 深色模式 ==================== */
/* 深色主题的令牌定义已统一迁移至 tokens.css（[data-theme='dark']）。
   此处仅保留无法用令牌表达的组件级深色微调。 */

[data-theme='dark'] body { background: var(--bg); color: var(--text); }

/* 深色下二维码预览必须保持浅底，否则扫码识别失败 */
[data-theme='dark'] .qrgen-preview,
[data-theme='dark'] .qr-box { background: #ffffff; }

/* 主题切换按钮 */
.theme-toggle { white-space: nowrap; }
.theme-toggle:hover { background: var(--bg); }

/* ==================== 设置面板：左侧二级导航 + 右侧内容 ==================== */
.dz-setlayout { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.dz-setnav { flex: 0 0 180px; padding: 14px 10px; border-right: 1px solid var(--border); overflow: auto; background: var(--bg-elev); }
.dz-setnav-group + .dz-setnav-group { margin-top: 14px; }
.dz-setnav-gtitle { font-size: 12px; color: var(--text-mute); padding: 0 8px 6px; }
.dz-setnav-item {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text-sub);
  cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease);
}
.dz-setnav-item:hover { background: var(--row-hover); color: var(--text); }
.dz-setnav-item.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.dz-setmain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dz-setmain-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.dz-setmain-title { font-size: 15px; font-weight: 600; }
.dz-setmain-body { padding: 20px 24px; overflow: auto; flex: 1; max-width: 860px; width: 100%; box-sizing: border-box; }
/* 二级页内直接放置的 setrow-body 需要内边距 */
.dz-setgroup > .dz-setrow-body { padding: 14px 16px; }
@media (max-width: 720px) {
  .dz-setlayout { flex-direction: column; overflow: auto; }
  .dz-setnav { flex: none; display: flex; gap: 4px; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 8px; }
  .dz-setnav-group { display: flex; gap: 4px; align-items: center; }
  .dz-setnav-group + .dz-setnav-group { margin-top: 0; margin-left: 10px; }
  .dz-setnav-gtitle { display: none; }
  .dz-setnav-item { white-space: nowrap; width: auto; }
}

/* ==================== 记录列表卡片：状态标签 + 字段摘要 + 图片缩略图 ==================== */
.rec-status { font-size: 11px; line-height: 18px; padding: 0 8px; border-radius: 9px; font-weight: 500; white-space: nowrap; }
.rec-status.is-blue { color: var(--primary); background: var(--primary-soft); }
.rec-status.is-green { color: #15803d; background: #f0fbf0; }
.rec-status.is-red { color: #b45151; background: #fff3f3; }
.rec-status.is-orange { color: #b45309; background: #fef3c7; }
.rec-fields { display: flex; flex-direction: column; gap: 2px; }
.rec-field { display: flex; gap: 8px; font-size: 13px; line-height: 1.7; }
.rec-field-k { flex: 0 0 88px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-field-v { flex: 1; min-width: 0; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-field-v.is-hl { font-weight: 600; color: var(--text); }
.rec-field-more { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.rec-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.rec-img { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); display: block; }
.rec-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ==================== 关联二维码卡片列表 ==================== */
.rl-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.rl-bar select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--panel); color: var(--text); }
.rl-bar-spacer { flex: 1; }
.rl-list { display: flex; flex-direction: column; gap: 12px; }
.rl-card { display: flex; gap: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.rl-qr { flex: 0 0 96px; }
.rl-qr img { width: 96px; height: 96px; border-radius: 8px; border: 1px solid var(--border); display: block; background: #fff; }
.rl-main { flex: 1; min-width: 0; }
.rl-title { font-size: 14px; font-weight: 600; }
.rl-meta { font-size: 12px; color: var(--text-mute); margin-top: 4px; line-height: 1.7; }
.rl-dyn { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 6px; }
.rl-dyn-item { font-size: 12px; color: var(--text-sub); padding: 3px 0; }
.rl-dyn-item b { color: var(--text); font-weight: 500; }
.rl-dyn-all { font-size: 12px; color: var(--primary); background: none; border: none; padding: 3px 0; cursor: pointer; }
.rl-dyn-all:hover { text-decoration: underline; }
.rl-ops { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.rl-op {
  width: 32px; height: 32px; border: 1px solid var(--border); background: var(--panel);
  border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-sub);
  display: flex; align-items: center; justify-content: center;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.rl-op:hover { color: var(--primary); border-color: var(--primary); }
.rl-end { text-align: center; font-size: 12px; color: var(--text-mute); padding: 16px 0 4px; }
.rl-pick { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.rl-pick-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--panel); text-align: left; font-size: 13px; }
.rl-pick-item:hover { border-color: var(--primary); }
.rl-pick-item .rl-pick-meta { font-size: 11px; color: var(--text-mute); }
@media (max-width: 640px) {
  .rl-card { flex-wrap: wrap; }
  .rl-ops { flex-direction: row; }
}

/* ==================== 工作台：两大主功能入口卡 ==================== */
.wb-primary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.wb-primary-card {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas:
    "eyebrow eyebrow eyebrow"
    "title title link"
    "sub sub sub";
  align-items: end; gap: 2px 12px; text-align: left; cursor: pointer;
  padding: 16px 18px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--panel) 0%, var(--bg-elev) 100%);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.wb-primary-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.wb-primary-eyebrow {
  grid-area: eyebrow; justify-self: start;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--primary);
  background: var(--primary-soft); padding: 2px 8px; border-radius: 10px;
}
.wb-primary-title { grid-area: title; font-size: 18px; font-weight: 700; color: var(--text); }
.wb-primary-sub { grid-area: sub; font-size: 12px; color: var(--text-mute); margin-top: 4px; }
.wb-primary-link { grid-area: link; font-size: 13px; color: var(--primary); font-weight: 600; }
@media (max-width: 640px) {
  .wb-primary { grid-template-columns: 1fr; gap: 10px; }
}

/* ==================== 工作台：内容类型入口条 ==================== */
.wb-create {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 16px; margin-bottom: 14px;
}
.wb-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--bg-elev);
  padding: 7px 16px; border-radius: 20px; font-size: 13px; color: var(--text);
  cursor: pointer; transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.wb-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.wb-chip-icon { display: inline-flex; align-items: center; color: var(--text-sub); }
.wb-chip:hover .wb-chip-icon { color: var(--primary); }
.wb-create-tip { margin-left: auto; font-size: 12px; color: var(--text-mute); }
@media (max-width: 640px) { .wb-create-tip { display: none; } }

/* ==================== 内容生成页（文本/网址/文件/图片/音视频） ==================== */
.create { max-width: 1180px; margin: 0 auto; padding: 24px 16px 60px; }
.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .create-layout { grid-template-columns: 1fr; } }
.create-main { min-width: 0; }
.create-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.create-tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text-sub);
  padding: 7px 16px; border-radius: 20px; font-size: 13px; cursor: pointer;
  transition: all .15s var(--ease);
}
.create-tab svg { flex: none; }
.create-tab:hover { border-color: var(--primary); color: var(--primary); }
.create-tab.is-on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
/* 未开通的存储类能力（图片码/文件码）：页签加锁，但选中态保持可读 */
.create-tab.is-locked:not(.is-on) { opacity: .62; }
.create-tab.is-locked:not(.is-on):hover { border-color: var(--border-strong); color: var(--text-mute); }

/* 编辑卡 */
.create-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.create-main > .create-card { min-height: 420px; display: flex; flex-direction: column; box-sizing: border-box; }
@media (max-width: 900px) { .create-main > .create-card { min-height: 0; } }
.create-card-head { display: flex; align-items: center; gap: 10px; min-height: 26px; margin-bottom: 10px; }
.create-card-title { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.create-card-title::before { content: ''; width: 3px; height: 15px; border-radius: 2px; background: var(--primary); }
.create-card-ops { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.create-textbtn { border: none; background: none; padding: 0; color: var(--text-sub); font-size: 13px; cursor: pointer; }
.create-textbtn:hover { color: var(--primary); }
.create-textarea {
  flex: 1; width: 100%; box-sizing: border-box; min-height: 280px;
  border: 1px solid var(--border); border-radius: 6px; padding: 14px;
  font: inherit; font-size: 14px; line-height: 1.8; color: var(--text);
  background: #fff; resize: vertical;
}
.create-textarea:focus, .create-adv-text:focus { outline: none; border-color: var(--primary); }
.create-url { width: 100%; box-sizing: border-box; font-size: 15px; }
.create-hint { font-size: 12px; color: var(--text-mute); margin-top: 8px; line-height: 1.7; }
/* 未开通的存储类能力：不显示上传区，只给开通指引 */
.create-locked {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--bg-elev); padding: 18px 16px;
}
.create-locked-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-mute);
}
.create-locked-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.create-locked-desc { font-size: 12.5px; color: var(--text-sub); line-height: 1.75; }
.create-go { align-self: center; margin-top: 18px; min-width: 150px; }
.create-go.is-block { align-self: stretch; width: 100%; margin-top: 14px; }
.create-err { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 0; }

/* 高级编辑（图2） */
.create-adv { display: flex; flex-direction: column; gap: 14px; }
.create-field { display: flex; align-items: flex-start; gap: 10px; }
.create-field > label { flex: none; width: 40px; padding-top: 8px; font-size: 13px; color: var(--text-sub); }
.create-field-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.create-field-grow { flex: 1; }
.create-adv-text { width: 100%; box-sizing: border-box; resize: vertical; }
.create-row { display: flex; gap: 12px; }
.create-row .create-field { flex: 1; }
@media (max-width: 560px) { .create-row { flex-direction: column; gap: 14px; } }

/* 上传卡（图3） */
.create-upload {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 8px; padding: 40px 20px 30px;
  background: #fff; cursor: pointer; text-align: center;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.create-upload:hover, .create-upload.is-drag { border-color: var(--primary); background: var(--primary-soft); }
.create-upload-icon { display: inline-flex; color: var(--primary); }
.create-upload-btn { display: inline-block; background: var(--primary); color: #fff; border-radius: 4px; padding: 8px 22px; font-size: 14px; }
.create-upload-sub { font-size: 12px; color: var(--text-mute); line-height: 1.7; max-width: 460px; }
.create-upload-phone { margin-top: 12px; text-align: center; }
.create-upload-phone button { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; color: var(--primary); font-size: 12px; cursor: pointer; }
.create-files { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.create-file-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
}
.create-file-item svg { flex: none; color: var(--text-mute); }
.create-file-item.is-thumb { align-items: center; }
.create-file-item.is-thumb img {
  width: 40px; height: 40px; object-fit: cover; flex: none;
  border-radius: 6px; border: 1px solid var(--border); background: var(--bg);
}
.create-file-item.is-media { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 12px; }
.create-media { width: 100%; max-height: 240px; border-radius: 6px; background: #000; display: block; }
audio.create-media { background: none; max-height: none; }
.create-file-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.create-file-meta svg { flex: none; color: var(--text-mute); }
.create-file-del {
  flex: none; width: 22px; height: 22px; line-height: 1; cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); color: var(--text-mute);
  border-radius: 6px; font-size: 12px; transition: all .15s var(--ease);
}
.create-file-del:hover { border-color: var(--danger); color: var(--danger); }
.create-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.create-file-size { color: var(--text-mute); font-size: 12px; flex: none; }
.create-quota-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--brand); font-weight: 500; }
.create-img-layout { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; background: var(--bg-soft); border-radius: 10px; }
.create-img-layout-label { font-size: 13px; color: var(--text-mute); flex: none; }
.create-img-layout-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.create-img-layout-opts button { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; transition: all .15s; }
.create-img-layout-opts button.is-on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.create-img-layout-opts button:hover { border-color: var(--brand); }

/* 右侧预览卡 */
.create-aside { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.create-preview { padding: 14px; }
.create-preview-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.create-preview-tabs button {
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-sub);
  border-radius: 6px; padding: 5px 14px; font-size: 12px; cursor: pointer;
}
.create-preview-tabs button.is-on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.create-qr-host { display: flex; align-items: center; justify-content: center; min-height: 240px; }
.create-qr-placeholder { display: flex; color: #eceef2; }
.create-qr-canvas { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.create-tools { display: flex; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.create-tool {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 6px 0; border: none; border-right: 1px solid var(--border);
  background: none; color: var(--text-sub); font-size: 12px; cursor: pointer;
  transition: color .15s var(--ease);
}
.create-tool:last-child { border-right: none; }
.create-tool:hover { color: var(--primary); }

/* 手机效果预览（图3 右侧） */
.create-phone { border: 1px solid var(--border); border-radius: 14px; background: #fff; padding: 12px 10px; box-shadow: 0 2px 10px rgba(26, 29, 36, .06); }
.create-phone-status { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-mute); padding: 0 4px 8px; }
.create-phone-head { text-align: center; font-size: 12px; font-weight: 600; padding-bottom: 10px; }
.create-phone-list { display: flex; flex-direction: column; gap: 6px; }
.create-phone-file { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: #fff; }
.create-phone-file b { display: block; font-size: 11px; font-weight: 600; }
.create-phone-file span { font-size: 10px; color: var(--text-mute); }
.create-pf-ico {
  flex: none; width: 26px; height: 26px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.create-pf-ico.is-doc { background: #4c8bf5; }
.create-pf-ico.is-pdf { background: #e5484d; }
.create-pf-ico.is-xls { background: #1f9d55; }
.create-phone-bar { display: flex; align-items: center; justify-content: space-around; gap: 4px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 10px; color: var(--text-mute); }

/* 分段控件 */
.create-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.create-seg button { border: none; border-right: 1px solid var(--border); background: #fff; color: var(--text-sub); padding: 6px 14px; font-size: 12px; cursor: pointer; }
.create-seg button:last-child { border-right: none; }
.create-seg button.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.create-seg-wide { width: 100%; margin-top: 10px; display: flex; }
.create-seg-wide button { flex: 1; }

/* 生成结果 */
.create-result { margin-top: 14px; }
.create-result-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.create-result-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.create-result-url { font-size: 13px; color: var(--primary); word-break: break-all; }
.create-result-ops { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* 文本质感的功能卖点 */
.create-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
@media (max-width: 640px) { .create-feats { grid-template-columns: 1fr; } }
.create-feat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.create-feat b { display: block; font-size: 13px; margin-bottom: 4px; }
.create-feat span { font-size: 12px; color: var(--text-mute); line-height: 1.6; }

/* 文件页功能介绍 / 主要功能 */
.create-intro { margin-top: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.create-intro-title { font-size: 15px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; }
.create-intro-title span { font-size: 12px; color: var(--text-mute); font-weight: 400; }
.create-intro-desc { font-size: 13px; color: var(--text-sub); line-height: 1.8; margin: 8px 0 14px; }
.create-intro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .create-intro-grid { grid-template-columns: 1fr; } }
.create-intro-item { display: flex; gap: 10px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.create-intro-icon { flex: none; color: var(--primary); display: inline-flex; }
.create-intro-item b { display: block; font-size: 13px; margin-bottom: 3px; }
.create-intro-item > div span { font-size: 12px; color: var(--text-mute); line-height: 1.6; }

.create-funcs { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.create-func { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
@media (max-width: 760px) { .create-func { grid-template-columns: 1fr; } }
.create-func h3 { font-size: 14px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.create-func-sub { font-size: 12.5px; color: var(--text-sub); line-height: 1.8; margin: 0; }
.create-func ul { margin: 10px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--text-mute); line-height: 1.9; }
.create-func-tag { font-size: 11px; color: var(--primary); background: var(--primary-soft); border-radius: 10px; padding: 1px 8px; font-weight: 400; }
.create-func-art {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 10px; min-height: 96px;
}
.create-func-art.is-list { flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; }
.create-art-doc { width: 46px; height: 60px; border: 1px solid var(--border-strong); border-radius: 4px; background: #fff; padding: 8px 6px; display: flex; flex-direction: column; gap: 4px; }
.create-art-doc i { display: block; height: 3px; border-radius: 2px; background: #e3e6ec; }
.create-art-doc.is-new { border-color: var(--primary); }
.create-art-doc.is-new i { background: var(--primary-100); }
.create-art-arrow { color: var(--text-mute); font-size: 14px; }
.create-art-code { width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; color: var(--primary); background: #fff; border: 1px solid var(--primary-soft); border-radius: 6px; }
.create-func-art .create-phone-list { width: 100%; max-width: 210px; }
.create-perm-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; font-size: 11.5px; color: var(--text-sub); }
.create-perm-row span:nth-child(2) { flex: 1; }
.create-perm-row b { width: 40px; flex: none; font-size: 11.5px; color: var(--text); }
.create-switch { width: 26px; height: 14px; border-radius: 8px; background: #d9dce2; position: relative; flex: none; }
.create-switch::after { content: ''; position: absolute; top: 1px; left: 1px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: left .15s; }
.create-switch.is-on { background: var(--primary); }
.create-switch.is-on::after { left: 13px; }
.create-check { font-style: normal; color: var(--primary); font-size: 12px; }
.create-art-table-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-mute); padding: 0 2px 2px; }

/* 弹层内的表单控件 */
.create-field-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.create-field-row > span:first-child { flex: none; width: 66px; font-size: 13px; color: var(--text-sub); }
.create-field-row input[type="color"] { width: 40px; height: 30px; padding: 0; flex: none; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; }
.create-field-row input[type="range"] { flex: 1; accent-color: var(--primary); }
.create-hex { width: 96px; flex: none; }
.create-range-val { flex: none; width: 42px; text-align: right; font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.create-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #fff; }
.create-chip-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 30px; margin-bottom: 8px; }
.create-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary); border-radius: 14px; padding: 4px 10px; font-size: 12px; }
.create-chip button { border: none; background: none; color: inherit; cursor: pointer; padding: 0; font-size: 12px; }
.create-decode-result { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 13px; line-height: 1.7; min-height: 72px; word-break: break-all; color: var(--text); white-space: pre-wrap; }
.create-phone-qr { display: flex; justify-content: center; margin-bottom: 10px; }

/* 相关模板推荐 */
.create-side { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.create-side-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.create-side-list { display: flex; flex-direction: column; gap: 8px; }
.create-side-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; transition: border-color .15s var(--ease); }
.create-side-item:hover { border-color: var(--primary); }
.create-side-item b { display: block; font-size: 13px; margin-bottom: 2px; }
.create-side-item span { font-size: 12px; color: var(--text-mute); }
.create-side-more { margin-top: 12px; width: 100%; }
@media (max-width: 900px) {
  .create-qr-host { min-height: 220px; }
  .create-qr-canvas { max-height: 240px; }
}

/* ==================== 模板库：左侧分类 + 搜索 + 推荐网格 ==================== */
.tpl-layout { display: grid; grid-template-columns: 190px 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .tpl-layout { grid-template-columns: 1fr; } .tpl-side { position: static !important; display: flex; flex-wrap: wrap; gap: 6px; } .tpl-side-group { width: 100%; } .tpl-cat { width: auto !important; } }
.tpl-side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 2px; }
.tpl-side-group { font-size: 12px; color: var(--text-mute); padding: 10px 10px 6px; }
.tpl-cat {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  border: none; background: none; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text-sub); cursor: pointer; text-align: left;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.tpl-cat:hover { background: var(--row-hover); color: var(--text); }
.tpl-cat.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tpl-cat-n { font-size: 11px; color: var(--text-mute); }
.tpl-cat.is-on .tpl-cat-n { color: var(--primary); }
.tpl-main { min-width: 0; }
.tpl-search { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 18px; }
.tpl-search-row { display: flex; gap: 10px; }
.tpl-search-row .f-input { flex: 1; }
.tpl-hot { margin-top: 10px; font-size: 12px; color: var(--text-mute); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tpl-hot-tag {
  border: none; background: var(--bg); border-radius: 12px; padding: 3px 10px;
  font-size: 12px; color: var(--text-sub); cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.tpl-hot-tag:hover { background: var(--primary-soft); color: var(--primary); }
.tpl-sec-title { font-size: 15px; font-weight: 600; margin: 4px 0 12px; display: flex; align-items: baseline; gap: 10px; }
.tpl-sec-title span { font-size: 12px; color: var(--text-mute); font-weight: 400; }
.tpl-new {
  border: 1.5px dashed var(--border-strong); background: var(--bg-elev);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; text-align: center; min-height: 140px; gap: 4px;
}
.tpl-new:hover { border-color: var(--primary); }
.tpl-new-plus { font-size: 30px; color: var(--primary); line-height: 1; }
.tpl-new-text { font-size: 14px; font-weight: 600; color: var(--primary); }
/* ============================================================
   活码工作台（一个活码 = 一个工作台 · 五页签）
   复用既有 token，信息层级靠排版与间距，不加装饰性动效
   ============================================================ */

.qw { max-width: 1200px; margin: 0 auto; padding: 18px 16px 60px; }

/* 页头：返回 + 名称状态 + 页签 */
.qw-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.qw-back {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  border: 1px solid var(--border); background: var(--panel); color: var(--text-sub);
  border-radius: var(--radius); padding: 7px 11px; font-size: 13px; cursor: pointer;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.qw-back:hover { border-color: var(--primary); color: var(--primary); }
.qw-head-main { min-width: 0; flex: 1 1 220px; }
.qw-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.qw-sub { font-size: 12px; color: var(--text-mute); margin-top: 5px; }
.qw-tabs { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.qw-tab {
  border: none; background: none; color: var(--text-sub); font-size: 13px;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.qw-tab:hover { color: var(--text); }
.qw-tab.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.qw-tab i { font-style: normal; font-size: 11px; color: var(--text-mute); margin-left: 4px; font-variant-numeric: tabular-nums; }
.qw-tab.is-on i { color: var(--primary); }

/* 通用面板与提示 */
.qw-panel-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.qw-hint { font-size: 12px; color: var(--text-mute); line-height: 1.7; }
.qw-side, .qw-code-panel, .qw-libs, .qw-mini, .qw-form-card, .qw-settings-main, .qw-data {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.qw-side { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.qw-empty {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 56px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.qw-empty-title { font-size: 15px; font-weight: 600; }
.qw-empty-sub { font-size: 13px; color: var(--text-mute); line-height: 1.8; max-width: 520px; }
.qw-empty-mini { padding: 24px; text-align: center; font-size: 13px; color: var(--text-mute); }

/* ---------- 预览 ---------- */
.qw-preview { display: grid; grid-template-columns: 244px minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.qw-mini { padding: 14px; }
.qw-mini-label { font-size: 11px; color: var(--text-mute); margin-bottom: 6px; letter-spacing: .04em; }
.qw-mini-title { font-size: 14px; font-weight: 600; line-height: 1.5; word-break: break-word; }
.qw-mini-sub { font-size: 12px; color: var(--text-mute); margin: 6px 0 12px; line-height: 1.6; }
.qw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qw-stats > div { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 6px; text-align: center; }
.qw-stats b { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qw-stats span { font-size: 11px; color: var(--text-mute); }

.qw-phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qw-phone {
  width: 100%; max-width: 344px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.qw-phone-cover { background: var(--primary-soft); padding: 26px 20px 20px; border-bottom: 1px solid var(--border); }
.qw-phone-title { font-size: 18px; font-weight: 600; line-height: 1.4; word-break: break-word; }
.qw-phone-desc { font-size: 12px; color: var(--text-sub); margin-top: 8px; line-height: 1.7; }
.qw-phone-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.qw-phone-none { font-size: 12px; color: var(--text-mute); text-align: center; padding: 18px 0; }
.qw-phone-foot { padding: 12px 14px 16px; border-top: 1px solid var(--border); }
.qw-phone-btn {
  display: block; text-align: center; background: var(--primary-grad); color: #fff;
  border-radius: 10px; padding: 11px; font-size: 14px; font-weight: 500; text-decoration: none;
  box-shadow: 0 2px 6px rgba(79, 70, 229, .22);
}
.qw-phone-tip { font-size: 11px; color: var(--text-mute); }

.qw-c { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font-size: 13px; line-height: 1.8; word-break: break-word; }
.qw-c-text { white-space: pre-wrap; }
.qw-c-img { width: 100%; height: auto; border-radius: var(--radius); display: block; }
.qw-c-media { width: 100%; border-radius: var(--radius); background: #000; display: block; }
.qw-c-audio { width: 100%; display: block; }
.qw-c-file { display: flex; align-items: center; gap: 8px; color: var(--text-sub); }
.qw-c-form { background: var(--primary-soft); border-color: #d6e0f5; color: var(--primary); font-weight: 500; text-align: center; }
.qw-c-link { display: flex; align-items: center; gap: 6px; color: var(--primary); }

.qw-code-panel { padding: 14px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 14px; }
.qw-code-img { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; text-align: center; }
.qw-code-img img { width: 100%; max-width: 200px; image-rendering: pixelated; }
.qw-code-url { font-size: 11px; color: var(--text-mute); word-break: break-all; line-height: 1.6; margin-bottom: 4px; }

/* ---------- 编辑 ---------- */
.qw-edit { display: grid; grid-template-columns: 196px minmax(0, 1fr) 224px; gap: 18px; align-items: start; }
.qw-libs { padding: 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 14px; }
.qw-lib-group { font-size: 11px; color: var(--text-mute); margin: 8px 0 2px; }
.qw-lib {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius);
  padding: 8px 10px; font-size: 13px; color: var(--text-sub); cursor: pointer; text-align: left;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.qw-lib:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.qw-lib[disabled] { opacity: .5; cursor: default; }
.qw-lib.is-locked { opacity: .55; }
.qw-lib.is-locked:hover { border-color: var(--border); color: var(--text-sub); background: var(--panel); }
.qw-canvas { display: flex; flex-direction: column; gap: 14px; }
.qw-cover-edit { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.qw-field { display: flex; flex-direction: column; gap: 5px; }
.qw-field > span { font-size: 12px; color: var(--text-sub); }
.qw-field-inline { flex-direction: row; align-items: center; gap: 10px; }
.qw-field-inline > span { flex: none; }
.qw-radio { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); margin-bottom: 8px; cursor: pointer; }
.qw-radio input { accent-color: var(--primary); }
.qw-comp-list { display: flex; flex-direction: column; gap: 10px; }
.qw-comp { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.qw-comp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.qw-comp-type { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-sub); }
.qw-comp-ops { display: flex; gap: 5px; }
.qw-comp-body { padding: 12px; }
.qw-comp-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); }
.qw-comp-media { display: flex; align-items: center; gap: 10px; }
.qw-comp-media img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.qw-comp-media .qw-c-media { max-width: 220px; }
.qw-comp-name { flex: 1; min-width: 0; font-size: 12px; color: var(--text-mute); word-break: break-all; }

/* ---------- 表单 ---------- */
.qw-form { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; align-items: start; }
.qw-form-card { padding: 20px; }
.qw-form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.qw-form-name { font-size: 16px; font-weight: 600; }
.qw-form-desc { font-size: 13px; color: var(--text-mute); margin-top: 6px; line-height: 1.7; }
.qw-form-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; color: var(--text-mute); margin: 16px 0 4px; }
.qw-form-meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.qw-form-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.qw-form-tags span { font-size: 11px; color: var(--text-sub); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 2px 8px; }
.qw-form-ops { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.qw-form-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.qw-form-qr img { width: 132px; image-rendering: pixelated; }

/* ---------- 设置 ---------- */
.qw-settings { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: start; }
.qw-settings-menu { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px; position: sticky; top: 14px; }
.qw-menu-item { border: none; background: none; text-align: left; padding: 9px 12px; border-radius: 6px; font-size: 13px; color: var(--text-sub); cursor: pointer; }
.qw-menu-item:hover { background: var(--row-hover); color: var(--text); }
.qw-menu-item.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.qw-settings-main { padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.qw-group { display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.qw-group:last-of-type { border-bottom: none; padding-bottom: 0; }
.qw-group-title { font-size: 13px; font-weight: 600; }
.qw-settings-bar { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.qw-copy-row { display: flex; gap: 8px; }
.qw-copy-row .f-input { flex: 1; font-size: 12px; }

/* ---------- 动态数据 ---------- */
.qw-data { padding: 0; overflow: hidden; }
.qw-data-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.qw-data-kw { width: 240px; }
.qw-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-mute); }
.qw-date .f-input { width: 138px; }
.qw-toolbar-spacer { flex: 1; }
.qw-view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.qw-view-toggle button { border: none; background: var(--panel); padding: 7px 12px; font-size: 12px; color: var(--text-sub); cursor: pointer; }
.qw-view-toggle button + button { border-left: 1px solid var(--border); }
.qw-view-toggle button.is-on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.qw-data-meta { font-size: 12px; color: var(--text-mute); padding: 10px 16px 0; }
.qw-table-wrap { overflow: auto; padding: 10px 16px 4px; }
.qw-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.qw-table th { text-align: left; font-weight: 500; color: var(--text-mute); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.qw-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--text-sub); vertical-align: top; max-width: 220px; word-break: break-word; }
.qw-table tr:last-child td { border-bottom: none; }
.qw-table tbody tr:hover { background: var(--row-hover); }
.qw-num { color: var(--text-mute); font-variant-numeric: tabular-nums; }
.qw-cell-sub { font-size: 11px; color: var(--text-mute); margin-top: 2px; }
.qw-atts { display: flex; gap: 6px; flex-wrap: wrap; }
.qw-atts img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.qw-att-file { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--primary); text-decoration: none; }
.qw-table-empty { text-align: center; color: var(--text-mute); padding: 30px 10px; }

.qw-record-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; padding: 12px 16px 4px; }
.qw-record-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.qw-record-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
.qw-record-head time { font-size: 11px; color: var(--text-mute); font-weight: 400; }
.qw-record-vals { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.qw-record-vals > div { display: flex; gap: 8px; font-size: 12px; }
.qw-record-vals b { flex: none; color: var(--text-mute); font-weight: 400; min-width: 56px; }
.qw-record-vals span { color: var(--text-sub); word-break: break-word; }
.qw-record-atts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.qw-record-atts img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); }

.qw-pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-mute); }

/* 窄屏：三栏降为单栏，保住可读性 */
@media (max-width: 1020px) {
  .qw-preview, .qw-edit, .qw-form, .qw-settings { grid-template-columns: minmax(0, 1fr); }
  .qw-code-panel, .qw-libs, .qw-settings-menu { position: static; }
  .qw-data-kw { width: 100%; }
}

/* ---------------- 表单工作台（fw：一个表单 = 一个工作台） ---------------- */
/* 预览：双手机 + 右侧设置摘要，布局与草料表单管理页一致 */
.fw-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 280px; gap: 18px; padding: 20px; align-items: start; }
.fw-phone-col { min-width: 0; }
.fw-phone-label { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 13px; color: var(--text-mute); margin-bottom: 10px; }
.fw-phone-label .btn-mini { padding: 1px 8px; font-size: 12px; }
.fw-preview .dz-phone { margin: 0 auto; }
.fw-preview .filler { max-height: 560px; overflow: auto; pointer-events: none; }
.fw-preview .filler .btn { pointer-events: none; }

.fw-side { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius, 10px); padding: 14px 16px; position: sticky; top: 16px; }
.fw-side-head { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.fw-side-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.fw-side-sub { font-size: 12px; color: var(--text-mute); line-height: 1.6; margin-bottom: 10px; word-break: break-all; }
.fw-sum { padding: 4px 0; }
.fw-sum-group { font-size: 12px; font-weight: 600; color: var(--text-mute); padding: 12px 0 4px; }
.fw-srow { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; padding: 7px 0; font-size: 13px; cursor: pointer; text-align: left; }
.fw-srow span { color: var(--text-mute); }
.fw-srow b { font-weight: 500; }
.fw-srow:hover b { color: var(--primary); }
.fw-side-time { border-top: 1px solid var(--border); padding-top: 10px; font-size: 12px; color: var(--text-mute); line-height: 1.8; }

/* 表单设计：字段清单 + 右侧操作 */
.fw-design { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; padding: 20px; align-items: start; }
.fw-design-main { min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius, 10px); padding: 14px 16px; }
.fw-field-table th, .fw-field-table td { font-size: 13px; }

/* 数据统计：顶部统计卡 */
.fw-stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; padding: 14px 16px 4px; }
.fw-stat-cards > div { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius, 10px); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.fw-stat-cards b { font-size: 20px; }
.fw-stat-cards span { font-size: 12px; color: var(--text-mute); }

/* 数据统计：子页签 + 统计矩阵 */
.fw-dtabs { display: flex; gap: 4px; padding: 12px 16px 0; border-bottom: 1px solid var(--border); background: var(--panel); }
.fw-dtab { border: 0; background: none; padding: 8px 14px; font-size: 13px; color: var(--text-sub); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.fw-dtab.is-on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.fw-dtab i { font-style: normal; font-size: 11px; margin-left: 4px; color: var(--text-mute); }
.fw-stats-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.fw-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.fw-pills.is-off { opacity: .45; pointer-events: none; }
.fw-pill { border: 1px solid var(--border); background: var(--card); color: var(--text-sub); border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer; }
.fw-pill.is-on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.fw-stats-table th b { display: block; font-weight: 500; }
.fw-stats-table th em { display: block; font-style: normal; font-size: 11px; color: var(--text-mute); font-weight: 400; }
.fw-stats-table td { white-space: nowrap; }

/* 提交成功页设置：选项卡片 / 富文本编辑器 / 后续按钮编辑 */
.fw-hide { display: none !important; }
.fw-choice-list { display: flex; flex-direction: column; gap: 8px; }
.fw-choice-list-row { flex-direction: row; flex-wrap: wrap; }
.fw-choice { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius, 10px); padding: 10px 12px; cursor: pointer; background: var(--card); }
.fw-choice-list-row .fw-choice { flex: 1 1 220px; }
.fw-choice.is-on { border-color: var(--primary); background: var(--primary-soft); }
.fw-choice input { margin-top: 2px; accent-color: var(--primary); }
.fw-choice span { display: flex; flex-direction: column; gap: 2px; }
.fw-choice b { font-size: 13px; font-weight: 600; }
.fw-choice i { font-style: normal; font-size: 12px; color: var(--text-mute); }
.fw-rich { border: 1px solid var(--border); border-radius: var(--radius, 10px); overflow: hidden; background: var(--card); }
.fw-rich-bar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--panel); }
.fw-rich-bar button { min-width: 28px; height: 26px; border: 0; background: none; border-radius: 4px; font-size: 12px; color: var(--text-sub); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.fw-rich-bar button:hover { background: var(--row-hover); color: var(--text); }
.fw-rich-sep { width: 1px; height: 14px; background: var(--border); margin: 0 4px; }
.fw-rich-body { min-height: 110px; padding: 10px 12px; font-size: 14px; line-height: 1.7; outline: none; overflow-wrap: anywhere; }
.fw-rich-body:empty::before { content: attr(data-placeholder); color: var(--text-mute); }
.fw-rich-body img { max-width: 100%; border-radius: 6px; display: block; margin: 6px 0; }
.fw-act-list { display: flex; flex-direction: column; gap: 8px; }
.fw-act-row { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius, 10px); background: var(--card); flex-wrap: wrap; }
.fw-act-type { font-size: 12px; color: var(--text-mute); width: 84px; flex: none; }
.fw-act-label { max-width: 160px; }
.fw-act-value { max-width: 200px; }
.fw-act-count { font-size: 11px; color: var(--text-mute); flex: none; }
.fw-act-btn { border: 1px solid var(--border); background: var(--panel); color: var(--text-sub); border-radius: 6px; font-size: 12px; padding: 4px 8px; cursor: pointer; }
.fw-act-btn:hover { border-color: var(--primary); color: var(--primary); }
.fw-act-add-wrap { position: relative; }
.fw-act-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 4px; min-width: 160px; }
.fw-act-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; font-size: 13px; border-radius: 6px; cursor: pointer; color: var(--text-sub); }
.fw-act-menu button:hover { background: var(--row-hover); color: var(--text); }
/* 已添加的按钮类型在面板中置灰，防重复添加 */
.fw-act-menu button[disabled] { opacity: .4; cursor: not-allowed; }
.fw-act-menu button[disabled]:hover { background: none; color: var(--text-sub); }
/* 提交成功页：形态选项悬停说明 / 富文本字号下拉 / 添加字段 */
.fw-q { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border-strong); color: var(--text-mute); font-size: 10px; margin-left: 4px; cursor: help; vertical-align: 1px; }
.fw-rich-size { height: 26px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); font-size: 12px; color: var(--text-sub); padding: 0 4px; margin-right: 2px; }
.fw-field-wrap { position: relative; display: inline-flex; margin-left: auto; }
.fw-rich-field-btn { color: var(--primary) !important; padding: 0 8px; }
.fw-field-menu { left: auto; right: 0; max-height: 240px; overflow: auto; }

/* 提交成功页：富文本提示 / 动态打勾 / 礼花 */
.done-rich { font-size: 14px; color: var(--text-mute); line-height: 1.7; margin-top: 8px; text-align: left; }
.done-rich img { max-width: 100%; border-radius: 6px; display: block; margin: 8px auto 0; }
.filler-done.is-confetti { position: relative; }
.done-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.done-confetti i { position: absolute; top: 16%; left: 50%; width: 7px; height: 10px; border-radius: 2px; opacity: 0; background: hsl(calc(var(--i) * 26), 78%, 60%); animation: doneFall 2.2s ease-out forwards; animation-delay: calc(var(--i) * .05s); }
@keyframes doneFall {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc((var(--i) - 7) * 14px), 300px) rotate(calc(var(--i) * 45deg)); }
}
.done-check { width: 52px; height: 52px; stroke: var(--success); fill: none; stroke-width: 3; }
.done-check circle { stroke-dasharray: 160; stroke-dashoffset: 160; animation: doneCircle .5s ease-out forwards; }
.done-check path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: doneTick .4s .45s ease-out forwards; }
.filler-done.is-check .done-icon { background: transparent; }
@keyframes doneCircle { to { stroke-dashoffset: 0; } }
@keyframes doneTick { to { stroke-dashoffset: 0; } }

@media (max-width: 1020px) {
  .fw-preview, .fw-design { grid-template-columns: minmax(0, 1fr); }
  .fw-side { position: static; }
  .fw-stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* 移动端：表单工作台的页签条与宽表格不得撑破视口（否则 fixed 弹窗按撑宽后的 innerWidth 定位而右侧被裁切） */
@media (max-width: 720px) {
  #view-formwork .qw-tabs {
    max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; flex-wrap: nowrap;
  }
  #view-formwork .qw-tabs::-webkit-scrollbar { display: none; }
  #view-formwork .qw-tabs .qw-tab { flex: none; }
  #view-formwork .qw-table-wrap, #view-formwork .fw-table-wrap {
    max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  #view-formwork table.qw-table, #view-formwork table.fw-stats-table {
    display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
}
