/* 爱玩豆 · 图纸台 */
.editor { height: 100vh; overflow: hidden; background: var(--bg); }
.editor * { -webkit-tap-highlight-color: transparent; }

/* 顶栏 */
.ed-top {
  height: 56px; display: flex; align-items: center; gap: 14px;
  padding: 0 14px; background: #fff; border-bottom: 1px solid var(--line);
  position: relative; z-index: 20;
}
.ed-brand { display: flex; align-items: center; gap: 9px; }
.ed-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.ed-brand .brand-mark svg { width: 17px; height: 17px; }
.ed-brand .brand-name { font-size: 15px; }
.doc-name {
  width: 168px; height: 34px; border: 1px solid transparent; border-radius: 9px;
  padding: 0 10px; font-size: 13.5px; font-weight: 600; background: transparent; outline: none;
  color: var(--ink);
}
.doc-name:hover { background: var(--bg); }
.doc-name:focus { background: #fff; border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,181,140,.12); }

.ed-actions { display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.tb-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px;
  border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.tb-btn svg { width: 17px; height: 17px; }
.tb-btn:hover { background: var(--green-tint); color: var(--green-deep); }
.tb-btn.accent { background: var(--green); color: #fff; }
.tb-btn.accent:hover { background: var(--green-dark); }
.tb-btn.ghost { border-color: var(--line); }
.ed-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.palette-sel {
  height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  padding: 0 8px; font-size: 12.5px; color: var(--ink-2); outline: none;
}

/* 主区 */
.ed-main { display: flex; height: calc(100vh - 56px); }

/* 左侧工具栏 */
.rail {
  width: 84px; flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 10px 0 8px; gap: 2px;
  overflow-y: auto; z-index: 10;
}
.rail-group { display: flex; flex-direction: column; gap: 2px; width: 100%; align-items: center; }
.rail-foot { margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line); width: 62px; }
.tool {
  width: 66px; padding: 7px 0 5px; border-radius: 11px; display: flex; flex-direction: column;
  align-items: center; gap: 3px; color: var(--ink-2); font-size: 10.5px; line-height: 1.2;
  transition: background .14s, color .14s;
}
.tool svg { width: 21px; height: 21px; }
.tool:hover { background: var(--bg); color: var(--ink); }
.tool.active { background: var(--green-soft); color: var(--green-deep); font-weight: 700; }
.tool:disabled { opacity: .35; }
.color-dot {
  width: 21px; height: 21px; border-radius: 7px; background: #ddd;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}

/* 画布区 */
.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #EEF3F0; }
.stage-bg {
  position: relative; flex: 1; overflow: hidden;
  background-color: #F1F5F3;
  background-image:
    linear-gradient(45deg, #E7EDEA 25%, transparent 25%, transparent 75%, #E7EDEA 75%),
    linear-gradient(45deg, #E7EDEA 25%, transparent 25%, transparent 75%, #E7EDEA 75%);
  background-size: 22px 22px; background-position: 0 0, 11px 11px;
}
#board { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
#board.panning { cursor: grab; }
#board.panning.dragging { cursor: grabbing; }
#board.picking { cursor: copy; }

.empty-hint {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; text-align: center; background: #F7FAF8;
}
.empty-hint.hide { display: none; }
.eh-icon { font-size: 34px; }
.empty-hint h3 { margin: 0; font-size: 17px; }
.empty-hint p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.eh-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.zoom-ctl {
  position: absolute; right: 16px; top: 16px; display: flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 6px; box-shadow: var(--shadow-sm); font-size: 12px; color: var(--ink-2);
}
.zoom-ctl button {
  min-width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 15px; color: var(--ink-2); font-weight: 600;
}
.zoom-ctl button:hover { background: var(--green-soft); color: var(--green-deep); }
.zoom-ctl span { min-width: 46px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.zoom-ctl .zoom-fit { font-size: 11.5px; padding: 0 8px; }
.cursor-readout {
  position: absolute; left: 12px; bottom: 12px; font-size: 11px; color: var(--muted);
  background: rgba(255,255,255,.9); padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
}
.stage-foot {
  height: 32px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px;
  background: #fff; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted);
}
.stage-foot .dot-sep { opacity: .5; }
.foot-right { margin-left: auto; color: #A6B5AD; }

/* 右侧面板 */
.panel {
  width: 300px; flex: none; background: #fff; border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.panel-sec { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel-sec.grow { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.panel-title { font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.pal-count { font-size: 11px; color: var(--green-deep); background: var(--green-soft); padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.iron-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.iron {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; text-align: left;
  transition: border-color .15s, background .15s;
}
.iron b { font-size: 11.5px; font-weight: 700; }
.iron span { font-size: 10px; color: var(--muted); }
.iron .iron-sw { width: 100%; height: 16px; border-radius: 5px; margin-bottom: 3px; background: linear-gradient(135deg, #A7D9CB, #7FBFAE); }
.iron .i-baking { background: linear-gradient(135deg, #F6DDB4, #E8B77E); }
.iron .i-towel { background: repeating-linear-gradient(90deg, #D9E7DF 0 3px, #C7DAD0 3px 6px); }
.iron .i-silk { background: repeating-linear-gradient(45deg, #DCE7F0 0 3px, #C6D6E4 3px 6px); }
.iron.active { border-color: var(--green); background: var(--green-tint); box-shadow: 0 2px 8px rgba(29,181,140,.12); }

.pal-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pal-search { flex: 1; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; font-size: 12px; outline: none; min-width: 0; }
.pal-search:focus { border-color: var(--green); }
.switch.tiny { font-size: 11px; white-space: nowrap; color: var(--muted); }

.pal-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.pal-row {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 7px; cursor: pointer;
  font-size: 11.5px; color: var(--ink-2); border: 1px solid transparent;
}
.pal-row:hover { background: var(--bg); }
.pal-row.on { background: var(--green-tint); border-color: #BFE7DA; }
.pal-row i { width: 18px; height: 18px; border-radius: 5px; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.pal-row b { font-weight: 700; font-size: 11.5px; min-width: 30px; }
.pal-row .pname { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-row .pcount { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--green-deep); font-weight: 600; }
.pal-row .pcount.zero { color: #C6D2CC; font-weight: 500; }
.pal-row .pspare { font-size: 10px; color: #9AA9A2; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.pal-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 20px 0; }
.pal-selected { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-bottom: 9px; }
.pal-selected i { width: 26px; height: 26px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.pal-selected b { color: var(--ink); font-size: 13px; }
.pal-selected button { margin-left: auto; font-size: 11px; color: var(--green-deep); font-weight: 600; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.pal-selected button:hover { background: var(--green-tint); border-color: #BFE7DA; }

.panel-stat { border-bottom: 0; background: #FCFEFD; }
.stat-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); padding: 2px 0; }
.stat-row b { color: var(--ink); font-variant-numeric: tabular-nums; }
.export-thumb { width: 100%; height: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* 上传弹层 */
.modal.wide { width: min(860px, 100%); }
.up-stage { margin-bottom: 14px; text-align: center; }
.drop-zone {
  border: 2px dashed #CFE3DA; border-radius: 16px; background: var(--green-tint);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 28px; min-height: 220px; text-align: center; cursor: pointer;
}
.drop-zone p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.drop-zone .dz-icon { font-size: 34px; }
.drop-zone.hover { border-color: var(--green); background: var(--green-soft); }
.crop-tip {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  background: rgba(10, 22, 17, .62); color: #fff; font-size: 11px;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none;
}
.crop-wrap { position: relative; background: #101C17; border-radius: 14px; overflow: hidden; display: inline-block; line-height: 0; vertical-align: top; }
#cropCanvas { display: block; max-width: 100%; }
.crop-rect {
  position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
  cursor: move; box-sizing: border-box;
}
.cr-handle { position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 4px; border: 1px solid var(--green); }
.cr-handle.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.cr-handle.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.cr-handle.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.cr-handle.se { right: -7px; bottom: -7px; cursor: nwse-resize; }

.up-options { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 16px; }
.opt-block { min-width: 0; }
.opt-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.opt-label b { color: var(--green-deep); }
.opt-hint { margin-top: 6px; line-height: 1.4; }
.size-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.size-row .input { width: 76px; height: 36px; }
.size-row .x-sign { color: var(--muted); font-size: 13px; }
.size-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.size-presets button {
  height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-2); background: #fff;
}
.size-presets button:hover { border-color: #BFE0D5; }
.size-presets button.on { background: var(--green-soft); border-color: var(--green); color: var(--green-deep); font-weight: 700; }
.toggle-row { display: flex; flex-direction: column; gap: 8px; }
input[type="range"] { width: 100%; accent-color: var(--green); }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.dl-grid { display: grid; gap: 8px; margin-bottom: 8px; }
.dl-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.dl-card:has(input:checked) { border-color: var(--green); background: var(--green-tint); }
.dl-card input { margin-top: 3px; accent-color: var(--green); }
.dl-card b { font-size: 13.5px; }
.dl-card p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.works-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.works-head p { margin: 3px 0 0; }
.works-list { display: grid; gap: 8px; }
.work-item {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 10px;
}
.work-item img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; background: #F4F8F6; }
.work-item .wi-meta { min-width: 0; flex: 1; }
.work-item .wi-meta b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-item .wi-meta span { font-size: 11.5px; color: var(--muted); }
.work-item .wi-btns { display: flex; gap: 6px; }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.more-item {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: left;
  display: flex; flex-direction: column; gap: 2px;
}
.more-item:hover { border-color: #BFE0D5; background: var(--green-tint); }
.more-item b { font-size: 13.5px; }
.more-item span { font-size: 11.5px; color: var(--muted); }

/* 选区操作条 */
.sel-bar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; z-index: 12;
  background: rgba(22, 36, 30, .92); color: #fff; border-radius: 999px;
  padding: 7px 8px 7px 16px; font-size: 12px; box-shadow: var(--shadow-md);
}
.sel-bar span { opacity: .8; }
.sel-bar button {
  height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.14); color: #fff;
}
.sel-bar button:hover { background: rgba(255,255,255,.26); }
.sel-bar button:last-child { background: transparent; color: #B9CCC4; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 42px; transform: translate(-50%, 20px);
  background: #16241E; color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 200;
  max-width: 90vw; text-align: center;
}
.toast.on { opacity: .96; transform: translate(-50%, 0); }

/* 加载遮罩 */
.busy {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 30;
  background: rgba(247, 250, 248, .82); backdrop-filter: blur(2px);
}
.busy.hide { display: none; }
.busy-in { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid #D7E7E0;
  border-top-color: var(--green); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 手机端 */
@media (max-width: 900px) {
  .ed-top { height: 52px; padding: 0 10px; gap: 8px; }
  .ed-brand .brand-name { display: none; }
  .doc-name { width: 110px; font-size: 13px; }
  .ed-actions { margin-left: 0; gap: 2px; overflow-x: auto; }
  .tb-btn span { display: none; }
  .tb-btn { padding: 0 8px; height: 32px; }
  .tb-btn.ghost span { display: none; }
  .ed-right .palette-sel { display: none; }
  .ed-main { height: calc(100vh - 52px - 100px); flex-direction: column-reverse; }
  .rail {
    width: 100%; height: 100px; border-right: 0; border-top: 1px solid var(--line);
    padding: 6px; gap: 2px; flex: none; align-items: stretch;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    display: grid; grid-template-rows: 1fr 1fr; grid-auto-flow: column;
    grid-auto-columns: 60px; justify-content: start; overflow-x: auto; overflow-y: hidden;
  }
  .rail-group, .rail-foot { display: contents; }
  .tool { width: 60px; padding: 4px 0 2px; font-size: 9.5px; gap: 2px; }
  .tool svg { width: 19px; height: 19px; }
  .tool.active { background: var(--green-soft); }
  .color-dot { width: 19px; height: 19px; }
  .stage { padding-bottom: 0; }
  .panel {
    width: 100%; height: 140px; border-left: 0; border-bottom: 1px solid var(--line);
    flex-direction: row; overflow-x: auto; flex: none;
  }
  .panel-sec { min-width: 250px; border-bottom: 0; border-right: 1px solid var(--line); padding: 10px 12px; }
  .panel-sec.grow { min-width: 280px; }
  .panel-stat { min-width: 200px; }
  .export-thumb { display: none; }
  .up-options { grid-template-columns: 1fr; }
  .panel-sec { overflow-y: auto; }
  .iron-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .iron { padding: 5px 6px; }
  .iron .iron-sw { height: 9px; margin-bottom: 2px; }
  .iron span { display: none; }
  .iron b { font-size: 10px; }
  .pal-list { max-height: 74px; }
  .stage-foot .foot-right { display: none; }
  .zoom-ctl { right: 10px; top: 10px; }
}
@media (max-width: 900px) and (max-height: 700px) {
  .panel { height: 118px; }
  .ed-main { height: calc(100vh - 52px - 100px); }
}

/* AI 生图 */
.tb-btn.ai { color: var(--green-deep); background: linear-gradient(180deg, #EAF9F3, #DFF4EC); }
.tb-btn.ai:hover { background: linear-gradient(180deg, #DFF4EC, #D2EFE4); }
.tb-btn.ai svg { color: var(--green); }
.ai-note { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); background: var(--green-tint); border: 1px solid #DCF0E7; border-radius: 10px; padding: 8px 12px; }
.ai-prompt {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font-size: 14px; line-height: 1.6; resize: vertical; outline: none; min-height: 76px;
}
.ai-prompt:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,181,140,.12); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.ai-chips button {
  height: 28px; padding: 0 11px; border-radius: 999px; border: 1px dashed #CBDFD6;
  font-size: 12px; color: var(--ink-2); background: #fff;
}
.ai-chips button:hover { border-style: solid; border-color: var(--green); color: var(--green-deep); background: var(--green-tint); }
.ai-opts { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; }
.ai-opt label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ai-seg { display: inline-flex; background: #F3F7F5; border-radius: 9px; padding: 3px; gap: 2px; }
.ai-seg button { height: 28px; padding: 0 11px; border-radius: 7px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.ai-seg button.on { background: #fff; color: var(--green-deep); font-weight: 700; box-shadow: 0 1px 3px rgba(22,36,30,.12); }
.ai-run { display: flex; align-items: center; gap: 10px; }
.ai-status { font-size: 12px; color: var(--muted); }
.ai-status.err { color: #C2453A; }
.ai-adv { margin-top: 12px; }
.ai-adv summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.ai-adv .input { margin-top: 8px; height: 36px; }
.ai-adv p { margin: 6px 0 0; }
.ai-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
.ai-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.ai-card img { width: 100%; height: auto; display: block; background: #F4F8F6; }
.ai-card .ai-card-btns { display: flex; gap: 6px; padding: 8px; }
.ai-card .ai-card-btns button { flex: 1; height: 30px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.ai-card .go { background: var(--green); color: #fff; }
.ai-card .go:hover { background: var(--green-dark); }
.ai-card .crop { background: #F2F7F5; color: var(--ink-2); border: 1px solid var(--line); }
.ai-card .crop:hover { border-color: #BFE0D5; }
.ai-loading { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px; color: var(--muted); font-size: 12.5px; grid-column: 1 / -1; }

/* ---- 账号胶囊 ---- */
.acc-chip {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 6px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; max-width: 210px;
}
.acc-chip:hover { border-color: #BFE0D5; background: var(--green-tint); }
.acc-ava {
  width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #2FD3A4, #12A981);
  color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none;
}
.acc-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
.acc-txt b { font-size: 11.5px; font-weight: 700; color: var(--ink); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-txt i { font-style: normal; font-size: 10px; color: var(--muted); }

/* ---- 视图标签条 ---- */
.view-bar {
  height: 40px; flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line);
}
.view-tabs { display: inline-flex; background: #F2F7F5; border-radius: 9px; padding: 3px; gap: 2px; }
.view-tabs button {
  height: 28px; padding: 0 14px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 500;
}
.view-tabs button.on { background: #fff; color: var(--green-deep); font-weight: 700; box-shadow: 0 1px 3px rgba(22,36,30,.12); }
.view-right { margin-left: auto; display: flex; gap: 6px; }
.view-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 8px; border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); background: #fff;
}
.view-chip i { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid #C6D5CD; }
.view-chip.on { border-color: var(--green); color: var(--green-deep); background: var(--green-tint); }
.view-chip.on i { background: var(--green); border-color: var(--green); }
.view-chip:hover { border-color: #BFE0D5; }

/* ---- 小贴士 ---- */
.tip-sec { padding: 10px 14px; }
.tip-card {
  display: flex; gap: 8px; align-items: flex-start;
  background: linear-gradient(180deg, #FFFBF1, #FFFDF8);
  border: 1px solid #F5E4C3; border-radius: 10px; padding: 8px 10px;
}
.tip-card b { color: #A9761B; font-size: 11.5px; flex: none; }
.tip-card span { font-size: 11px; color: #8A7442; line-height: 1.5; }

/* ---- 板子设置 ---- */
.mini-link { font-size: 10.5px; color: var(--green-deep); font-weight: 600; background: var(--green-soft); padding: 2px 7px; border-radius: 999px; }
.mini-link:hover { background: #D3EFE4; }
.board-grid { display: flex; gap: 8px; margin-bottom: 7px; }
.board-grid > label { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); flex: 1; }
.input.xsmall { height: 30px; width: 100%; min-width: 0; padding: 0 8px; font-size: 12px; border-radius: 8px; }
.board-cm { display: flex; flex-direction: column; justify-content: center; flex: 1.2; }
.board-cm span { font-size: 10px; color: var(--muted); }
.board-cm b { font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.board-colors { margin: 4px 0 9px; }
.board-colors span { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }
.board-colors b { color: var(--green-deep); }
.board-apply { width: 100%; }

/* ---- 调色板合计 ---- */
.pal-total {
  display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted);
  margin: -2px 0 8px; padding-bottom: 7px; border-bottom: 1px dashed var(--line);
}
.pal-total b { color: var(--ink); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pal-total b:last-child { color: var(--green-deep); }

/* ---- 引导 ---- */
.tour-mask { position: fixed; inset: 0; z-index: 300; background: rgba(12, 24, 19, .55); }
.tour-spot {
  position: absolute; border: 2px solid #2FD3A4; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(12, 24, 19, .55); transition: all .18s ease;
}
.tour-card {
  position: absolute; width: 320px; background: #fff; border-radius: 14px; padding: 16px 18px;
  box-shadow: 0 18px 50px rgba(8, 20, 15, .35);
}
.tour-step { font-size: 10.5px; color: var(--green-deep); font-weight: 700; letter-spacing: .5px; }
.tour-card h4 { margin: 6px 0 6px; font-size: 15px; }
.tour-card p { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.tour-btns { display: flex; align-items: center; justify-content: space-between; }

/* ---- 手机端补充 ---- */
@media (max-width: 900px) {
  .acc-chip { display: none; }
  .view-bar { height: 36px; padding: 0 8px; gap: 6px; overflow-x: auto; }
  .view-tabs button { padding: 0 10px; font-size: 12px; height: 26px; }
  .view-chip { font-size: 10.5px; padding: 0 8px; height: 26px; white-space: nowrap; }
  .ed-main { height: calc(100vh - 52px - 100px - 36px); }
  .tour-card { width: calc(100vw - 40px); }
}

/* 手机端账号行（桌面隐藏） */
.panel-sec.m-acc { display: none; }
@media (max-width: 900px) {
  .panel { height: 156px; flex-direction: column; overflow-y: auto; overflow-x: hidden; }
  .panel-sec { min-width: 0 !important; border-right: 0; border-bottom: 1px solid var(--line); }
  .ed-main { height: calc(100vh - 52px - 100px - 36px); }
  .panel-sec { min-width: 236px; }
  .panel-sec.m-acc {
    display: flex; align-items: center; gap: 8px; order: 0; padding: 7px 12px;
  }
  .panel-sec.m-acc .btn { margin-left: auto; }
  .m-acc-card { display: flex; align-items: center; gap: 7px; min-width: 0; text-align: left; }
  .m-acc-card .acc-txt b { font-size: 12px; max-width: 118px; }
  .tip-sec { display: none; }
  .iron-sec { order: 1; }
  #boardSec { order: 2; }
  .panel-sec.grow { order: 3; }
  .panel-stat { order: 4; }
  .pal-list { max-height: 120px; }
  .view-right { margin-left: 8px; }
  .view-bar { padding-right: 4px; }
  .board-grid { gap: 6px; }
  .board-apply { height: 30px; font-size: 12px; }
}

/* 账号面板 */
.acc-box { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--green-tint); border: 1px solid #DCF0E7; }
.acc-ava.big { width: 46px; height: 46px; border-radius: 50%; font-size: 19px; display: grid; place-items: center; background: linear-gradient(135deg, #2FD3A4, #12A981); color: #fff; font-weight: 700; flex: none; }
.acc-box-txt b { display: block; font-size: 15px; }
.acc-box-txt i { font-style: normal; font-size: 12px; color: var(--muted); }
.acc-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-btns .btn { flex: 1; min-width: 120px; }

/* 背景处理：智能抠图 */
.bg-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.bg-chips button {
  border: 1px solid var(--line, #E3EAE6); background: #fff; color: var(--ink-2, #4A5A52);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.bg-chips button:hover { border-color: var(--green, #1DB58C); color: var(--green-deep, #0E7C5F); }
.bg-chips button.on {
  background: var(--mint, #E8F7F1); border-color: var(--green, #1DB58C);
  color: var(--green-deep, #0E7C5F); font-weight: 700;
}
.cut-wrap { border-top: 1px dashed var(--line, #E3EAE6); padding-top: 10px; }
.cut-slider { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cut-slider input[type=range] { flex: 1; accent-color: var(--green, #1DB58C); }
.cut-preview {
  margin: 8px 0; border-radius: 10px; overflow: hidden; max-height: 190px;
  background: repeating-conic-gradient(#EEF3F0 0 25%, #fff 0 50%) 0 0 / 14px 14px;
  display: flex; flex-direction: column; align-items: center;
}
.cut-preview canvas { display: block; max-width: 100%; max-height: 160px; }
.cut-preview .tiny { padding: 4px 8px; background: rgba(255,255,255,.86); width: 100%; text-align: center; }

/* 账号弹窗：次数 / 豆子 / 邀请 */
.acc-stats { display: flex; gap: 10px; margin: 0 0 14px; }
.acc-stat {
  flex: 1; background: #F3F7F5; border: 1px solid var(--line, #E3EAE6); border-radius: 12px;
  padding: 12px 10px; text-align: center;
}
.acc-stat b { display: block; font-size: 20px; color: var(--green-deep, #0E7C5F); line-height: 1.2; }
.acc-stat span { font-size: 11.5px; color: var(--ink-3, #8A9A92); }
.acc-invite { background: #F8FBFA; border: 1px dashed #CFE3DA; border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.acc-invite-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.acc-link-row { margin-bottom: 10px; }
.acc-link-row .input { flex: 1; font-size: 12px; }
.acc-exchange { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ===== 手机端右侧面板：横向卡片，一次一张，账号行固定在顶部 ===== */
@media (max-width: 900px) {
  .panel {
    position: relative;
    width: 100%;
    height: 198px;
    padding: 42px 0 0;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    border-left: 0;
    border-top: 1px solid var(--line);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    background: #fff;
  }
  .panel-sec {
    flex: none;
    width: 86vw;
    max-width: 480px;
    height: 156px;
    min-width: 0 !important;
    padding: 10px 12px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    overflow-y: auto;
    scroll-snap-align: start;
  }
  .panel-sec.grow,
  .panel-sec.panel-stat { width: 86vw; }
  .panel-sec.m-acc {
    position: absolute;
    top: 0; left: 0; right: 0;
    width: 100%;
    height: 42px;
    padding: 5px 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    border-right: 0;
    z-index: 3;
  }
  .tip-sec { display: none; }
  .pal-list { max-height: 96px; }
  .panel-sec h4, .panel-sec .panel-h { margin-bottom: 6px; }
  .ed-main { height: calc(100vh - 52px - 100px - 36px); }
}
@media (max-width: 420px) {
  .panel { height: 186px; padding-top: 42px; }
  .panel-sec { height: 144px; width: 90vw; }
  .view-chip { display: none; }
  .view-bar { gap: 4px; }
}
@media (max-width: 900px) {
  .panel-sec.grow { flex: none; width: 86vw; max-width: 480px; }
  .panel-sec.m-acc { overflow: hidden; }
  .panel-sec.m-acc .m-acc-card { overflow: hidden; }
}
@media (max-width: 420px) {
  .panel-sec.grow { width: 90vw; }
}
@media (max-width: 900px) {
  /* 手机端卡片顺序：先板子设置，再烫熨、调色板、统计 */
  #boardSec { order: 1; }
  .iron-sec { order: 2; }
  .panel-sec.grow { order: 3; }
  .panel-stat { order: 4; }
  .panel { scroll-padding-left: 0; }
}
@media (max-width: 420px) {
  .ed-top { padding: 0 6px; gap: 4px; }
  .doc-name { width: 86px; font-size: 12px; }
  .ed-actions { gap: 0; }
  .tb-btn { padding: 0 6px; }
  .ed-brand .brand-name { display: none; }
}

/* 手机端：账号行独立于横滑面板 */
@media (max-width: 900px) {
  .ed-main > .panel-sec.m-acc {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    flex: none;
    padding: 6px 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    border-right: 0;
    overflow: hidden;
  }
  .ed-main > .panel-sec.m-acc .btn { margin-left: auto; }
  .panel { height: 156px; padding: 0; }
  .panel-sec { height: 156px; }
}
@media (max-width: 420px) {
  .panel { height: 148px; }
  .panel-sec { height: 148px; }
}
@media (max-width: 900px) {
  .stage-foot { display: none; }
  .stage { padding-bottom: 0; }
}
@media (max-width: 900px) and (max-height: 700px) {
  .panel { height: 120px; }
  .panel-sec { height: 120px; }
  .pal-list { max-height: 70px; }
}
