:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e3e5ea;
  --text: #1d2129;
  --muted: #86909c;
  --brand: #2f6fed;
  --brand-soft: #eaf1ff;
  --danger: #e5484d;
  --ok: #12a150;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.05);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }

/* ---------- 顶栏 ---------- */
.top {
  height: 54px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  position: sticky; top: 0; z-index: 30;
}
.top h1 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: .2px; }
.top .tag { font-size: 12px; color: var(--muted); }
.top .grow { flex: 1; }

.btn {
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; white-space: nowrap; transition: .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: #c9cdd4; background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #2a63d4; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #f0f1f3; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }

/* ---------- 主体布局 ---------- */
.wrap { display: flex; align-items: stretch; height: calc(100vh - 54px); }

.side { width: 306px; flex: 0 0 306px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 12px; }
.side.collapsed { display: none; }

/* 手机上「参数」是弹出抽屉（不是往下滚页面）：标题栏桌面隐藏 */
.side-head { display: none; }
.sheet-mask { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.35); }

.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.card > h3 {
  margin: 0 0 10px; font-size: 13px; font-weight: 650; color: #4e5969;
  display: flex; align-items: center; justify-content: space-between;
}
.card > h3 .mini { font-weight: 400; color: var(--muted); font-size: 12px; }

.field { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.field > label { flex: 0 0 74px; color: #4e5969; font-size: 13px; }
.field > input[type=number], .field > select, .field > input[type=text] {
  flex: 1; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px;
  background: #fbfbfc; min-width: 0;
}
.field > input:focus, .field > select:focus { outline: none; border-color: var(--brand); background: #fff; }
.field.col { display: block; }
.field.col > label { display: block; margin-bottom: 5px; }

.row { display: flex; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.chk { display: inline-flex; align-items: center; gap: 6px; color: #4e5969; font-size: 13px; cursor: pointer; }
.chk input { margin: 0; }

/* ---------- 拖拽上传 ---------- */
.drop {
  border: 1.5px dashed #c9cdd4; border-radius: var(--radius); padding: 18px 12px; text-align: center;
  color: var(--muted); cursor: pointer; transition: .15s; background: #fcfcfd;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.drop b { display: block; color: var(--text); font-weight: 600; margin-bottom: 3px; }

/* ---------- 工具条 ---------- */
.tools {
  height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button {
  border: 0; background: #fff; height: 32px; padding: 0 11px; cursor: pointer; color: #4e5969;
  border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand); color: #fff; }
.sep { width: 1px; height: 22px; background: var(--line); }

/* ---------- 画布区 ---------- */
.canvas-area {
  flex: 1; overflow: auto; padding: 0;
  position: relative;
  /* 🔴 老板 2026-10-20 第 1 条：滚轮缩放要以「鼠标所在位置」为中心。
     以前用 flex 居中（justify-content: safe center）：画布比容器小时居中、比容器大时左对齐，
     缩放穿过这个临界点时画布会整体平移一大段，滚动条也补不回来 → 感觉「跳来跳去」。
     现在改成 block 布局 + JS 给画布加大边距（updateCanvasPad），保证容器**任何尺寸下都能滚**，
     于是 zoomAt 的滚动补偿永远有效，光标下的那格图案老老实实待在原地。 */
  background:
    linear-gradient(45deg, #eef0f3 25%, transparent 25%, transparent 75%, #eef0f3 75%),
    linear-gradient(45deg, #eef0f3 25%, transparent 25%, transparent 75%, #eef0f3 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px;
}
.canvas-area.overflowing { justify-content: flex-start; }   /* 兼容旧逻辑，block 布局下无作用 */
.canvas-stack {
  position: relative; display: inline-block; background: #fff;
  box-shadow: var(--shadow); border-radius: 6px; vertical-align: top;
}
#emptyHint {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; pointer-events: none;
}
/* 手势全部由脚本接管（单指=编辑/平移，双指=缩放）；不写这句手机浏览器会自己缩放整页，跟画布编辑打架 */
.canvas-stack canvas { display: block; border-radius: 6px; touch-action: none; }
#cvBase { position: absolute; left: 0; top: 0; }

.empty { color: var(--muted); text-align: center; margin: auto; }

/* ---------- 对比滑块 ---------- */
.compare {
  height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: var(--panel); border-top: 1px solid var(--line);
}
.compare input[type=range] { flex: 1; }
.compare .lab { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- 色号网格（用量表） ---------- */
.swatches { display: grid; grid-template-columns: 1fr; gap: 6px; max-height: 300px; overflow-y: auto; }
.sw {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--line); cursor: pointer; background: #fff;
}
.sw:hover { border-color: var(--brand); background: var(--brand-soft); }
.sw.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }
.sw .chip { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(0,0,0,.12); flex: 0 0 auto; }
.sw .code { font-weight: 650; font-family: ui-monospace, Menlo, Consolas, monospace; }
.sw .n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 色盘 ---------- */
.palgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 4px; max-height: 190px; overflow-y: auto; }
.pg { aspect-ratio: 1; border-radius: 5px; border: 1px solid rgba(0,0,0,.12); cursor: pointer; }
.pg:hover { transform: scale(1.14); }
.pg.on { box-shadow: 0 0 0 2px var(--brand); }

/* ---------- 统计条 ---------- */
.stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.stats b { color: var(--text); font-weight: 650; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(8px);
  background: #1d2129; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 100;
}
.toast.show { opacity: .95; transform: translateX(-50%) translateY(0); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.hint code { background: #f2f3f5; padding: 1px 4px; border-radius: 4px; font-family: ui-monospace, Menlo, monospace; }

/* ---------- 进度遮罩 ---------- */
.busy {
  position: fixed; inset: 0; background: rgba(255,255,255,.72); display: none;
  align-items: center; justify-content: center; z-index: 90; backdrop-filter: blur(2px);
}
.busy.on { display: flex; }
.busy .box { background: #fff; border-radius: 12px; padding: 18px 26px; box-shadow: var(--shadow); font-weight: 600; }

/* ---------- 底部操作条（只在手机上显示）---------- */
.mobilebar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
  padding: 8px 10px; gap: 8px; backdrop-filter: blur(6px);
}
.mobilebar .btn { flex: 1; justify-content: center; height: 42px; border-radius: 9px; }

/* ---------- 移动端：大部分用户是手机（小孩），优先保证不溢出 ---------- */
@media (max-width: 860px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  body { padding-bottom: 64px; }                 /* 给底部操作条留位置 */

  /* 顶栏：标题绝不换行，次要按钮收走 */
  .top { height: 50px; padding: 0 10px; gap: 8px; overflow-x: auto; flex-wrap: nowrap; }
  .top h1 { font-size: 15px; white-space: nowrap; flex: 0 0 auto; }
  .top .tag { display: none; }
  .only-desktop { display: none !important; }

  /* 布局：画布就是整页；参数面板变成弹出抽屉（老板要求：点「参数」弹框，不往下滚） */
  .wrap { flex-direction: column; height: auto; }
  .stage { order: 1; }
  .side {
    position: fixed; inset: 0; z-index: 60; display: none; order: 2;
    width: 100%; flex: none; border: 0; max-height: none;
    padding: 0 10px 96px; background: var(--bg);
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .side.open { display: block; }
  .side-head {
    position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
    height: 52px; margin: 0 -10px 10px; padding: 0 12px;
    background: #fff; border-bottom: 1px solid var(--line);
  }
  .side-head b { font-size: 15px; font-weight: 650; }
  .side-head .btn { margin-left: auto; }
  .sheet-mask.on { display: block; }
  body.sheet-open { overflow: hidden; }

  .canvas-area { min-height: 56vh; max-height: 72vh; padding: 6px; }
  .canvas-stack { max-width: none; }	/* 老板 2026-10-20：max-width:100% 会把超宽画布压扁，滚动空间变 0，缩放锚点也失效 */

  /* 工具条横向滚动，不换行挤压 */
  .tools { padding: 6px 8px; gap: 6px; overflow-x: auto; flex-wrap: nowrap; height: auto; }
  .tools .seg, .tools .btn, .tools .chk, .tools .brushrow { flex: 0 0 auto; }
  .tools .sep { display: none; }
  .brushrow input[type=range] { width: 78px; }

  /* 对比滑块行允许换行 */
  .compare { padding: 6px 10px; gap: 8px; height: auto; min-height: 44px; flex-wrap: wrap; }
  .compare input[type=range] { flex: 1 1 130px; min-width: 80px; }
  .compare .lab { font-size: 11px; }

  .swatches { max-height: 250px; }
  .palgrid { max-height: 150px; }
  .card { padding: 11px; }
  .field > label { flex: 0 0 66px; font-size: 12.5px; }
  .mobilebar { display: flex; }
}

/* 擦除笔刷的「真实大小」方框：跟着手指/鼠标走，大小 = N 格 × 格宽（老板 2026-10-19 要求：
   禁止符号光标又看不出多大，要一个能随滑块变大变小的正方形橡皮擦）。
   🔴 描边要「白内圈 + 黑外圈」双层：只在红珠子上画红虚线对比度太低，深浅底都得看得见。 */
.brushprev {
  display: none; position: absolute; z-index: 6; pointer-events: none;
  border: 2px dashed #ff2d55;
  background: rgba(255,45,85,.13);
  border-radius: 2px;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.92), 0 0 0 3.5px rgba(0,0,0,.5);
}
.brushprev.on { display: block; }

/* ---------- 擦除笔刷大小（只在「擦除」工具下出现） ---------- */
.brushrow { display: none; align-items: center; gap: 6px; }
.brushrow.on { display: inline-flex; }
.brushrow .lab { color: var(--muted); font-size: 12px; white-space: nowrap; }
.brushrow input[type=range] { width: 96px; accent-color: var(--brand); }
.brushrow b { color: var(--brand); font-size: 12.5px; min-width: 34px; font-variant-numeric: tabular-nums; }

/* 尺寸滑块：🔴 2026-10-20 老板要求「滑块独占一行，别把 60×60 和解锁标签挤在同一行」
   做法：.range-row 允许换行，滑块 flex 1 1 100% 占满第一行（手指好拖），
   数字与「解锁 200 格」落到第二行（数字靠左、锁靠右）。 */
.range-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.range-row input[type=range] { flex: 1 1 100%; width: 100%; min-width: 0; }
.range-row b {
  flex: 0 0 auto; min-width: 0; text-align: left; color: var(--brand);
  font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: .3px;
}

/* ---------- 框选裁剪 ---------- */
.croptip {
  display: none; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff8e6; border-bottom: 1px solid #ffe1a8; color: #8a6d1d;
  padding: 6px 12px; font-size: 12.5px; line-height: 1.4;
}
.croptip.on { display: flex; }
.croptip .chk { color: #8a6d1d; font-size: 12.5px; }
.croptip .cropbtns { margin-left: auto; display: flex; gap: 8px; flex: 0 0 auto; }
.croptip .cropbtns .btn { margin-left: 0; }

/* 框选：框常显（拖边改大小 / 拖里面挪位置）。
   🔴 框外压暗用 4 块矩形（#cropDim），**绝不能用超大 box-shadow + overflow:hidden**——
   手机端 .canvas-stack 有 max-width:100%，overflow:hidden 会把超宽的画布裁掉 →
   横向滚动空间变 0 → 「✋移动」横向彻底拖不动（老板 2026-10-19 报的“移动功能失效”就是这么来的）。 */
.cropbox {
  display: none; position: absolute; z-index: 5; pointer-events: none;
  border: 2px dashed var(--brand); background: rgba(47,111,237,.10);
  box-shadow: 0 0 0 1px rgba(255,255,255,.85) inset;
  cursor: move;
}
/* 框选时压暗框外区域：4 块矩形，靠 JS 按框的位置摆（见 showCropBox） */
.cropdim { display: none; position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; }
.cropdim i { position: absolute; display: block; background: rgba(15,23,42,.42); }

.cropbox .ch {
  position: absolute; width: 12px; height: 12px; box-sizing: border-box;
  background: #fff; border: 2px solid var(--brand); border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.cropbox .ch.nw { left: -7px; top: -7px; }
.cropbox .ch.n  { left: 50%; top: -7px; margin-left: -6px; }
.cropbox .ch.ne { right: -7px; top: -7px; }
.cropbox .ch.e  { right: -7px; top: 50%; margin-top: -6px; }
.cropbox .ch.se { right: -7px; bottom: -7px; }
.cropbox .ch.s  { left: 50%; bottom: -7px; margin-left: -6px; }
.cropbox .ch.sw { left: -7px; bottom: -7px; }
.cropbox .ch.w  { left: -7px; top: 50%; margin-top: -6px; }

/* 手机上：手柄放大好按，提示条里的两个按钮各占一半 */
@media (max-width: 860px) {
  .cropbox .ch { width: 16px; height: 16px; }
  .cropbox .ch.nw { left: -9px; top: -9px; }
  .cropbox .ch.ne { right: -9px; top: -9px; }
  .cropbox .ch.se { right: -9px; bottom: -9px; }
  .cropbox .ch.sw { left: -9px; bottom: -9px; }
  .cropbox .ch.n  { margin-left: -8px; }
  .cropbox .ch.s  { margin-left: -8px; }
  .cropbox .ch.e  { margin-top: -8px; }
  .cropbox .ch.w  { margin-top: -8px; }
  .croptip { padding: 6px 10px; gap: 8px; font-size: 12px; }
  .croptip .cropbtns { width: 100%; margin-left: 0; margin-top: 2px; }
  .croptip .cropbtns .btn { flex: 1; height: 34px; }
}

/* ---------- 手机上的「放大看色号」提示 ---------- */
.zoomtip {
  display: none; background: #fff8e6; border-bottom: 1px solid #ffe1a8; color: #8a6d1d;
  padding: 7px 12px; font-size: 12.5px; line-height: 1.4; text-align: center;
}
.zoomtip.on { display: block; }

/* ============================================================================
 * 2026-10-20 视觉升级（配合会员版发布）
 * 🔴 原则：只改「颜色 / 圆角 / 阴影 / 字重 / 过渡」，不动任何布局尺寸
 *   （width / height / flex / position / inset 一律不碰），
 *   否则会破坏已在手机上逐条验收过的排版（见技能 §移动端铁律）。
 * ==========================================================================*/
:root {
  --bg: #f6f7fb;
  --line: #e6e8f0;
  --text: #16181d;
  --muted: #7b8494;
  --brand: #4f46e5;
  --brand-soft: #eef0ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.07);
}

body {
  background:
    radial-gradient(1200px 600px at 10% -12%, #eef0ff 0%, transparent 62%),
    radial-gradient(900px 520px at 92% -4%, #fdf2f8 0%, transparent 58%),
    var(--bg);
  /* 🔴 绝对不要加 background-attachment:fixed —— 2026-10-20 实测：软件栅格化下
     每帧都要重绘整屏双层 radial-gradient，一旦盖上全屏半透明遮罩（付费弹窗）就卡死，
     无头浏览器 Page.captureScreenshot 直接 60s 超时。滚动观感差别几乎为零，别为了炫技付性能账。 */
  letter-spacing: .1px;
}

/* 顶栏：不透明纯白（🔴 2026-10-20 实测 backdrop-filter:blur 会让合成层卡顿，
   手机滚动掉帧、无头浏览器截图直接超时 60s；改用 97% 白 + 细阴影，肉眼几乎无差别） */
.top {
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid rgba(226,229,239,.9);
  box-shadow: 0 1px 0 rgba(16,24,40,.03);
}
.top h1 {
  background: linear-gradient(118deg,#4f46e5,#7c3aed 55%,#db2777);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: .3px;
}
.top .tag { color: #9aa1b1; }

/* 按钮：圆角 + 微抬升 + 渐变主按钮 */
.btn {
  border-radius: 10px; border-color: #e2e5ef; font-weight: 600;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  transition: transform .14s, box-shadow .16s, border-color .16s, background .16s;
}
.btn:hover {
  border-color: #c7cdf0;
  box-shadow: 0 4px 14px rgba(79,70,229,.13);
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(135deg,#4f46e5,#7c3aed);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(79,70,229,.3);
}
.btn.primary:hover {
  background: linear-gradient(135deg,#4338ca,#6d28d9);
  box-shadow: 0 9px 24px rgba(79,70,229,.38);
}
.btn.sm { border-radius: 8px; }

/* 卡片：柔和描边 + 悬浮抬升，标题带渐变竖条 */
.card {
  border-color: #eaecf4;
  box-shadow: var(--shadow);
  transition: box-shadow .18s, border-color .18s;
}
.card:hover { border-color: #e2e5f2; box-shadow: 0 2px 6px rgba(16,24,40,.06), 0 14px 34px rgba(16,24,40,.09); }
.card > h3 { color: #3b4354; }
.card > h3::before {
  content: ''; flex: 0 0 auto; width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(180deg,#4f46e5,#db2777); margin-right: 7px;
}

/* 输入类控件统一描边 */
.field > input[type=number], .field > select, .field > input[type=text],
.card input[type=text] { border-color: #e2e5ef; transition: border-color .15s, box-shadow .15s, background .15s; }
.field > input:focus, .field > select:focus, .card input[type=text]:focus {
  border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(79,70,229,.13);
}

/* 工具条：胶囊分段控件 */
.seg { border-radius: 11px; border-color: #e2e5ef; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.seg button { transition: background .15s, color .15s; }
.seg button:hover { background: #f6f7fd; color: var(--brand); }
.seg button.on {
  background: linear-gradient(135deg,#4f46e5,#7c3aed);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
}
.seg button.on:hover { color: #fff; }

/* 滑块：统一成细轨 + 白芯紫环的圆形滑块（只改外观，不改宽度） */
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: #e6e8f2; }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5.5px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand);
  box-shadow: 0 2px 6px rgba(79,70,229,.34);
}
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.08); }
input[type=range]::-moz-range-track { height: 5px; border-radius: 99px; background: #e6e8f2; }
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 2px solid var(--brand); box-shadow: 0 2px 6px rgba(79,70,229,.34);
}

/* 画布区：更柔和的棋盘格 + 图纸悬浮感 */
.canvas-area {
  background-image:
    linear-gradient(45deg, #eceef4 25%, transparent 25%, transparent 75%, #eceef4 75%),
    linear-gradient(45deg, #eceef4 25%, transparent 25%, transparent 75%, #eceef4 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px;
}
.canvas-stack {
  border-radius: 10px;
  box-shadow: 0 10px 34px rgba(16,24,40,.14), 0 1px 0 rgba(16,24,40,.05);
}
.canvas-stack canvas { border-radius: 10px; }

/* 空状态：加一个拼豆图标，别让首屏显得空空荡荡 */
.empty::before {
  content: '🧩'; display: block; font-size: 42px; line-height: 1.2; margin-bottom: 4px;
  filter: drop-shadow(0 8px 16px rgba(79,70,229,.24));
}

/* 用量色号行 */
.sw { border-radius: 10px; transition: border-color .14s, background .14s, transform .14s; }
.sw:hover { transform: translateX(1px); }
.sw .code { letter-spacing: .3px; }

/* 拖拽上传区 */
.drop { border-color: #d6dae8; transition: border-color .16s, background .16s, box-shadow .16s; }
.drop:hover, .drop.over {
  border-color: var(--brand); background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(79,70,229,.16), 0 8px 22px rgba(79,70,229,.12);
}

/* 提示条 / 时钟类小元素 */
.range-row b { color: var(--brand); }
.stats b { letter-spacing: .2px; }

/* 作品库（会员） */
.worklist { display: flex; flex-direction: column; gap: 6px; max-height: 224px; overflow-y: auto; }
.work-item {
  display: flex; align-items: center; gap: 7px; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: .15s;
}
.work-item:hover { border-color: #c7cdf0; background: #fafbff; }
.wi-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wi-main b {
  font-size: 12.5px; font-weight: 650; color: #2a3040;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wi-meta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wi-del { color: #b3b8c4; padding: 0 8px; }
.wi-del:hover { color: var(--danger); border-color: #f3c7c8; background: #fef2f2; }
.work-empty {
  font-size: 12px; color: var(--muted); text-align: center; padding: 13px 8px; line-height: 1.85;
  background: #fafbfe; border: 1px dashed var(--line); border-radius: 10px;
}

/* 底部操作条 / 弹出提示 */
.mobilebar { background: rgba(255,255,255,.94); box-shadow: 0 -6px 22px rgba(16,24,40,.07); }
.toast {
  background: rgba(22,24,29,.94); border-radius: 11px;
  box-shadow: 0 12px 30px rgba(16,24,40,.28); font-weight: 500;
}
.busy .box { border-radius: 14px; box-shadow: 0 18px 44px rgba(16,24,40,.16); }

/* 手机端：只补视觉，不碰布局 */
@media (max-width: 860px) {
  .side-head { background: #fff; }
  .mobilebar .btn.primary { background: linear-gradient(135deg,#4f46e5,#7c3aed); }
}

/* 顶栏账号按钮（2026-10-20 账号系统上线） */
.auth-btn { background: #fff; border-color: #e2e5ef; font-weight: 600; }
.auth-btn .ab-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #c7cbd6; margin-right: 5px; vertical-align: 1px;
}
.auth-btn .ab-dot.pro { background: #f59e0b; }
.auth-btn.member {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #fcd34d; color: #92400e;
}
.auth-btn:hover { border-color: #c7cdf0; }

/* 返回图纸库（make.html 顶栏）——2026-10-20 加，必须 nowrap 否则手机上被挤成两行 */
.back-gal {
  flex: 0 0 auto; white-space: nowrap;
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 10px; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: #4f46e5;
  background: #eef0ff; border: 1px solid #e0e4ff; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.back-gal:hover { background: #e4e7ff; border-color: #cfd6ff; }

/* 手机上顶栏塞不下「返回 + 标题 + 登录 + 会员 + 导出」五个东西，
   实测溢出 410px > 390px 屏宽，「导出图纸」被截断。
   「← 图纸库」已能表明位置，所以手机端把长标题收起来，保住操作按钮。 */
@media (max-width: 860px) {
  .top h1 { display: none; }
  .back-gal { height: 28px; padding: 0 9px; font-size: 12.5px; }
}

/* 「看原图」开关（老板 2026-10-20 第 5 条）——放在透明度滑块最右边 */
.mini-raw {
  flex: 0 0 auto; white-space: nowrap; margin-left: 10px;
  height: 26px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: #4f46e5;
  background: #eef0ff; border: 1px solid #e0e4ff;
  transition: background .15s, color .15s, border-color .15s;
}
.mini-raw:hover { background: #e4e7ff; }
.mini-raw.on { background: #4f46e5; color: #fff; border-color: #4f46e5; }
@media (max-width: 860px) {
  .mini-raw { height: 24px; padding: 0 8px; font-size: 12px; margin-left: 8px; }
}

/* 「存为模板」按钮（站长专用，老板 2026-10-20 第 4 条） */
.mini-tpl {
  flex: 0 0 auto; white-space: nowrap; margin-left: 8px;
  height: 26px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: #047857;
  background: #ecfdf5; border: 1px solid #a7f3d0;
  transition: background .15s, border-color .15s;
}
.mini-tpl:hover { background: #d1fae5; border-color: #6ee7b7; }
.hidden { display: none !important; }
@media (max-width: 860px) {
  .mini-tpl { height: 24px; padding: 0 8px; font-size: 12px; margin-left: 6px; }
}
