/* ==========================================================================
 * styles.css —— 设计令牌 / 组件规范 / 视图样式
 * 视觉基调：像素游戏感 × 蓝白简约（工坊工作台）
 * 严格只用本文件的令牌，不在别处发明颜色与字号。
 * ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --primary: #1890FF;
  --primary-hover: #40A9FF;
  --primary-active: #096DD9;
  --primary-soft: #E6F4FF;
  --primary-line: #BFDBFE;

  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --surface-3: #F1F5F9;

  --border: #E5E9F0;
  --border-strong: #D6DEE9;

  --text: #1F2933;
  --text-sub: #6B7280;
  --text-mute: #9AA4B2;

  --success: #52C41A;
  --warning: #FAAD14;
  --danger: #FF4D4F;

  --font-display: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --sh-sm: 0 1px 2px rgba(31, 41, 51, .06);
  --sh-md: 0 6px 16px -6px rgba(31, 41, 51, .14);
  --sh-lg: 0 16px 40px -12px rgba(24, 60, 110, .22);

  --sp: 4px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --t: .14s ease-out;
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% -12%, rgba(24, 144, 255, .12), transparent 44%),
    radial-gradient(circle at 92% -6%, rgba(143, 203, 238, .18), transparent 40%),
    radial-gradient(rgba(31, 41, 51, .06) 1px, transparent 1.3px);
  background-size: auto, auto, 8px 8px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--text);
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
canvas { display: block; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.icon { width: 18px; height: 18px; flex: none; stroke-width: 1.75; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 22px; height: 22px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- 3. 顶栏 / 导航（App Shell，四个视图共用，勿改） ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
/* 顶栏容器比正文（1180px）更宽：这一行元素多（副标题 + 5 个导航 + 2 个计数 + 账号区），
   需要约 1320px 才排得下；再加 flex-wrap，窗口不够宽时自动换到第二行，
   保证所有元素 1:1 原尺寸完整显示，绝不裁切、也不缩小字号。 */
.topbar__inner {
  max-width: 1520px;
  margin: 0 auto;
  padding: 10px 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  row-gap: 8px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand__logo { width: 40px; height: 40px; flex: none; object-fit: contain; border-radius: 9px; }
.brand__name { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: .04em; line-height: 1.3; }
/* 副标题是中文长句（定制署名），去掉等宽字体的拉丁字距、压紧一点并禁止换行 */
.brand__sub {
  display: block;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: .01em;
  line-height: 1.4;
  color: var(--text-mute);
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { height: 0; }
.nav__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r-md);
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--t), color var(--t);
}
.nav__item:hover { background: var(--surface-3); color: var(--text); }
.nav__item.is-active { background: var(--primary-soft); color: var(--primary); }
.nav__item.is-active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -13px;
  height: 2px; border-radius: 2px;
  background: var(--primary);
}
.topbar__meta { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.meta-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12.5px; color: var(--text-sub);
}
.meta-pill b { font-family: var(--font-mono); color: var(--primary); font-size: 13px; }

/* ---------- 4. 按钮 / 输入 / 开关 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t), transform .1s ease-out, box-shadow var(--t);
}
.btn:not(:disabled):hover { background: #F3F8FF; border-color: var(--primary-line); color: var(--primary); }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid rgba(24, 144, 255, .4); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:not(:disabled):hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn--primary:not(:disabled):active { background: var(--primary-active); border-color: var(--primary-active); }

.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:not(:disabled):hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn--ghost.is-on { background: var(--primary-soft); color: var(--primary); }

.btn--danger { color: var(--danger); border-color: #FFD3D3; }
.btn--danger:not(:disabled):hover { background: #FFF1F0; border-color: #FFB3B3; color: var(--danger); }

/* 保存合规模板式按钮：白底 + 灰边 + 深字 */
.btn--quiet { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn--quiet:not(:disabled):hover { background: #F3F8FF; border-color: var(--primary-line); color: var(--primary); }
/* 选中态（如「用推荐」按钮处于自动识别模式） */
.btn--quiet.is-on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn--lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn--block { width: 100%; }

.input, .select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 14px;
  width: 100%;
  transition: border-color var(--t), box-shadow var(--t);
}
.input::placeholder { color: var(--text-mute); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24, 144, 255, .16);
}
.search { position: relative; flex: 1 1 220px; max-width: 300px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-mute); pointer-events: none; }
.search .input { padding-left: 38px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--text-sub); }
.field__err { font-size: 12px; color: var(--danger); min-height: 16px; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 38px; height: 22px; flex: none;
  border-radius: var(--r-pill);
  background: #D8DEE8;
  position: relative;
  transition: background var(--t);
}
.switch__track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 41, 51, .28);
  transition: transform .18s var(--ease);
}
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px rgba(24, 144, 255, .25); }
.switch__label { font-size: 13.5px; font-weight: 600; color: var(--text-sub); }

/* ---------- 5. 面板 / 卡片 / 标签 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}
.panel + .panel { margin-top: 20px; }
.panel__hd {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.panel__hd .icon { color: var(--primary); }
.panel__title { font-family: var(--font-display); font-size: 14.5px; font-weight: 700; }
.panel__hd-sub { margin-left: auto; font-size: 12px; color: var(--text-mute); }
.panel__bd { padding: 16px; }
.panel__hint { padding: 10px 16px 14px; font-size: 12.5px; line-height: 1.7; color: var(--text-sub); border-top: 1px dashed var(--border); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 11.5px; font-weight: 600; color: var(--text-sub);
}
.tag--hot { background: #FFF7E6; border-color: #FFE2A8; color: #B47500; }
.tag--easy { background: #F6FFED; border-color: #C8EBA5; color: #3F8A0E; }
.tag--mid { background: #FFF7E6; border-color: #FFE2A8; color: #B47500; }
.tag--blue { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 13px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--text-sub);
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.chip:not(:disabled):hover { border-color: var(--primary-line); color: var(--primary); background: #F7FBFF; }
.chip.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip:disabled { opacity: .45; cursor: not-allowed; }

/* 颜色数范围滑杆 */
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1 1 auto; min-width: 0; accent-color: var(--primary); cursor: pointer; }
.range-val {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-sub);
  white-space: nowrap; min-width: 52px; text-align: right;
}
.range-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; font-size: 12.5px; color: var(--text-mute);
}

/* ---------- 6. 图纸库 ---------- */
.page-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; padding: 32px 0 20px; }
.page-head__title { font-size: 27px; line-height: 1.2; }
.page-head__desc { margin-top: 8px; font-size: 13.5px; color: var(--text-sub); max-width: 560px; }
.page-head__side { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 20px;
  padding-bottom: 48px;
}

.pcard {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  animation: fadeUp .5s var(--ease) both;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--primary-line); }
.pcard__art {
  position: relative;
  display: grid; place-items: center;
  padding: 16px;
  background: linear-gradient(160deg, #F8FBFF, #EDF4FC);
  border-bottom: 1px dashed var(--border);
}
.pcard__art::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(24, 144, 255, .10) 1px, transparent 1.2px);
  background-size: 10px 10px;
}
.pcard__art canvas { position: relative; z-index: 1; }
.pcard__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.pcard__row { display: flex; align-items: center; gap: 8px; }
.pcard__title { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; }
.pcard__desc { font-size: 12.5px; line-height: 1.65; color: var(--text-sub); min-height: 40px; }
.pcard__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--text-sub); }
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.meta-item .icon { color: var(--text-mute); }
.pcard__foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.pcard__foot .btn { flex: 1; }

.fav {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; flex: none;
  margin-left: auto;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text-mute);
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.fav:hover { color: #FF7A9A; border-color: #FFD3DE; background: #FFF5F8; }
.fav.is-on { color: #FF4D6D; border-color: #FFD3DE; background: #FFF1F5; }

/* ---------- 7. 骨架 / 空状态 ---------- */
.sk {
  position: relative;
  background: #EAEEF3;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.sk::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .75) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}
.sk-card { height: 268px; border-radius: var(--r-lg); border: 1px solid var(--border); }
.sk-art { height: 132px; margin: 16px; border-radius: var(--r-md); }

.empty {
  display: grid; place-items: center; gap: 10px;
  padding: 56px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .6);
}
.empty__icon {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  background: var(--surface-3);
  color: var(--text-mute);
}
.empty__title { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; }
.empty__desc { font-size: 13px; color: var(--text-sub); max-width: 380px; }

/* ---------- 8. 创作台 ---------- */
.wb {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 300px;
  grid-template-areas: "ref board stat";
  gap: 20px;
  align-items: start;
  padding: 24px 0 56px;
}
.wb__ref { grid-area: ref; }
.wb__board { grid-area: board; min-width: 0; }
.wb__stat { grid-area: stat; }

.ref-preview {
  display: grid; place-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, #F8FBFF, #EEF5FC);
}
.ref-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: 12.5px; color: var(--text-sub); }

.checklist { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.cl-item {
  display: grid;
  grid-template-columns: 18px 18px minmax(0, 1fr) auto;
  align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  transition: background var(--t), border-color var(--t), opacity var(--t);
}
.cl-item:hover { border-color: var(--primary-line); background: #F7FBFF; }
.cl-item input { margin: 0; accent-color: var(--primary); width: 15px; height: 15px; }
.cl-item.is-off { opacity: .48; }
.cl-swatch { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(31, 41, 51, .16); }
.cl-name { font-size: 13px; font-weight: 600; }
.cl-code { font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); margin-left: 6px; }
.cl-count { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-sub); }
.cl-count b { color: var(--primary); }
.cl-count.is-done b { color: var(--success); }

/* 图片生成的图纸可能用到上百种色，配色清单过长就在面板内滚动 */
#colorList { max-height: 420px; overflow-y: auto; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.toolbar__group { display: flex; gap: 6px; padding-right: 10px; border-right: 1px dashed var(--border); }
.toolbar__group:last-child { border-right: 0; padding-right: 0; }
.toolbar__spacer { flex: 1; }
.tool {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text-sub);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.tool:not(:disabled):hover { border-color: var(--primary-line); color: var(--primary); background: #F7FBFF; }
.tool.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.tool:disabled { opacity: .45; cursor: not-allowed; }
.tool:focus-visible { outline: 2px solid rgba(24, 144, 255, .4); outline-offset: 1px; }

/* 大底板（52/78/104 格 × 32px）会远宽于容器：flex + margin:auto 居中，
   溢出时 margin 归零、内容从左上角开始，配合 overflow:auto 保证任何一格都滚得到。
   max-height 让超大底板在面板内滚动，不至于把整页撑成几千像素高（内置小图纸不会触发滚动）。
   padding 必须为 0：canvas 用 position:sticky 贴在滚动口左上角（sticky 的贴合矩形含 padding，
   一旦有 padding 画布就会与底板坐标错位，落豆点不准）。 */
.board-scroll { overflow: auto; padding: 0; display: flex; max-height: 620px; }
/* 占位层：尺寸 = 整张底板（由 _syncView 写内联宽高），负责撑出滚动条并承载圆角与投影 */
.board-stage { position: relative; flex: none; margin: auto; border-radius: 12px; box-shadow: var(--sh-sm); }
/* 画布只做「滚动窗口那么大」：钉在滚动口左上角，随滚动改变绘制偏移，
   于是不管放大到多少格宽，画布像素量永远只有一屏，能一直按满设备像素比渲染（清晰不糊） */
.board-canvas { position: sticky; top: 0; left: 0; display: block; touch-action: none; cursor: crosshair; }
.board-canvas.is-erase { cursor: cell; }
.board-canvas.is-pick { cursor: copy; }

/* 底板探色读数：鼠标划到哪一格，就显示这一格该放什么颜色（空白格也能读） */
.board-probe {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
}
.board-probe__pos { color: var(--text-sub); font-size: 12.5px; min-width: 122px; }
.board-probe__need { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.board-probe__need i { font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--text-mute); }
.probe-need { font-weight: 500; font-size: 12px; color: var(--text-sub); }
.probe-dot {
  width: 18px; height: 18px; border-radius: 6px;
  border: 1px solid rgba(31, 41, 51, .2);
}
.probe-empty { color: var(--text-mute); font-weight: 400; }
.board-probe__state { margin-left: auto; font-size: 12.5px; color: var(--text-mute); }
.board-probe__state.is-ok { color: var(--success); font-weight: 700; }
.board-probe__state.is-warn { color: var(--danger); font-weight: 700; }
.board-probe__state.is-extra { color: var(--primary); font-weight: 700; }

.progress { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.progress__track { flex: 1; height: 10px; border-radius: var(--r-pill); background: #EAEEF3; overflow: hidden; }
.progress__fill {
  height: 100%; width: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--primary), #69C0FF);
  transition: width .22s var(--ease);
}
.progress__fill.is-full { background: linear-gradient(90deg, var(--success), #95DE64); }
.progress__text { font-family: var(--font-mono); font-size: 13px; color: var(--text-sub); min-width: 108px; text-align: right; }

.hint-tip {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
  background: #F7FBFF;
  font-size: 13px; color: var(--text-sub);
}
.hint-tip .icon { color: var(--primary); }
.hint-tip b { color: var(--primary); font-family: var(--font-mono); }

.stat-big { display: flex; align-items: center; gap: 14px; }
.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring__value {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 19px; font-weight: 700; color: var(--primary);
}
.ring__value small { font-size: 11px; margin-left: 1px; color: var(--text-mute); }
.stat-big__label { font-size: 13px; color: var(--text-sub); }
.stat-big__num { font-family: var(--font-mono); font-size: 22px; font-weight: 700; }

.stat-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.stat-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.stat-row__label { color: var(--text-sub); display: inline-flex; align-items: center; gap: 6px; }
.stat-row__val { margin-left: auto; font-family: var(--font-mono); font-weight: 700; }

.cur-color { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--primary-line); border-radius: var(--r-md); background: #F7FBFF; }
.cur-color__swatch { width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(31, 41, 51, .18); }
.cur-color__name { font-size: 13px; font-weight: 700; }
.cur-color__code { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-mute); }

/* 调色板筛选：搜索框 + 色系快筛 chips，199 色里快速定位目标色 */
.pal-filter { margin-top: 12px; }
.pal-filter__search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
}
.pal-filter__search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.pal-filter__search .icon { color: var(--text-mute); flex: none; }
.pal-filter__search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 13.5px; color: var(--text);
}
.pal-filter__search input::placeholder { color: var(--text-mute); }
.pal-filter__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pal-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text-sub);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.pal-chip span { font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); font-weight: 500; }
.pal-chip:hover { border-color: var(--primary-line); color: var(--primary); }
.pal-chip.is-active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.pal-chip.is-active span { color: var(--primary); }
.pal-chip:focus-visible { outline: 2px solid rgba(24, 144, 255, .4); outline-offset: 1px; }

/* 199 个色块按色相排列，超过可视高度就在面板内滚动，避免把页面撑得过长 */
.palette {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  margin-top: 12px;
  max-height: 300px; overflow-y: auto; padding-right: 4px;
  overscroll-behavior: contain;
}
.palette__empty {
  grid-column: 1 / -1;
  padding: 26px 12px; text-align: center;
  color: var(--text-mute); font-size: 13px;
}
.palette__swatch {
  position: relative;
  height: 34px;
  border: 1px solid rgba(31, 41, 51, .16);
  border-radius: 9px;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
}
.palette__swatch:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.palette__swatch.is-active { box-shadow: 0 0 0 2px var(--primary); }
.palette__swatch:focus-visible { outline: 2px solid rgba(24, 144, 255, .45); outline-offset: 2px; }

/* ---------- 9. 熨烫定型 ---------- */
.iron { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; padding: 24px 0 56px; }
.iron__stage {
  position: relative;
  display: grid; place-items: center;
  min-height: 460px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #F4F8FD, #E7EFF9);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.iron__stage::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(24, 144, 255, .1) 1px, transparent 1.2px);
  background-size: 12px 12px;
}
.iron__canvas { position: relative; z-index: 1; border-radius: 12px; }
.iron__glow {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 230px; height: 230px; margin: -115px 0 0 -115px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 173, 20, .5), rgba(250, 173, 20, 0) 68%);
  filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease-out;
}
.iron__glow.is-on { opacity: 1; }
.iron__tool {
  position: absolute; left: 50%; top: 50%; z-index: 3;
  width: 96px; height: 96px; margin: -48px 0 0 -48px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease-out;
}
.iron__tool.is-on { opacity: 1; }
.iron__badge {
  position: absolute; top: 18px; left: 20px; z-index: 4;
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text-sub);
}

.steps { display: flex; align-items: flex-start; gap: 0; margin: 4px 0 18px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; }
.step__dot {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface); color: var(--text-mute);
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  z-index: 1;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.step__label { font-size: 12px; color: var(--text-mute); text-align: center; }
.step::before {
  content: "";
  position: absolute; top: 13px; left: 0; right: 50%;
  height: 2px; background: var(--border-strong);
}
.step::after {
  content: "";
  position: absolute; top: 13px; left: 50%; right: 0;
  height: 2px; background: var(--border-strong);
}
.step:first-child::before, .step:last-child::after { display: none; }
.step.is-done .step__dot { background: var(--success); border-color: var(--success); color: #fff; }
.step.is-done .step__label { color: var(--text-sub); }
.step.is-active .step__dot { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(24, 144, 255, .18); }
.step.is-active .step__label { color: var(--primary); font-weight: 700; }

.temp { padding: 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.temp__row { display: flex; align-items: center; gap: 12px; }
.temp__value { font-family: var(--font-mono); font-size: 24px; font-weight: 700; color: var(--primary); min-width: 92px; text-align: right; }
.temp__value small { font-size: 13px; color: var(--text-sub); margin-left: 3px; }
.temp__guide { margin-top: 10px; font-size: 12.5px; line-height: 1.7; color: var(--text-sub); }
.temp__guide.is-warn { color: #B47500; }
.temp__band { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); margin-top: 6px; }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
.range:focus-visible { outline: 2px solid rgba(24, 144, 255, .4); outline-offset: 2px; border-radius: 8px; }
.range::-webkit-slider-runnable-track {
  height: 8px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, #8FCBEE 0%, var(--primary) 45%, var(--warning) 100%);
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -6px;
  border-radius: 50%; border: 3px solid #fff;
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(24, 144, 255, .5);
}
.range::-moz-range-track { height: 8px; border-radius: var(--r-pill); background: #D8DEE8; }
.range::-moz-range-thumb { width: 16px; height: 16px; border: 3px solid #fff; border-radius: 50%; background: var(--primary); }
.range:disabled { opacity: .5; cursor: not-allowed; }

.iron-progress { margin-top: 16px; }
.iron-timer {
  display: flex; align-items: baseline; gap: 8px;
  font-family: var(--font-mono); font-size: 34px; font-weight: 700; color: var(--text);
  letter-spacing: .01em;
}
.iron-timer small { font-size: 13px; color: var(--text-sub); font-weight: 400; }

.tips { display: flex; flex-direction: column; gap: 10px; }
.tip-item { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.7; color: var(--text-sub); }
.tip-item .icon { color: var(--primary); margin-top: 2px; }
.tip-item b { color: var(--text); }

/* ---------- 10. 我的作品 ---------- */
.gcard {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  animation: fadeUp .5s var(--ease) both;
}
.gcard:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--primary-line); }
.gcard__art {
  position: relative;
  display: grid; place-items: center;
  padding: 16px;
  min-height: 170px;
  background: linear-gradient(160deg, #FBFDFF, #EFF5FC);
  border-bottom: 1px solid var(--border);
}
.gcard__art canvas { position: relative; z-index: 1; }
.gcard__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.gcard__title { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.gcard__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--text-sub); }
.gcard__foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.gcard__foot .owner { font-size: 12px; color: var(--text-mute); margin-left: auto; }

.wd { display: grid; gap: 18px; }
.wd__art {
  display: grid; place-items: center; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: linear-gradient(160deg, #FBFDFF, #EFF5FC);
}
.wd__rows { display: flex; flex-direction: column; gap: 0; }
.wd__row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.wd__row:last-child { border-bottom: 0; }
.wd__label { width: 78px; flex: none; color: var(--text-sub); }
.wd__val { font-weight: 600; }
.wd__val.mono { font-family: var(--font-mono); }

/* ---------- 11. 弹窗 / Toast ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(3px);
  animation: fadeIn .18s ease-out;
}
.modal__panel {
  width: min(520px, 100%);
  max-height: 88vh; overflow: auto;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  animation: modalIn .24s var(--ease) both;
}
.modal__hd { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal__title { font-family: var(--font-display); font-size: 16px; font-weight: 700; flex: 1; }
.modal__bd { padding: 20px; }
.modal__ft { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal__x {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-mute);
  cursor: pointer;
}
.modal__x:hover { background: var(--surface-3); color: var(--text); }

.toast-wrap { position: fixed; top: 78px; right: 24px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 230px; max-width: 340px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-md);
  font-size: 13.5px;
  animation: toastIn .26s var(--ease) both;
}
.toast.is-out { animation: toastOut .2s ease-in forwards; }
.toast .icon { flex: none; }
.toast--ok .icon { color: var(--success); }
.toast--warn .icon { color: var(--warning); }
.toast--err .icon { color: var(--danger); }
.toast--info .icon { color: var(--primary); }

/* ---------- 12. 视图切换与动效 ---------- */
.view { display: none; }
.view.is-active { display: block; }
.reveal { animation: fadeUp .52s var(--ease) both; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }

.spin { animation: spin .9s linear infinite; }

/* ---------- 13. 响应式 ---------- */
@media (max-width: 1120px) {
  .wb { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "board stat" "ref ref"; }
  .iron { grid-template-columns: minmax(0, 1fr); }
  .iron__stage { min-height: 400px; }
}
@media (max-width: 820px) {
  .topbar__inner { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .topbar__meta { margin-left: 0; width: 100%; }
  .nav { width: 100%; }
  .nav__item { height: 36px; }
  .nav__item.is-active::after { bottom: -6px; }
  .wrap { padding: 0 16px; }
  .wb { grid-template-columns: minmax(0, 1fr); grid-template-areas: "board" "stat" "ref"; }
  .page-head__title { font-size: 22px; }
  .page-head { padding: 22px 0 16px; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
  .toast-wrap { left: 16px; right: 16px; top: auto; bottom: 16px; }
  .toast { max-width: none; }
  .palette { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- 14. 图片转图纸 ---------- */
.convert {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding-bottom: 56px;
}
.convert__side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.convert__main { min-width: 0; }

/* 上传拖拽区 */
.uploader {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 26px 18px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: #FBFDFF;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--t), background var(--t);
}
.uploader:hover { border-color: var(--primary-line); background: #F5FAFF; }
.uploader.is-over { border-color: var(--primary); background: var(--primary-soft); }
.uploader__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
}
.uploader__title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.uploader__desc { font-size: 12px; color: var(--text-mute); }

/* 原图 / 图纸 对照 */
.convert__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.convert__fig {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: linear-gradient(160deg, #FBFDFF, #EFF5FC);
}
.convert__fig figcaption { font-size: 12px; color: var(--text-sub); }
.convert__fig canvas { border-radius: 10px; }

.convert__colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-sub);
  /* 自动识别后可能用到上百种色，超出高度就在面板内滚动 */
  max-height: 160px;
  overflow-y: auto;
  padding-right: 4px;
}
.cv-color { display: inline-flex; align-items: center; gap: 5px; }
.cv-color i { width: 12px; height: 12px; border-radius: 4px; border: 1px solid rgba(31, 41, 51, .16); }

.convert__acts {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.convert__stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-sub); }
.convert__btns { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }

/* 我的图纸列表 */
.cv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.cv-item + .cv-item { margin-top: 8px; }
.cv-item__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cv-item__name {
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cv-item__meta { font-size: 11.5px; color: var(--text-mute); }
.cv-item__del {
  margin-left: auto;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-mute);
  cursor: pointer;
  transition: color var(--t), border-color var(--t), background var(--t);
}
.cv-item__del:hover { color: var(--danger); border-color: #FFD3D3; background: #FFF1F0; }
.cv-empty { font-size: 12.5px; color: var(--text-mute); line-height: 1.8; }

/* 参数区内相邻字段留出间距（panel__bd 是纯 block 布局，默认无间距） */
#view-convert .panel__bd .field + .field,
#view-convert .panel__bd .field + .switch { margin-top: 16px; }

@media (max-width: 1080px) {
  .convert { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .convert__pair { grid-template-columns: minmax(0, 1fr); }
  .convert__btns { margin-left: 0; width: 100%; }
  .convert__btns .btn { flex: 1 1 auto; }
}

/* ==========================================================================
 * 顶栏用户区 + 登录注册弹窗
 * ========================================================================== */
.userbox { display: flex; align-items: center; gap: 10px; }
.userbox__name {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--primary-line);
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px; font-weight: 600;
  max-width: 200px;
}
.userbox__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox__hint {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-sub);
  font-size: 12.5px; font-weight: 600;
}

.auth { display: flex; flex-direction: column; gap: 0; }
.auth__tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth .field + .field { margin-top: 16px; }
.auth__err {
  min-height: 18px; margin: 12px 0 0;
  font-size: 12.5px; color: var(--danger);
}
.auth__tip {
  margin: 4px 0 0;
  font-size: 12px; line-height: 1.8; color: var(--text-mute);
}

/* ==========================================================================
 * 15. 手机 / 平板自适应增强
 * 原则：小屏一律「重排 + 换行」，不缩小字号、不隐藏任何元素；
 *      触屏设备把点击热区放大到 ≥40px，避免误触。
 * ========================================================================== */
html { -webkit-text-size-adjust: 100%; }
.board-canvas.is-pan { cursor: grab; }
.board-canvas.is-pan:active { cursor: grabbing; }

/* ---------- iPad 竖屏 / 小笔记本 ---------- */
@media (max-width: 1024px) {
  .wrap { padding: 0 18px; }
  .page-head { padding: 26px 0 18px; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .palette { grid-template-columns: repeat(6, 1fr); }
  #colorList { max-height: 320px; }
}

/* ---------- 手机横屏 / iPad 竖屏 ---------- */
@media (max-width: 820px) {
  /* 顶栏：导航、账号区各自整行；元素宁可换行，也不缩小、不隐藏 */
  .topbar__inner { padding: 10px 14px; gap: 8px 10px; }
  .nav { width: 100%; flex-wrap: wrap; overflow: visible; row-gap: 4px; }
  .nav__item { height: 36px; padding: 0 11px; }
  .nav__item.is-active::after { bottom: 2px; }
  .topbar__meta { width: 100%; margin-left: 0; flex-wrap: wrap; }

  .wrap { padding: 0 14px; }
  .page-head { padding: 20px 0 14px; gap: 12px; }
  .page-head__side { margin-left: 0; }

  /* 输入控件字号 16px 起：iOS 聚焦小于 16px 的输入框会把整页放大 */
  .input, .select { height: 44px; font-size: 16px; }
  .pal-filter__search { height: 44px; }
  .pal-filter__search input { font-size: 16px; }
  .search { flex: 1 1 100%; max-width: none; }

  /* 创作台：底板 → 统计 → 参考 单列堆叠 */
  .wb { grid-template-columns: minmax(0, 1fr); grid-template-areas: "board" "stat" "ref"; gap: 16px; padding: 18px 0 40px; }
  .board-scroll { max-height: 62vh; overscroll-behavior: contain; }
  .board-probe { flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px; }
  .board-probe__pos { min-width: 0; }
  .board-probe__state { margin-left: 0; }
  .toolbar { gap: 8px; padding: 10px 12px; }
  .toolbar__group { padding-right: 8px; }
  #colorList { max-height: 260px; }
  .palette { grid-template-columns: repeat(6, 1fr); max-height: 260px; }

  /* 图纸库：窄屏卡片自动收成更小的栅格 */
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .pcard__art { padding: 10px; }

  /* 熨烫台：舞台内的画布随宽度等比缩放
     （画布宽高由 JS 写成内联样式，内联优先，所以高度必须 !important 才压得住） */
  .iron__stage { padding: 18px; min-height: 340px; }
  .iron__canvas { max-width: 100%; height: auto !important; }
  .steps .step__label { font-size: 11px; }

  .modal { padding: 12px; }
}

/* ---------- 手机竖屏 ---------- */
@media (max-width: 560px) {
  .wrap { padding: 0 12px; }
  .page-head__title { font-size: 21px; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
  .pcard__title { font-size: 15px; }
  .pcard__foot { flex-wrap: wrap; }

  .panel__bd { padding: 14px; }
  .palette { grid-template-columns: repeat(5, 1fr); }
  .filters { gap: 10px; }
  .chips { gap: 6px; }

  .modal__panel { width: 100%; max-height: 92vh; border-radius: 14px; }
  .modal__hd, .modal__ft { padding-left: 14px; padding-right: 14px; }
  .modal__bd { padding: 14px; }
  .modal__ft { flex-wrap: wrap; }
  .modal__ft .btn { flex: 1 1 auto; }

  .iron__stage { min-height: 300px; padding: 14px; }
  .iron__glow { width: 150px; height: 150px; margin: -75px 0 0 -75px; }
  .iron__tool { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
  .iron-timer { font-size: 28px; }
  .temp__value { font-size: 20px; min-width: 76px; }
  .progress { flex-wrap: wrap; }
  .progress__text { min-width: 0; }
  .convert__fig { padding: 10px; }
  .wd__row { flex-wrap: wrap; gap: 4px 12px; }
}

/* ---------- 触屏设备：放大点击热区、去掉点击时的灰色高亮 ---------- */
@media (hover: none) and (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  .tool { height: 40px; }
  .btn { height: 44px; }
  .btn--sm { height: 38px; }
  .chip { height: 38px; }
  .pal-chip { height: 34px; }
  .nav__item { height: 40px; }
  .fav { width: 40px; height: 40px; }
  .modal__x { width: 40px; height: 40px; }
  .cv-item__del { width: 38px; height: 38px; }
  .palette__swatch { height: 42px; }
  .switch__track { width: 46px; height: 26px; }
  .switch__track::after { width: 22px; height: 22px; }
  .switch input:checked + .switch__track::after { transform: translateX(20px); }
}

/* ==========================================================================
 * 16. 全屏看图（创作台底板）
 * 底板铺满整个窗口，把左右两侧面板让出的空间全部给图纸；
 * 底部常驻一条可横向滚动的色条，全屏时不用退出去也能换色。
 * ========================================================================== */
body.is-fullview { overflow: hidden; }

.wb__board.is-full {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: var(--bg);
  overflow: hidden;
}
/* 面板在这一刻变成「上工具栏 / 中底板 / 下色条」的竖向三段式 */
.wb__board.is-full > .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.wb__board.is-full .panel__hd,
.wb__board.is-full .toolbar,
.wb__board.is-full .board-probe,
.wb__board.is-full .progress,
.wb__board.is-full .hint-tip,
.wb__board.is-full .fullbar { flex: none; }
/* 底板区吃掉全部剩余高度（flex 子项必须 min-height:0 才允许被压缩到内容以下） */
.wb__board.is-full .board-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

/* ---------- 底部色条 ---------- */
.fullbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.wb__board.is-full .fullbar { display: flex; }

.fullbar__cur {
  display: inline-flex; align-items: center; gap: 7px;
  flex: none;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--primary-line);
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  max-width: 190px;
}
.fullbar__cur:empty { display: none; }
.fullbar__cur i { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 1px solid rgba(31, 41, 51, .18); }
.fullbar__cur b { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fullbar__cur em { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--primary); flex: none; }

/* 色条基准宽度必须是固定值，不能用 auto：它装着两百多个色号（几千 px），
   一旦用 auto，换行时它会按内容宽度判定「放不下」而独自霸占一整行。
   设成 140px 后：够宽时它照样 grow 铺满剩余空间，不够宽时才会被折行。 */
.fullbar__list {
  flex: 1 1 140px; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  padding: 3px 2px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.fullsw {
  flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 3px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.fullsw i { width: 32px; height: 24px; border-radius: 7px; border: 1px solid rgba(31, 41, 51, .16); }
.fullsw b { font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--text-mute); }
.fullsw:hover { background: var(--surface-3); }
.fullsw.is-active { border-color: var(--primary); background: var(--primary-soft); }
.fullsw.is-active b { color: var(--primary); }
.fullsw__sep { flex: none; width: 1px; align-self: stretch; margin: 6px 3px; background: var(--border-strong); }

/* ---------- 全屏「显示」设置：底板底色 / 提示色号文字颜色 ----------
   小巧圆点，点一下就换。宽度不够时整组换到下一行（见下方 1080 断点），
   绝不与色条平分收缩 —— 色条天生可滚动，显示设置必须完整露出 */
.fullbar__opts {
  display: flex; align-items: center; gap: 10px;
  flex: none; min-width: 0;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px 0;
  scrollbar-width: none;
}
.fullbar__opts::-webkit-scrollbar { height: 0; }
.optgroup { display: flex; align-items: center; gap: 4px; flex: none; }
.optgroup__lb { font-size: 12px; font-weight: 600; color: var(--text-sub); white-space: nowrap; margin-right: 2px; }
.optgroup__row { display: flex; align-items: center; gap: 2px; }
.optchip {
  flex: none; width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: none; cursor: pointer;
}
.optchip i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(31, 41, 51, .2); }
.optchip:hover i { border-color: var(--primary); }
.optchip.is-active i { border-color: var(--primary); box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--primary); }

/* 宽度不够同时并排放下「色条 + 显示设置」时，把显示设置整组挪到自己一行：
   色条本来就能横向滚动，让它让位，选项才不会被挤成 0 宽而看不见 */
@media (max-width: 1080px) {
  .fullbar { flex-wrap: wrap; row-gap: 4px; }
  .fullbar__opts { order: 4; flex: 1 1 100%; }
}
@media (max-width: 820px) {
  /* 平板 / 手机竖向空间紧，全屏下把说明文案收起来，高度全让给图纸 */
  .wb__board.is-full .hint-tip { display: none; }
  .fullbar { gap: 8px; padding: 8px 12px; flex-wrap: wrap; row-gap: 4px; }
  .fullbar__cur { max-width: 130px; }
}
@media (max-width: 560px) {
  /* 色条换到第二行独占整宽，退全屏按钮与当前色留在第一行 */
  .fullbar { flex-wrap: wrap; row-gap: 6px; }
  .fullbar__list { order: 3; flex: 1 1 100%; }
  /* 手机上「底色 / 提示字」两组横着排不下（触屏圆点更大），允许组内再折行，
     保证每个选项都直接看得见、不用横向滑动去找 */
  .fullbar__opts { flex-wrap: wrap; row-gap: 2px; }
  .fullsw i { width: 30px; height: 22px; }
}
@media (hover: none) and (pointer: coarse) {
  .fullsw { padding: 6px 5px; }
  .fullsw i { width: 34px; height: 26px; }
  .fullsw b { font-size: 10.5px; }
  .optchip { width: 40px; height: 40px; }
  .optchip i { width: 26px; height: 26px; }
}
