:root {
  --bg: #0c0e13;
  --panel: #14171e;
  --panel-2: #191d26;
  --line: #242935;
  --line-2: #2e3542;
  --fg: #e8ebf2;
  --dim: #8a93a6;
  --dim-2: #626b7d;
  --acc: #5b8cff;
  --acc-dim: #2a3f78;
  --ok: #35c07a;
  --warn: #f0b03a;
  --pro: linear-gradient(120deg, #ffb648, #ff7a59);
  --radius: 10px;
  --topbar-h: 52px;
  --toolbar-h: 44px;
  --layerbar-h: 74px;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

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

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 9px; }
.brand strong { font-size: 14px; letter-spacing: .2px; white-space: nowrap; }

.logo {
  width: 20px; height: 26px;
  border: 2px solid var(--acc);
  border-radius: 6px;
  position: relative;
  flex: none;
}
.logo::after {
  content: '';
  position: absolute;
  inset: 3px 3px 6px;
  background: linear-gradient(140deg, #6fa8ff, #2b4ea8);
  border-radius: 3px;
}

.privacy-badge {
  font-size: 11px;
  color: var(--ok);
  background: rgba(53, 192, 122, .10);
  border: 1px solid rgba(53, 192, 122, .28);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 6px 13px;
  white-space: nowrap;
  transition: .14s;
}
.btn:hover { border-color: #3d4657; background: #1f2431; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 500; }
.btn.primary:hover { background: #4a7dfa; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.export-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.export-group select {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 6px 8px;
}

.user-box { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a72d8, #7c4ad8);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.plan-tag {
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  background: var(--pro); color: #3a1d00;
}
.plan-tag.free { background: #2b3140; color: var(--dim); }

/* 剩余免费导出次数 */
.quota-tag {
  font-size: 11px;
  padding: 2px 7px; border-radius: 5px;
  background: #232838; color: var(--dim);
  border: 1px solid #333a4d;
  cursor: default;
}

/* 微信登录按钮 */
.wx-btn {
  width: 100%;
  background: #07c160 !important;
  border: 0 !important;
  color: #fff !important;
  font-weight: 600;
  padding: 10px !important;
}
.wx-btn:hover { background: #06ad56 !important; }

/* 「或使用邮箱」分隔线 */
.or-split {
  position: relative;
  text-align: center;
  margin: 16px 0 12px;
}
.or-split::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: #2b3140;
}
.or-split span {
  position: relative;
  background: var(--panel, #1a1e28);
  padding: 0 10px;
  font-size: 12px; color: var(--dim);
}

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

.layout {
  display: grid;
  grid-template-columns: 216px 1fr 296px;
  height: calc(100% - var(--topbar-h));
}

.sidebar-left, .sidebar-right {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-left { border-right: 1px solid var(--line); }
.sidebar-right { border-left: 1px solid var(--line); }

.side-head {
  height: var(--toolbar-h);
  display: flex; align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--dim);
}
.side-head span { font-weight: 600; letter-spacing: .4px; }
.mini {
  margin-left: auto;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--fg);
}
.mini:hover { border-color: var(--acc); color: var(--acc); }

/* ---------------- 左侧 tab：预设 / 自定义 ---------------- */

.side-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.side-tab {
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 0;
  font-size: 13px;
  color: var(--dim);
  cursor: pointer;
}
.side-tab:hover { color: var(--fg); }
.side-tab.on { color: var(--acc); border-bottom-color: var(--acc); font-weight: 600; }

.side-empty {
  padding: 24px 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--dim-2);
  text-align: center;
}

/* ---------------- 真实场景缩略图网格 ---------------- */

.scene-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0 2px 6px;
}
.scene-cell {
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 0 0 5px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.scene-cell:hover { border-color: var(--acc); }
.scene-cell.on { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.sc-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #0b0d12 center / cover no-repeat;
}
.sc-name {
  font-size: 11px;
  color: var(--dim);
  text-align: center;
}
.scene-cell.on .sc-name { color: var(--acc); }

/* 真实场景：无名称，缩略图铺满整格 */
.scene-cell.noname { position: relative; padding: 0; }
.sc-lock {
  position: absolute;
  right: 4px; bottom: 4px;
  font-size: 11px;
}

/* 排版模板缩略图（SVG 示意） */
.lay-cover {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: #0b0d12;
}
.lay-thumb { width: 100%; height: 100%; overflow: visible; }
.lay-thumb rect {
  fill: rgba(255, 255, 255, 0.14);
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 0.8;
}
.scene-cell.on .lay-thumb rect {
  fill: color-mix(in srgb, var(--acc) 28%, transparent);
  stroke: var(--acc);
}

/* ---------------- 设备列表 ---------------- */

.device-list { overflow-y: auto; padding: 8px; flex: 1; }

.dev-group { margin-bottom: 4px; }
.dev-group > h4 {
  margin: 8px 4px 6px;
  font-size: 11px;
  color: var(--dim-2);
  font-weight: 600;
  letter-spacing: .5px;
}
.dev-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
}
.dev-item:hover { background: var(--panel-2); }
.dev-item.on { background: var(--acc-dim); border-color: var(--acc); }
.dev-item .dv-ico {
  width: 22px; height: 30px;
  flex: none;
  border: 1.5px solid var(--dim);
  border-radius: 4px;
  position: relative;
}
.dev-item.cat-laptop .dv-ico, .dev-item.cat-desktop .dv-ico,
.dev-item.cat-browser .dv-ico { width: 32px; height: 22px; border-radius: 3px; }
.dev-item.cat-tablet .dv-ico { width: 26px; height: 32px; }
.dev-item.cat-watch .dv-ico { width: 20px; height: 24px; border-radius: 7px; }
.dev-item .dv-name { font-size: 12px; line-height: 1.3; }
.dev-item .dv-sub { font-size: 10px; color: var(--dim-2); }
.dev-item .lock {
  margin-left: auto;
  font-size: 10px;
  background: var(--pro);
  color: #3a1d00;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
}

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

.stage-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #090a0e;
}

.stage-toolbar {
  height: var(--toolbar-h);
  display: flex; align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  overflow-x: auto;
  scrollbar-width: none;
}
.stage-toolbar::-webkit-scrollbar { display: none; }
.spacer { flex: 1; }

.seg { display: flex; gap: 3px; }
.seg button {
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
}
.seg button.on { background: var(--acc); border-color: var(--acc); color: #fff; }

.inline-field { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--dim); }
.inline-field input {
  width: 62px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 4px 6px;
  text-align: center;
}
.zoom-label { font-size: 11px; color: var(--dim-2); min-width: 40px; text-align: right; }
.zoom-ctl { display: flex; align-items: center; margin-left: auto; }

/* 视图缩放浮层：贴在画布区右下角 */
.zoom-float {
  position: absolute;
  right: 14px;
  bottom: 44px;
  z-index: 6;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(16, 18, 24, .88);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(6px);
}
.zoom-float button {
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
  color: var(--dim);
}
.zoom-float button:hover { background: var(--panel-2); color: var(--acc); }

.stage {
  flex: 1;
  overflow: auto;
  display: grid;
  /* safe：画布放大到超出可视区时，从左上开始而不是被裁掉一半 */
  place-items: safe center;
  padding: 28px;
  background-image:
    linear-gradient(45deg, #14161c 25%, transparent 25%, transparent 75%, #14161c 75%),
    linear-gradient(45deg, #14161c 25%, transparent 25%, transparent 75%, #14161c 75%);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
}

.canvas-holder {
  position: relative;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .6);
  border-radius: 4px;
}
#canvas { display: block; border-radius: 4px; cursor: grab; }
#canvas.dragging { cursor: grabbing; }
#canvas.over { outline: 2px dashed var(--acc); outline-offset: -2px; }

/* 样机操作框：只负责缩放，框体本身不挡点击 */
.sel-box {
  position: absolute;
  border: 1px solid var(--acc);
  pointer-events: none;
  z-index: 4;
}
.sel-box .sh {
  position: absolute;
  width: 11px;
  height: 11px;
  margin: -6px 0 0 -6px;
  background: #fff;
  border: 1px solid var(--acc);
  border-radius: 2px;
  pointer-events: auto;
}
.sel-box .sh[data-c="nw"] { left: 0;    top: 0;    cursor: nwse-resize; }
.sel-box .sh[data-c="ne"] { left: 100%; top: 0;    cursor: nesw-resize; }
.sel-box .sh[data-c="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.sel-box .sh[data-c="sw"] { left: 0;    top: 100%; cursor: nesw-resize; }

/* 操作提示：工作区底部状态栏，不再浮在画面上 */
.stage-hint {
  flex: none;
  padding: 7px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  font-size: 11px;
  color: var(--dim-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- 图层条 ---------------- */

.layer-bar {
  height: var(--layerbar-h);
  border-top: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  overflow-x: auto;
}
.layer-bar::-webkit-scrollbar { height: 6px; }
.layer-bar::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

.layer-chip {
  display: flex; align-items: center; gap: 8px;
  flex: none;
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--panel-2);
  cursor: pointer;
  max-width: 210px;
}
.layer-chip.on { border-color: var(--acc); background: var(--acc-dim); }
.layer-chip .lc-thumb {
  width: 26px; height: 34px;
  border: 1.5px solid var(--dim);
  border-radius: 4px;
  flex: none;
  background-size: cover;
  background-position: center;
}
.layer-chip .lc-info { min-width: 0; }
.layer-chip .lc-name {
  font-size: 11px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.layer-chip .lc-state { font-size: 10px; color: var(--dim-2); }
.layer-chip .lc-x {
  border: 0; background: transparent; color: var(--dim-2);
  font-size: 15px; line-height: 1; padding: 0 2px;
}
.layer-chip .lc-x:hover { color: #ff6b6b; }

.layer-empty { font-size: 12px; color: var(--dim-2); }

/* ---------------- 右侧面板 ---------------- */

.tabs {
  height: var(--toolbar-h);
  display: flex;
  border-bottom: 1px solid var(--line);
}
.tabs button {
  flex: 1;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font-size: 12px;
}
.tabs button.on { color: var(--fg); border-bottom-color: var(--acc); }

.panel-body { flex: 1; overflow-y: auto; padding: 12px; }
.panel-body::-webkit-scrollbar { width: 8px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }

.grp {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--panel-2);
}
.grp > summary {
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center;
  color: #cdd4e2;
}
.grp > summary::-webkit-details-marker { display: none; }
.grp > summary::after {
  content: '›';
  margin-left: auto;
  transform: rotate(90deg);
  color: var(--dim-2);
  transition: .15s;
}
.grp[open] > summary::after { transform: rotate(-90deg); }
.grp > summary:hover { background: #1d222c; }
.grp .grp-in { padding: 4px 11px 12px; border-top: 1px solid var(--line); }

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 9px 0;
}
.row > label {
  flex: none;
  width: 74px;
  font-size: 11.5px;
  color: var(--dim);
}
.row.col { flex-direction: column; align-items: stretch; gap: 5px; }
.row.col > label { width: auto; }

.row input[type="text"], .row input[type="number"], .row select, .row textarea {
  flex: 1;
  min-width: 0;
  background: #10131a;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
}
.row input:focus, .row select:focus, .row textarea:focus {
  outline: none;
  border-color: var(--acc);
}
.row textarea { resize: vertical; min-height: 52px; font-size: 12px; }

.row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--line-2);
  border-radius: 2px;
  min-width: 0;
}
.row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--acc);
  cursor: pointer;
  border: 2px solid var(--panel);
}
.row .val {
  flex: none;
  width: 38px;
  font-size: 11px;
  color: var(--dim-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row input[type="color"] {
  width: 32px; height: 26px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: transparent;
  flex: none;
}
.row input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--acc);
  flex: none;
}
.row.check > label { width: auto; flex: 1; order: 2; color: var(--fg); font-size: 12px; }
.row.check > input { order: 1; }
/* 层级按钮行：按钮多，允许换行且不被压缩 */
.row.zrow { flex-wrap: wrap; }
.row.zrow .chip { flex: none; white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  border: 1px solid var(--line-2);
  background: #10131a;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11px;
  color: var(--dim);
}
.chip.on { border-color: var(--acc); background: var(--acc-dim); color: #fff; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw {
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.sw.on { border-color: var(--acc); }

.grad-presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.grad-presets .gp {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
}
.grad-presets .gp.on { border-color: #fff; }

.tip {
  font-size: 11px;
  color: var(--dim-2);
  line-height: 1.5;
  margin: 6px 0 0;
}
.pro-lock {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  background: rgba(255, 182, 72, .10);
  border: 1px solid rgba(255, 182, 72, .28);
  color: #ffc76b;
  padding: 7px 10px;
  border-radius: 8px;
  margin: 8px 0;
}
.pro-lock button {
  margin-left: auto;
  background: var(--pro);
  border: 0; color: #3a1d00;
  font-weight: 700; font-size: 11px;
  padding: 3px 9px; border-radius: 6px;
}

.wm-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #10131a;
}
.wm-item .wm-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  margin-bottom: 4px;
}
.wm-item .wm-head strong { font-size: 11.5px; font-weight: 600; }
.wm-item .wm-head button {
  background: transparent; border: 0; color: var(--dim-2); font-size: 14px; padding: 0 3px;
}
.wm-item .wm-head button:hover { color: #ff6b6b; }
.wm-item .wm-head .drag-btn { margin-left: auto; font-size: 10px; color: var(--acc); }

.btn-block {
  width: 100%;
  border: 1px dashed var(--line-2);
  background: transparent;
  border-radius: 8px;
  padding: 7px;
  font-size: 12px;
  color: var(--dim);
}
.btn-block:hover { border-color: var(--acc); color: var(--acc); }

/* ---------------- 弹窗 ---------------- */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, .72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
}
/* [hidden] 必须能覆盖上面的 display:grid，否则遮罩会一直挡住整页 */
[hidden] { display: none !important; }
.modal {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
.modal.wide { width: min(900px, 100%); }
.modal-head {
  display: flex; align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 14px; }
.modal-head .x {
  margin-left: auto;
  background: transparent; border: 0;
  color: var(--dim); font-size: 20px; line-height: 1;
}
.modal-in { padding: 18px; }
.modal-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end;
}

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; color: var(--dim); margin-bottom: 4px; }
.field input, .field select {
  width: 100%;
  background: #10131a;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
}
.err {
  background: rgba(255, 90, 90, .1);
  border: 1px solid rgba(255, 90, 90, .3);
  color: #ff8f8f;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}
.ok-msg {
  background: rgba(53, 192, 122, .1);
  border: 1px solid rgba(53, 192, 122, .3);
  color: #6fdca4;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}

.auth-switch {
  text-align: center;
  font-size: 12px;
  color: var(--dim);
  margin-top: 4px;
}
.auth-switch a { color: var(--acc); cursor: pointer; text-decoration: none; }

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.tpl-card {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
  background: #10131a;
  cursor: pointer;
}
.tpl-card:hover { border-color: var(--acc); }
.tpl-card .tc-img {
  aspect-ratio: 3/4;
  background: #0a0c11 center/contain no-repeat;
  border-bottom: 1px solid var(--line);
}
.tpl-card .tc-b { padding: 7px 9px; display: flex; align-items: center; gap: 5px; }
.tpl-card .tc-n {
  font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tpl-card .tc-d {
  margin-left: auto;
  background: transparent; border: 0;
  color: var(--dim-2); font-size: 13px;
}
.tpl-card .tc-d:hover { color: #ff6b6b; }

.price-card {
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}
.price-card.pro { border-color: #ffb648; background: rgba(255, 182, 72, .06); }
.price-card .pc-name { font-size: 13px; color: var(--dim); }
.price-card .pc-price { font-size: 30px; font-weight: 700; margin: 6px 0; }
.price-card .pc-price small { font-size: 13px; font-weight: 400; color: var(--dim); }
.price-card ul { text-align: left; padding-left: 18px; margin: 12px 0; font-size: 12px; color: #c3cad8; }
.price-card ul li { margin: 5px 0; }

.batch-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.batch-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}
.batch-row .br-thumb {
  width: 34px; height: 44px;
  background: #0a0c11 center/cover;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  flex: none;
}
.batch-row .br-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-row .br-x { background: transparent; border: 0; color: var(--dim-2); font-size: 15px; }

.progress {
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 12px;
}
.progress i { display: block; height: 100%; background: var(--acc); transition: width .2s; }

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 23, 30, .96);
  border: 1px solid var(--line-2);
  padding: 9px 18px;
  border-radius: 22px;
  font-size: 12.5px;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  animation: toastIn .2s ease;
}
.toast.err { border-color: rgba(255, 90, 90, .4); color: #ff9a9a; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------------- 移动端 ---------------- */

@media (max-width: 1080px) {
  .layout { grid-template-columns: 176px 1fr 260px; }
  .privacy-badge { display: none; }
}

@media (max-width: 820px) {
  body { overflow: auto; }
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .topbar-actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .sidebar-left, .sidebar-right {
    border: 0;
    border-top: 1px solid var(--line);
    max-height: 46vh;
  }
  .sidebar-left { order: 3; }
  .stage-wrap { order: 1; }
  .sidebar-right { order: 2; }
  .stage { padding: 14px; min-height: 46vh; }
  .device-list { max-height: 40vh; }
  .panel-body { max-height: 42vh; }
}