/* =============================================================
   艺格拼豆 · 组件与页面样式
   ============================================================= */

/* -------------------------------------------------------------
   1. 顶栏
   ------------------------------------------------------------- */
/* 图片占位波纹只用于尚未就绪的图片区。 */
.loading-shimmer { position: relative; isolation: isolate; overflow: hidden; }
.loading-shimmer::before {
  content: ''; position: absolute; z-index: 0; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 19%, rgba(255,255,255,.08) 24%, rgba(255,255,255,.52) 30%, rgba(255,255,255,.18) 36%, transparent 42%),
    linear-gradient(90deg, transparent 0 47%, rgba(255,255,255,.05) 52%, rgba(255,255,255,.30) 57%, rgba(255,255,255,.10) 62%, transparent 68%),
    linear-gradient(90deg, transparent 0 74%, rgba(255,255,255,.04) 79%, rgba(255,255,255,.20) 84%, transparent 90%);
  transform: translate3d(-100%, 0, 0) skewX(-12deg);
  animation: loading-wave 1.8s ease-in-out infinite;
}
.loading-shimmer > * { position: relative; z-index: 1; }
@keyframes loading-wave {
  to { transform: translate3d(100%, 0, 0) skewX(-12deg); }
}
/* 局部操作等待仍可显示转圈，不占用内容位置。 */
.loading-spinner {
  flex: none; width: 15px; height: 15px; border: 2px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-right-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
}
.image-loading-label { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1); }
@media (prefers-reduced-motion: reduce) {
  .loading-shimmer::before, .loading-spinner { animation: none; }
  .hp-loader-grid i { animation: none; opacity: .6; transform: none; }
}
.inline-icon { display: inline-block !important; vertical-align: middle; }
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-t);
}
.nav-inner {
  max-width: var(--page-max); margin: 0 auto;
  height: var(--nav-h); padding: 0 var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-2);
}
:root[data-device="pc"] .nav-inner { max-width: 1100px; }
.nav-settings-inner { justify-content: flex-start; gap: var(--sp-3); }
.nav-settings-back {
  width: 44px; height: 44px; flex: none; border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); transition: background-color .15s var(--ease-mid);
}
.nav-settings-back:hover, .nav-settings-back:active { background: var(--surface-2); }
.nav-settings-title { color: var(--text); font-size: 18px; font-weight: 800; line-height: 1.25; }
/* 设置页返回栏压缩一档，其他 Back Header 保持现状。 */
:root[data-page="settings"] .y-header--back.nav { border-bottom-color: color-mix(in srgb, var(--border) 58%, transparent); }
:root[data-page="settings"] .y-header--back.nav .nav-inner { height: var(--sp-12); gap: var(--sp-2); }
/* 共享 Header：页面标题、返回栏及统一尺寸 */
.y-header-inner {
  max-width: var(--page-max); min-height: 52px; margin: 0 auto;
  padding: 0 var(--sp-4); display: flex; align-items: center; gap: var(--sp-3);
}
.y-header--brand.nav .nav-inner { min-height: 55px; }
.y-header--brand:not(.nav) .y-header-inner { min-height: 56px; }
.y-header--brand.home-header { padding-top: var(--safe-t); }
.y-header--brand.home-header .y-header-inner { min-height: 44px; }
.y-header--page .y-header-inner {
  max-width: none; min-height: 0; padding: 0;
  align-items: flex-start; justify-content: space-between;
}
.y-header--page .y-header-copy { flex: 1; min-width: 0; }
.y-header--page .ttl { margin: 0; }
.y-header--page .sub { margin-top: 4px; line-height: 1.5; }
.y-header--back .y-header-inner { min-height: 52px; padding: 0; justify-content: flex-start; }
.y-header--back .y-header-copy { flex: 1; min-width: 0; }
.y-header--back .sub { margin-top: 4px; line-height: 1.4; }
.y-header--back:not(.nav) .nav-settings-back { width: 40px; height: 40px; }
.y-header--back:not(.nav) .nav-settings-title { margin: 0; }
.y-header-actions { display: flex; flex: none; align-items: center; gap: var(--sp-2); }
.y-header-actions > button, .y-header-actions > a { min-width: 40px; min-height: 40px; }

.nav-brand { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0; }
.nav-brand img.mark { width: 30px; height: 30px; }
.nav-brand img.word { height: 21px; width: auto; }
.nav-brand .name { font-size: 17px; font-weight: 800; letter-spacing: .5px; color: var(--text); }

/* 组合 Logo：图片本身已去背透明，直接贴背景使用，不加任何底框 */
.nav-logo {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 0; background: none; border: 0; box-shadow: none;
}
/* 其它页面沿用旧组合 Logo 的圆角底与阴影，按高度铺满即可。 */
.nav-logo img { height: 40px; width: auto; display: block; }
.nav-logo--home { gap: var(--sp-2); }
.nav-logo--home img.nav-logo-mark { width: 32px; height: 32px; object-fit: contain; }
/* 从透明横排图中裁出纯艺术字（x=117,y=41），星星装饰留在裁切框外。 */
.nav-logo-word {
  display: block; flex: none; width: 114px; height: 32px;
  background: url('/images/logo-lockup-transparent.png') no-repeat -76px -27px / 190px auto;
}

/* 子页返回（统一放顶部左上角，绝不放底部） */
.page-back {
  display: inline-flex; align-items: center; gap: 7px;
  height: var(--h-lg); padding: 0 18px 0 14px; margin: 14px 0 var(--sp-3);
  border-radius: var(--r-pill);
  /* 淡黑底 + 深色字：原来是浅蓝底，和页面的淡蓝背景几乎融成一片、看不到按钮 */
  background: color-mix(in srgb, var(--text) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 13%, transparent);
  color: var(--text);
  font-size: 15px; font-weight: 700;
  transition: background-color .15s var(--ease-mid);
}
.page-back:active { background: color-mix(in srgb, var(--text) 16%, transparent); }
.page-back svg { display: block; flex: none; }
:root[data-layout="mobile"] .page-back,
:root[data-layout="mobile"] .page .nav-back,
:root[data-layout="mobile"] .p02-header-title,
:root[data-layout="mobile"] .bead-check-back { display: none !important; }
:root[data-layout="mobile"] .tpl-page-head { display: none !important; }
:root[data-layout="tablet"] .page-back,
:root[data-layout="tablet"] .page .nav-back,
:root[data-layout="tablet"] .p02-header-title,
:root[data-layout="tablet"] .bead-check-back { display: none !important; }
:root[data-layout="tablet"] .tpl-page-head { display: none !important; }

/* 本浏览器导出记录 */
/* 本机图纸用量记录 */
.bead-usage-page { padding-bottom: calc(var(--sp-8) + var(--safe-b)); }
.bead-usage-head { align-items: center; justify-content: space-between; gap: var(--sp-4); }
.bead-usage-head .ttl { margin: 0; }
.bead-usage-head .sub { margin: var(--sp-1) 0 0; }
.bead-usage-error { margin: 0 0 var(--sp-3); padding: var(--sp-3); border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--border)); border-radius: var(--r-md); background: var(--surface); color: var(--danger-strong); line-height: 1.55; }
.bead-usage-state { display: grid; justify-items: center; gap: var(--sp-3); }
.bead-usage-state p { margin: 0; }
.bead-usage-empty h2 { margin: var(--sp-3) 0 var(--sp-2); color: var(--text); font-size: 17px; }
.bead-usage-empty p { margin: 0; line-height: 1.6; }
.bead-usage-list { display: grid; gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
.bead-usage-list > li { min-width: 0; }
.bead-usage-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2) var(--sp-3); padding: var(--sp-3); border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card); background: var(--surface); }
.bead-usage-card-copy { min-width: 0; }
.bead-usage-card-copy h2 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.bead-usage-title { max-width: 100%; padding: 0; background: transparent; color: var(--text); font-size: 15px; font-weight: 800; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.bead-usage-card-copy time { display: block; margin-top: var(--sp-1); color: var(--text-2); font-size: 11px; }
.bead-usage-card-copy p { margin: var(--sp-1) 0 0; color: var(--text-2); font-size: 12px; }
.bead-usage-status { padding: var(--sp-1) var(--sp-2); border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-strong); font-size: 11px; font-weight: 750; white-space: nowrap; }
.bead-usage-status.is-done { background: var(--surface-2); color: var(--text-2); }
.bead-usage-card-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.bead-usage-card-actions .btn { min-width: 0; min-height: 44px; padding-inline: var(--sp-2); white-space: nowrap; }
.bead-usage-summary { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-3); padding: var(--sp-4); border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card); background: var(--surface); }
.bead-usage-summary-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.bead-usage-summary-copy { min-width: 0; }
.bead-usage-eyebrow { color: var(--primary-strong); font-size: 11px; font-weight: 750; }
.bead-usage-summary h2 { overflow-wrap: anywhere; margin: var(--sp-1) 0 0; color: var(--text); font-size: 18px; line-height: 1.35; }
.bead-usage-total { display: grid; flex: none; justify-items: center; min-width: 62px; padding: var(--sp-2); border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-strong); }
.bead-usage-total strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.bead-usage-total small { font-size: 10px; }
.bead-usage-summary > p { margin: 0; color: var(--text-2); font-size: 12px; line-height: 1.55; }
.bead-usage-select-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); color: var(--text-2); font-size: 12px; }
.bead-usage-select-head button { min-height: 40px; padding-inline: var(--sp-2); }
.bead-usage-lines { display: grid; gap: var(--sp-2); margin: 0 0 var(--sp-3); padding: 0; list-style: none; }
.bead-usage-lines > li { min-width: 0; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.bead-usage-lines > li.is-deducted { background: var(--surface-2); }
.bead-usage-line { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; padding: var(--sp-2) var(--sp-3); cursor: pointer; }
.bead-usage-line input { flex: none; width: 20px; height: 20px; accent-color: var(--primary); }
.bead-usage-line-code { display: grid; flex: 1; min-width: 0; gap: 2px; }
.bead-usage-line-code strong { color: var(--text); font-size: 14px; }
.bead-usage-line-code small { color: var(--text-2); font-size: 11px; }
.bead-usage-line-count { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.bead-usage-line-count small { color: var(--text-2); font-size: 11px; font-weight: 500; }
.bead-usage-footer { position: sticky; z-index: 2; bottom: calc(var(--safe-b) + var(--sp-2)); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin: var(--sp-3) calc(-1 * var(--sp-2)) 0; padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-2); color: var(--text-2); font-size: 12px; }
.bead-usage-footer > div { display: flex; gap: var(--sp-2); }
.bead-usage-footer .btn { min-height: 44px; padding-inline: var(--sp-3); white-space: nowrap; }
.bead-usage-dialog { max-height: 82dvh; }
.bead-usage-dialog-card { min-height: auto; max-height: 82dvh; padding-top: var(--sp-4); border-bottom: 1px solid var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.bead-usage-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.bead-usage-dialog-head h2 { margin: 0; color: var(--text); font-size: 17px; }
.bead-usage-dialog-head p { margin: var(--sp-1) 0 0; color: var(--text-2); font-size: 12px; line-height: 1.5; }
.bead-usage-dialog-close { min-width: 44px; min-height: 44px; margin-top: calc(-1 * var(--sp-2)); }
.bead-usage-warehouse-list { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.bead-usage-warehouse-option { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); width: 100%; min-height: 64px; padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); text-align: left; }
.bead-usage-warehouse-option:disabled { opacity: .55; cursor: not-allowed; }
.bead-usage-warehouse-option span { display: grid; min-width: 0; gap: var(--sp-1); }
.bead-usage-warehouse-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bead-usage-warehouse-option small { color: var(--text-2); font-size: 11px; line-height: 1.4; }
.bead-usage-dialog .bead-dialog-actions { margin-top: var(--sp-2); }
.bead-usage-dialog .bead-dialog-actions .btn { min-height: 44px; }
.bead-usage-action { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1); min-height: 44px; padding: 0 var(--sp-3); border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-strong); font-size: 12px; font-weight: 700; white-space: nowrap; }
.bead-usage-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bead-usage-action-standalone { display: flex; width: max-content; margin: 0 0 var(--sp-2) auto; }
.bead-usage-action-count { display: grid; place-items: center; min-width: 16px; height: 16px; padding-inline: 3px; border-radius: var(--r-pill); background: var(--surface); color: var(--primary-strong); font-size: 10px; font-variant-numeric: tabular-nums; }
@media (min-width: 768px) {
  .bead-usage-dialog { inset: 50% auto auto 50%; width: min(560px, calc(100vw - var(--sp-8))); max-height: min(82dvh, 720px); transform: translate(-50%, -50%); border-radius: var(--r-lg); }
  .bead-usage-dialog-card { max-height: min(82dvh, 720px); border-radius: var(--r-lg); }
}
@media (max-width: 479px) {
  .bead-usage-card { padding: var(--sp-2); }
  .bead-usage-card-actions { gap: var(--sp-1); }
  .bead-usage-card-actions .btn { padding-inline: var(--sp-1); font-size: 12px; }
  .bead-usage-summary { padding: var(--sp-3); }
  .bead-usage-footer { align-items: stretch; flex-direction: column; gap: var(--sp-2); }
  .bead-usage-footer > div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .bead-usage-footer .btn { padding-inline: var(--sp-2); font-size: 12px; }
}

.exports-page { padding-bottom: calc(var(--sp-8) + var(--safe-b)); }
.exports-head { align-items: flex-end; gap: var(--sp-4); }
.exports-head .ttl { margin: 0; }
.exports-head .grow { min-width: 0; }
.exports-list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin: 0 0 var(--sp-2); }
.exports-count {
  display: inline-flex; align-items: center; height: var(--h-lg); padding: 0 var(--sp-4);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: var(--r-button); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary-strong);
  font-size: var(--type-body); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.exports-clear, .export-actions .btn { min-height: 44px; }
.exports-clear.btn-danger,
.export-actions .btn-danger {
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--border));
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  color: var(--danger-strong); box-shadow: none;
}
.exports-clear.btn-danger:hover:not(:disabled),
.export-actions .btn-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}
.exports-note {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
  margin: var(--sp-3) 0 var(--sp-4); padding: 0;
  color: var(--text-3); font-size: 12px; line-height: 1.45;
}
.exports-note-label {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--sp-2);
  border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-strong);
  font-size: 11px; font-weight: var(--font-weight-bold); white-space: nowrap;
}
.exports-error {
  margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border));
  border-radius: var(--r-md); background: var(--surface); color: var(--danger); line-height: 1.6;
}
.exports-state {
  padding: var(--sp-8) var(--sp-4); border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card);
  background: var(--surface); color: var(--text-2); text-align: center; box-shadow: var(--shadow-none);
}
.exports-loading { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); }
.exports-state-error { color: var(--danger); }
.exports-state-error p { margin: 0 0 var(--sp-4); }
.exports-empty h2 { margin: var(--sp-3) 0 var(--sp-2); color: var(--text); font-size: 18px; }
.exports-empty p { margin: 0; line-height: 1.6; }
.exports-empty-mark {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border-radius: 50%; background: var(--primary-soft); color: var(--primary-strong);
}
.exports-grid {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4);
  list-style: none; margin: 0; padding: 0;
}
.exports-item { min-width: 0; }
.export-card {
  position: relative; display: grid; grid-template-columns: clamp(76px, 9vw, 96px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2);
  min-width: 0; height: 100%; padding: var(--sp-3); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow-subtle);
}
.export-thumb {
  position: relative; grid-column: 1; grid-row: 1; display: grid; place-items: center;
  width: 100%; aspect-ratio: 1 / 1; overflow: hidden; padding: 0; border: 0; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-2); cursor: zoom-in;
}
.export-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.export-thumb-missing { font-size: 13px; }
.export-sequence {
  position: absolute; top: var(--sp-2); left: var(--sp-2); display: grid; place-items: center;
  min-width: var(--h-sm); height: var(--h-xs); padding: 0 var(--sp-1);
  border: 1px solid color-mix(in srgb, var(--primary-strong) 38%, var(--border));
  border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-strong);
  font-size: var(--type-supporting); font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.export-thumb-hint {
  position: absolute; right: var(--sp-1); bottom: var(--sp-1); padding: 2px var(--sp-1);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text); font-size: 10px; font-weight: 700;
}
.export-card-body { grid-column: 2; grid-row: 1; display: grid; align-content: center; gap: var(--sp-1); min-width: 0; padding: 0; }
.export-name { overflow: hidden; margin: 0; color: var(--text); font-size: 15px; font-weight: 800; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.export-time { display: block; color: var(--text-2); font-size: 11px; }
.export-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-1) var(--sp-2); margin: var(--sp-1) 0 0; }
.export-meta div { min-width: 0; }
.export-meta dt { color: var(--text-3); font-size: 10px; }
.export-meta dd { overflow: hidden; margin: 0; color: var(--text); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.export-actions { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-1); padding: 0; }
.export-actions .btn { min-width: 0; min-height: 44px; padding-inline: var(--sp-1); white-space: nowrap; }
.mine-export-guest {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); width: 100%;
  min-height: 72px; margin-top: var(--sp-3); padding: var(--sp-4);
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card); background: var(--surface);
  color: var(--text); text-align: left; box-shadow: none;
}
.mine-export-guest span { display: grid; gap: var(--sp-1); }
.mine-export-guest b { font-size: 15px; }
.mine-export-guest small { color: var(--text-2); font-size: 12px; }
.mine-export-guest strong { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--primary-strong); font-size: 13px; text-align: right; }

@media (min-width: 768px) {
  .exports-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .exports-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 479px) {
  .exports-head { align-items: flex-start; }
  .exports-count, .exports-clear { padding-inline: var(--sp-3); }
  .export-card { grid-template-columns: 72px minmax(0, 1fr); column-gap: var(--sp-2); row-gap: var(--sp-1); padding: var(--sp-2); }
  .export-card-body { gap: var(--sp-1); }
  .export-meta { margin-top: 0; }
  .export-meta div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-1); }
  .export-meta dt { white-space: nowrap; }
  .export-meta dd { text-align: right; }
  .export-actions { gap: 4px; }
  .export-actions .btn { padding-inline: 2px; }
}
@media (max-width: 767px) {
  .export-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.nav-back {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px 0 11px; margin-left: -2px;
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary-strong);
}
/* ⚠️ .mobile-only 的 display:block 会盖掉上面的 inline-flex（同优先级、后定义），
   这里用 button.nav-back 提高优先级，否则图标与文字会按行内基线排、对不齐 */
button.nav-back { display: inline-flex; align-items: center; }
/* 图标与文字严格居中对齐（此前 chevron 用了行内基线，视觉上比文字高一截） */
.nav-back svg { display: block; flex: none; }
.nav-back .ttl { font-size: 15.5px; font-weight: 700; line-height: 1; }
.nav-back:active { background: var(--primary-ghost); }

.nav-actions { display: flex; align-items: center; gap: 2px; }
.nav-btn {
  position: relative;
  width: 44px; height: 44px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 19px;
  transition: background-color .15s, color .15s;
}
.nav-btn:active { background: var(--surface-2); }
.nav-btn.on { color: var(--primary); }

.nav-login {
  height: var(--h-lg); padding: 0 16px; border-radius: var(--r-pill);
  background: var(--primary-grad); color: #fff;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center;
  box-shadow: var(--shadow-primary);
}
.nav-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-strong);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--primary);
}

/* 返回型顶栏（画板 / 子页） */
.nav-compact .nav-inner { gap: var(--sp-3); }
.icon-btn {
  width: 38px; height: 38px; flex: none;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: 20px;
}
.icon-btn:active { background: var(--surface-2); }

/* -------------------------------------------------------------
   2. 底部 Tab
   ------------------------------------------------------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: saturate(130%) blur(8px);
  border-top: 1px solid var(--border);
}
.tabbar-inner {
  max-width: var(--page-max); margin: 0 auto;
  height: var(--tab-h); display: flex;
}
.tab-item {
  position: relative;
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  color: var(--text-2); font-size: 12px; line-height: 1.2; font-weight: 600;
  transition: color .16s var(--ease-mid), transform .16s var(--ease-mid);
}
/* 轻托当前图标并与图标盒居中，不包住标签。 */
.tab-item::before {
  content: ''; position: absolute; left: 50%; top: calc(50% - 20px);
  width: 34px; height: 24px; border-radius: var(--r-md);
  transform: translateX(-50%); opacity: 0;
  background: var(--primary-soft);
  transition: opacity .16s var(--ease-mid);
}
.tab-item > * { position: relative; }
.tab-item .ico { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.tab-item.on { color: var(--primary-strong); }
.tab-item.on::before { opacity: 1; }
.tab-item:active { transform: scale(.98); }
.tab-item:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: -3px; border-radius: var(--r-md); }
@media (prefers-reduced-motion: reduce) {
  .tab-item, .tab-item::before { transition: none; }
  .tab-item:active { transform: none; }
}
/* 底部 tab 的未读数字角标：跟顶栏铃铛同一个样式，贴在图标右上角。
   ⚠️ 这里必须显式写 position:absolute —— 上面那条 `.tab-item > *` 会把 position 覆盖成
   relative，角标就退化成 flex 子项：既被挤到图标下方（掉出屏幕外），又把「我的」这一格的
   图标与文字整体顶高，看着像没对齐。 */
.tab-item .badge {
  position: absolute; top: 4px; left: 50%; right: auto;
  margin-left: 5px; margin-right: 0;
}

/* 平板主导航：保留四项 Tab 与触控热区，改为居中悬浮 Dock。 */
:root[data-layout="tablet"] .tabbar {
  left: 50%; right: auto; bottom: var(--sp-4);
  width: max-content; max-width: calc(100vw - var(--sp-8)); padding: 4px 4px var(--safe-b);
  transform: translateX(-50%);
  border: 1px solid var(--border); border-radius: var(--r-featured);
  background: var(--surface); box-shadow: var(--shadow-1);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
:root[data-layout="tablet"] .tabbar-inner {
  width: max-content; max-width: 100%; height: 60px; gap: 2px;
}
:root[data-layout="tablet"] .tab-item {
  flex: 1 0 84px; min-width: 72px; min-height: 52px; gap: 3px;
  border-radius: var(--r-control); font-size: 13px;
}
:root[data-layout="tablet"] .tab-item::before {
  top: calc(50% - 21px); width: 36px; height: 26px;
}

/* -------------------------------------------------------------
   3. 通知：跑马灯 / 全局通知条 / 轻提示 / 警告
   ------------------------------------------------------------- */
.marquee {
  display: flex; align-items: center; gap: var(--sp-2);
  height: 38px; padding: 0 var(--sp-3);
  background: var(--primary-soft); border-radius: var(--r-md);
  overflow: hidden;
}
.marquee .lead { flex: none; font-size: 13px; color: var(--primary-strong); font-weight: 700; }
.marquee .track { flex: 1; overflow: hidden; position: relative; height: 20px; }
.marquee .track span {
  position: absolute; white-space: nowrap; font-size: 13px; color: var(--primary-strong);
  animation: marquee 14s linear infinite;
}
.marquee .track span.paused, .marquee:hover .track span { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

.notice-bar {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  font-size: 13px; line-height: 1.5;
  border: 1px solid transparent;
}
.notice-bar.info    { background: var(--primary-soft); color: var(--primary-strong); }
.notice-bar.warning { background: var(--warning-soft); color: var(--warning-strong); }
.notice-bar.danger  { background: var(--danger-soft);  color: var(--danger); }
.notice-bar.warning a {
  display: inline-flex; align-items: center; min-height: var(--h-lg);
  color: var(--warning-strong); text-decoration: underline;
}

/* 跑马灯（顶部公告）：多条轮播、悬停/按住暂停、右侧小圆点指示 */
.notice-bar { align-items: center; }
.notice-bar .marquee {
  flex: 1 1 0; min-width: 0; height: auto; padding: 0;
  background: transparent; border-radius: 0;
  display: block; overflow: hidden;
}
.notice-bar .mq-item {
  display: block; min-width: 0; font-size: 13px; font-weight: 600; color: var(--primary-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: mq-in .32s var(--ease-out) both;
}
@keyframes mq-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.notice-bar .mq-dots { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.notice-bar .mq-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 35%, transparent);
  transition: background-color .2s var(--ease-mid), transform .2s var(--ease-mid);
}
.notice-bar .mq-dots i.on { background: var(--primary); transform: scale(1.25); }

.auth-preview-note {
  margin: 12px 0 0; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--primary-soft); color: var(--primary-strong);
  font-size: 12px; line-height: 1.55;
}

/* 全局通知条：跨页面常驻顶部，可关闭（关闭状态记在 localStorage） */
html[data-global-notice="off"] .global-notice { display: none; }
.global-notice {
  position: sticky; top: calc(var(--nav-h) + var(--safe-t)); z-index: 59;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--primary) 14%, var(--surface)) 0%,
    color-mix(in srgb, var(--primary) 8%, var(--surface)) 70%,
    var(--surface) 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 14%, transparent);
}
/* 内容与页面（卡片）左右边界对齐：不再是贴屏幕边的通栏文字 */
.global-notice .gn-inner {
  max-width: var(--page-max); margin: 0 auto;
  padding: 8px var(--page-pad);
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; line-height: 1.5; color: var(--primary-strong);
}
:root[data-device="pc"] .global-notice .gn-inner { max-width: var(--pc-max); padding: 8px var(--page-pad); }
.global-notice .gn-tag {
  flex: none; height: 20px; padding: 0 8px; border-radius: var(--r-xs);
  display: inline-flex; align-items: center;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 800;
}
.global-notice .gn-grow {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.global-notice a.gn-grow { color: inherit; text-decoration: none; }
.global-notice a.gn-grow:hover { text-decoration: underline; }
/* 离线（连不上后端）常驻提示：不能用主色蓝，要一眼看出是异常 */
.global-notice.gn-danger {
  background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 14%, var(--surface)) 0%, var(--surface) 100%);
  border-bottom-color: color-mix(in srgb, var(--danger) 22%, transparent);
}
.global-notice.gn-danger .gn-inner { color: var(--danger-strong); }
.global-notice.gn-danger .gn-tag { background: var(--danger-strong); color: #fff; }
.global-notice.gn-warning {
  background: linear-gradient(90deg, color-mix(in srgb, var(--warning) 15%, var(--surface)) 0%, var(--surface) 100%);
  border-bottom-color: color-mix(in srgb, var(--warning) 24%, transparent);
}
.global-notice.gn-warning .gn-inner { color: var(--warning-strong); }
.global-notice.gn-warning .gn-tag { background: var(--warning-strong); color: #fff; }
.global-notice .gn-close {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: var(--r-pill);
  display: inline-grid; place-items: center; background: transparent; color: currentColor;
  font-size: 20px; line-height: 1; cursor: pointer;
}
.global-notice .gn-close:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
/* 深色主题下主色/危险色都偏亮，白字压上去只有 3.4:1 → 标签底色压深一档 */
:root[data-theme="dark"] .global-notice .gn-tag { background: color-mix(in srgb, var(--primary) 60%, var(--bg)); }
:root[data-theme="dark"] .global-notice.gn-warning .gn-tag { background: color-mix(in srgb, var(--warning) 42%, var(--bg)); }
:root[data-theme="dark"] .global-notice.gn-danger .gn-tag { background: color-mix(in srgb, var(--danger) 62%, var(--bg)); }

/* 轻提示（自动消失）与带操作轻提示 */
.hover-tip {
  position: fixed; z-index: 300; left: 0; top: 0;
  max-width: 300px; padding: 7px 11px;
  border-radius: var(--r-sm);
  background: rgba(15, 27, 51, .94); color: #fff;
  font-size: 12px; line-height: 1.55;
  box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .14s var(--ease-out), transform .14s var(--ease-out);
}
.hover-tip.on { opacity: 1; transform: none; }
/* 深色主题反过来：浅底深字，一眼能看清 */
:root[data-theme="dark"] .hover-tip { background: rgba(226, 236, 252, .95); color: #0B1220; }

.toast-wrap {
  position: fixed; top: calc(var(--safe-t) + 12px); left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  width: max-content; max-width: min(92vw, 460px);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r-pill);
  background: var(--toast-bg);
  color: var(--toast-fg);
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  pointer-events: auto;
}
.toast-enter-active, .toast-leave-active {
  transition: transform .18s var(--ease-out), opacity .18s var(--ease-out);
}
.toast-enter-from { opacity: 0; transform: translateY(-4px); }
.toast-leave-active { transition-duration: .14s; transition-timing-function: var(--ease-in); }
.toast-leave-to { opacity: 0; transform: translateY(-2px); }
.toast-move { transition: transform .18s var(--ease-mid); }
.toast .grow { min-width: 0; }
.toast .act, .toast .toast-act {
  flex: none; padding: 3px 11px; border-radius: var(--r-pill);
  background: var(--toast-act-bg);
  color: var(--toast-fg); font-weight: 700; font-size: 12.5px;
}
.toast .close { opacity: .6; font-size: 15px; }

/* -------------------------------------------------------------
   4. 弹层：居中弹窗 / 侧边抽屉 / 气泡弹窗
   ------------------------------------------------------------- */
.mask {
  position: fixed; inset: 0; z-index: 120;
  background: var(--overlay);
  display: flex;
  backdrop-filter: blur(2px);
}
.mask.fade-enter-active, .mask.fade-leave-active { transition: opacity .18s var(--ease-out); }
.mask.fade-leave-active { transition-duration: .14s; transition-timing-function: var(--ease-in); }
.mask.fade-enter-from, .mask.fade-leave-to { opacity: 0; }
.mask.fade-enter-active .modal, .mask.fade-leave-active .modal {
  transition: transform .18s var(--ease-out), opacity .18s var(--ease-out);
}
.mask.fade-leave-active .modal { transition-duration: .14s; transition-timing-function: var(--ease-in); }
.mask.fade-enter-from .modal, .mask.fade-leave-to .modal {
  opacity: 0; transform: translateY(4px) scale(.99);
}
/* 弹层层级梯度：后开的弹窗必须盖在先开的上面
   （此前层级相同、靠 DOM 顺序，导致「卡密规则」被「续费」弹窗挡住） */
y-drawer-host  .mask { z-index: 140; }
y-kefu         .mask { z-index: 150; }   /* 客服：可从登录/激活弹窗里再打开 */
y-modal-host   .mask { z-index: 155; }   /* 通用确认 / 卡密规则 */
y-crop-host    .mask { z-index: 170; }   /* 裁剪：最高 */
/* 居中弹窗（阻断式） */
.mask-center { align-items: center; justify-content: center; padding: var(--sp-5); }
.modal {
  width: 100%; max-width: 340px;
  max-height: 84vh; overflow-y: auto;      /* 弹窗不再长成一整屏 */
  background: var(--surface); border-radius: var(--r-xl);
  padding: 22px 22px 18px;                 /* 四周留白更宽一点，卡片更透气 */
  /* 两层阴影：近处薄阴影定边界、远处大阴影给高度 */
  box-shadow: 0 2px 6px rgba(16, 34, 71, .06), 0 18px 44px rgba(16, 34, 71, .16);
}
/* 弹窗结构：标题与底部按钮固定，只有中间内容滚动（老板给的规则 6） */
.modal:not(.modal-flush) {
  display: flex; flex-direction: column; overflow: hidden;
}
.modal:not(.modal-flush) > .modal-title { flex: none; }
.modal:not(.modal-flush) > .modal-desc,
.modal:not(.modal-flush) > [data-scroll] {
  flex: 1 1 auto; overflow-y: auto; min-height: 0;
  overscroll-behavior: contain;
}
.modal:not(.modal-flush) > .modal-actions { flex: none; }
.modal-title { font-size: 16px; font-weight: 700; text-align: center; }
.modal-desc  { margin-top: 8px; font-size: 13.5px; color: var(--text-2); text-align: center; line-height: 1.6; }
/* 按钮文案长时允许换行成两排（窄屏兜底：以前会把弹窗撑破、右边的字被截断） */
.modal-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); flex-wrap: wrap; }
.modal-actions > .btn { flex: 1 1 auto; min-width: 120px; }

/* 结果弹窗（激活 / 续费成功）里的明细块：卡密 + 到期时间两列小表 */
.act-receipt {
  margin-top: 12px; padding: 2px 12px;
  border-radius: var(--r-md); background: var(--surface-2);
  text-align: left;
}
.act-receipt .ar-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 0; font-size: 13px;
}
.act-receipt .ar-row + .ar-row { border-top: 1px solid var(--border); }
.act-receipt .ar-k { flex: none; color: var(--text-2); }
.act-receipt .ar-v {
  min-width: 0; text-align: right; font-weight: 700; color: var(--text);
  word-break: break-all;
}
.act-note { margin: 10px 0 0; font-size: 13px; color: var(--text-2); }

/* 侧边抽屉（内容多） */
.mask-drawer { align-items: flex-end; justify-content: center; }
.drawer {
  width: 100%; max-width: var(--page-max);
  max-height: 86vh;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  animation: slide-up .28s var(--ease-out);
}
.drawer-head {
  flex: none; padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-grip {
  width: 38px; height: 4px; border-radius: 2px;
  background: var(--border-2); margin: 8px auto 0;
}
.drawer-body { flex: 1; overflow-y: auto; padding: var(--sp-4); -webkit-overflow-scrolling: touch; }
.drawer-grip-toggle {
  display: grid; place-items: center; width: 52px; height: 24px; margin: 2px auto 0; padding: 0;
  border: 0; border-radius: var(--r-pill); background: transparent; cursor: ns-resize; touch-action: none;
}
.drawer-grip-toggle::before { content: ""; width: 38px; height: 4px; border-radius: var(--r-pill); background: var(--border-2); }
.drawer-grip-toggle:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 1px; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--sp-4); -webkit-overflow-scrolling: touch; }
.drawer.palette-drawer {
  height: min(80svh, 720px); max-height: calc(100svh - var(--sp-2));
  transition: height .22s var(--ease-out);
}
.drawer.palette-drawer.is-expanded { height: min(94svh, 900px); max-height: calc(100svh - var(--sp-2)); }
.drawer.palette-drawer .drawer-head { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.drawer.palette-drawer .drawer-body { display: flex; flex-direction: column; overflow: hidden; }
.pl-dialog-content { text-align: left; }
.pl-dialog-content--sheet { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pl-dialog-content--sheet #pl-brands,
.pl-dialog-content--sheet #pl-letters { flex: none; }
.pl-dialog-content--sheet #pl-letters .pl-letter { min-width: 44px; height: 44px; }
.pl-rail { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.pl-rail::-webkit-scrollbar { display: none; }
.pl-rail > button { flex: none; }
.pl-dialog-content--sheet .pl-search { flex: none; margin-top: var(--sp-2); }
.pl-dialog-content--sheet .pl-recent--rail { flex: none; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.pl-dialog-content--sheet .pl-recent--rail::-webkit-scrollbar { display: none; }
.pl-dialog-content--sheet .pl-count { flex: none; margin-top: var(--sp-2); }
.pl-dialog-content--sheet .pl-grid--sheet {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow-x: hidden; overflow-y: auto;
  align-content: start; padding: 2px 4px 8px 0; overscroll-behavior: contain;
}
.pl-grid--sheet .chip { min-width: 0; min-height: 54px; gap: 4px; }
.pl-grid--sheet .chip .sw { width: 36px; height: 36px; border-radius: 10px; }
.pl-dialog-content--sheet .pl-note { flex: none; margin: var(--sp-2) 0 0; font-size: 11px; }

/* 消息中心列表（客服回信 / 公告 / 权益提醒，留档可回看） */
.slide-bar {
  position: relative; height: 52px; margin-top: 6px;
  border-radius: var(--r-pill); overflow: hidden;
  background: var(--surface-2);
  touch-action: none; user-select: none; cursor: grab;
}
.slide-bar .sb-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--primary-grad);
}
.slide-bar .sb-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13.5px; font-weight: 700; color: var(--text-2); pointer-events: none;
}
.slide-bar .sb-knob {
  position: absolute; left: 4px; top: 4px;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--primary-strong);
  box-shadow: 0 2px 8px rgba(16, 34, 71, .18);
}

.msg-list {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow-none);
}
.msg-item {
  padding: var(--sp-3) var(--sp-4); background: transparent;
}
.msg-item + .msg-item { border-top: 1px solid color-mix(in srgb, var(--border) 62%, transparent); }
.msg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-t { margin-top: var(--sp-2); font-size: var(--type-body); font-weight: var(--font-weight-semibold); line-height: var(--line-body); color: var(--text); }
.msg-b { margin-top: var(--sp-1); font-size: var(--type-supporting); line-height: var(--line-supporting); color: var(--text-2); }
.drawer-foot {
  flex: none; padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + var(--safe-b));
  border-top: 1px solid var(--border);
  display: flex; gap: var(--sp-3);
}
.drawer-foot > .btn { flex: 1; }

/* 气泡弹窗（紧贴触发点） */
.pop {
  position: absolute; z-index: 130;
  min-width: 168px; max-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  padding: 6px;
  animation: pop-in .18s var(--ease-out);
}
.pop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--r-control);
  font-size: 14px; color: var(--text);
}
.pop-item:active { background: var(--surface-2); }
.pop-item.danger { color: var(--danger); }
.pop-arrow {
  position: absolute; width: 10px; height: 10px;
  background: var(--surface); border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

/* -------------------------------------------------------------
   5. 首页
   ------------------------------------------------------------- */
/* ---------- 首页 Hero（参考旧站排版：居中一行标题 + 蓝色 em + 预览卡 + 指标条） ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 44px 18px 30px;
  margin-bottom: 18px;
  border-radius: var(--r-featured);
  /* 背景网格统一由 .page::before 绘制，让品牌纹理从页首渐隐到内容区。 */
  overflow: hidden;
}

/* 一行标题；「能照着拼」只是蓝色文字，不加背景块 */
.hero h1 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -.4px;
  margin: 0 0 12px;
  text-wrap: balance;
}
/* 高亮的那半句自己占一行（老板口径：「能照着拼的图纸」要另起一行，别在「能」字后断） */
.hero h1 em { display: block; font-style: normal; color: var(--primary); }
.hero .slogan { font-size: 14.5px; color: var(--text-2); margin: 0 0 8px; }
.hero .sub-slogan { font-size: 12.5px; color: var(--text-3); margin: 0 0 24px; }

/* P03：产品预览卡保持轻量外框，收紧横向对照的中间留白。 */
.hero-preview {
  max-width: 460px; margin: 0 auto var(--sp-3); padding: var(--sp-2);
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--border) 78%, var(--surface));
  border-radius: var(--r-featured); box-shadow: var(--shadow-none);
}
.hp-pair { display: flex; align-items: center; justify-content: center; gap: var(--sp-1); }
.hp-shot { margin: 0; flex: 1 1 0; min-width: 0; }
.hp-media {
  position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 68%, var(--surface));
  border-radius: var(--r-md); background: var(--surface-2);
}
.hp-media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.hp-image-state {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: var(--sp-2); background: var(--surface-2); color: var(--text-3);
  text-align: center; font-size: 12px; line-height: 1.5;
}
.hp-image-state--loading .image-loading-label { flex-direction: column; gap: var(--sp-2); }
.hp-loader-grid { display: grid; grid-template-columns: repeat(3, 7px); gap: 3px; }
.hp-loader-grid i {
  width: 7px; height: 7px; border-radius: 2px; background: var(--primary);
  opacity: .24; animation: hp-loader-bead .52s var(--ease-mid) infinite alternate;
}
.hp-loader-grid i:nth-child(2), .hp-loader-grid i:nth-child(4), .hp-loader-grid i:nth-child(8) { animation-delay: .07s; }
.hp-loader-grid i:nth-child(3), .hp-loader-grid i:nth-child(5), .hp-loader-grid i:nth-child(9) { animation-delay: .14s; }
.hp-loader-grid i:nth-child(6) { animation-delay: .21s; }
@keyframes hp-loader-bead { to { opacity: .95; transform: scale(1.24); } }
.ai-example-state.loading-shimmer { background: var(--surface-2); }
.hp-image-state--error { color: var(--text-2); }
.hp-shot figcaption {
  margin-top: var(--sp-2); text-align: center;
  font-size: 12px; font-weight: 600; color: var(--text-2);
}
.hp-arrow {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-strong);
}


/* 首页四条创作路径固定为 2×2；小屏按钮允许自然换行。 */
.hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.hero-actions .btn { width: 100%; min-width: 0; }
.hero-entry { min-height: 58px; height: auto; padding: var(--sp-3) var(--sp-2); line-height: 1.35; }
.hero-entry-grid { color: var(--primary-strong); background: var(--primary-soft); border: 1px solid var(--primary); }
.hero-entry__icon { display: none; flex: none; align-items: center; justify-content: center; width: 16px; height: 16px; }
.hero-entry__label { min-width: 0; text-wrap: balance; }

/* 指标条 */
.hero-stats {
  display: flex; justify-content: center; gap: 14px; flex-wrap: nowrap;
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--border);
}
.hero-stat { text-align: center; flex: 1 1 0; min-width: 0; }
.hero-stat .n { font-size: 16px; font-weight: 800; color: var(--primary-strong); line-height: 1.3; white-space: nowrap; }
.hero-stat .t { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* P02/P03：首页移动端收紧首屏；P04：四个入口按优先级呈现并统一图标。 */
:root[data-device="mobile"] .hero {
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  margin-bottom: var(--sp-3);
}
:root[data-device="mobile"] .hero h1 { margin-bottom: var(--sp-1); }
:root[data-device="mobile"] .hero .slogan {
  font-size: var(--type-supporting);
  line-height: var(--line-supporting);
  width: calc(100% + var(--sp-4) + var(--sp-4));
  margin-inline: calc(0px - var(--sp-4));
  letter-spacing: -.01em;
}
:root[data-device="mobile"] .hero .sub-slogan { display: none; }
:root[data-device="mobile"] .hero-actions {
  row-gap: var(--sp-2);
  margin-top: var(--sp-3);
  margin-bottom: var(--sp-3);
}
:root[data-device="mobile"] .hero-entry {
  gap: var(--sp-1);
  font-size: var(--type-body);
}
:root[data-device="mobile"] .hero-entry__icon { display: inline-flex; }
:root[data-device="mobile"] .hero-entry__label { white-space: normal; }
:root[data-device="mobile"] .hero-entry--secondary {
  background: var(--primary-soft);
  border-color: var(--border-2);
  color: var(--primary-strong);
}
:root[data-device="mobile"] .hero-entry--tertiary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
:root[data-device="mobile"] .hero-entry--quiet {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-strong);
}
:root[data-device="mobile"] .hero-entry:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
  :root[data-device="mobile"] .hero-entry:hover { transform: translateY(-1px); }
  :root[data-device="mobile"] .hero-entry:not(.btn-primary):hover { box-shadow: var(--shadow-1); }
  :root[data-device="pc"] .hero-entry-grid:hover { box-shadow: var(--shadow-1); }
}
:root[data-device="mobile"] .hero-entry:active { transform: scale(.985); }
/* P06：手机首页只保留色卡数量与本地处理说明，收起重复的长篇产品卖点。 */
:root[data-page="home"][data-layout="mobile"] .hero-stat:nth-child(1),
:root[data-page="home"][data-layout="mobile"] .hero-stat:nth-child(3),
:root[data-page="home"][data-layout="mobile"] .home-highlights-title,
:root[data-page="home"][data-layout="mobile"] .about-hl-grid { display: none; }
:root[data-device="mobile"] .hero-stats {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
}

/* 效果展示：原图 → 图纸（并排两图 + 中间右箭头） */
.showcase .sc-pair { display: flex; align-items: center; gap: 10px; }
.showcase .sc-item { flex: 1 1 0; min-width: 0; margin: 0; }
.showcase .sc-item img {
  width: 100%; height: auto; display: block;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.showcase .sc-item figcaption { text-align: center; font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.showcase .sc-arrow {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-strong);
  display: flex; align-items: center; justify-content: center;
}

/* 主入口大卡 */
.entry {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  text-align: left; width: 100%;
  transition: transform .16s var(--ease-mid), box-shadow .18s;
}
.entry:active { transform: scale(.985); }
.entry-primary { background: var(--primary-grad); color: #fff; box-shadow: var(--shadow-primary); }
.entry-soft    { background: var(--surface); border: 1.5px solid var(--border); box-shadow: var(--shadow-1); }
.entry-ico {
  width: 46px; height: 46px; flex: none; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 23px;
}
.entry-primary .entry-ico { background: rgba(255,255,255,.2); }
.entry-soft .entry-ico    { background: var(--primary-soft); }
.entry-title { font-size: 16px; font-weight: 700; }
.entry-sub   { font-size: 12.5px; margin-top: 2px; opacity: .82; }
.entry-soft .entry-sub { color: var(--text-2); }
.entry-arrow { flex: none; opacity: .55; font-size: 18px; }

/* 效果展示：拖动对比 */
.compare {
  position: relative; width: 100%;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  touch-action: none; user-select: none;
}
.compare:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 3px; }
.compare img { width: 100%; display: block; pointer-events: none; }
/* YCompare 组件用的类名（原样式只写了另一套类名，导致对比控件没样式） */
.compare .cmp-a { position: relative; z-index: 1; }
.compare .cmp-b {
  position: absolute; inset: 0; overflow: hidden; z-index: 2;
}
.compare .cmp-line {
  position: absolute; top: 0; bottom: 0; width: 2px; z-index: 3;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.12);
  pointer-events: none;
}
/* ⚠️ 这里原来有一条「手机端所有弹窗 max-height:52vh」——当初是为色号弹窗加的，
   但色号早就改成抽屉（.drawer 另有 86vh 限制 + 下面的 .pl-grid 高度），
   结果所有弹窗在手机端都被压到半屏：获取卡密被切掉底部、续费/登录也要滚。
   现在只保留色号网格自己的高度限制。 */
.pl-grid { max-height: 30vh; }
:root[data-device="mobile"] .pl-grid { max-height: 18vh; }
:root[data-device="mobile"] .pl-dialog-content--sheet .pl-grid--sheet { max-height: none; }
/* 内层图片必须按整框尺寸定位，否则会被压成半宽（滑块露出一半时图像变形） */
.compare .cmp-b img { position: absolute; top: 0; left: 0; height: 100%; width: auto; max-width: none; }
.compare .cmp-knob {
  position: absolute; top: 50%; z-index: 3; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-2);
}
.compare .cmp-knob::before, .compare .cmp-knob::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
}
.compare .cmp-knob::before { left: 8px; border-right: 5px solid var(--primary-strong); transform: translateY(-50%); }
.compare .cmp-knob::after { right: 8px; border-left: 5px solid var(--primary-strong); transform: translateY(-50%); }
.compare .cmp-tag {
  position: absolute; bottom: 8px; z-index: 3;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700;
  background: rgba(10, 22, 45, .62); color: #fff; backdrop-filter: blur(4px);
}
.compare .cmp-tag.l { left: 8px; }
.compare .cmp-tag.r { right: 8px; }
.compare .after-layer { position: absolute; inset: 0; }
.compare .clip { position: absolute; inset: 0; overflow: hidden; }
.compare .handle {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.14);
}
.compare .knob {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--primary-strong); font-weight: 700;
}
.compare .lb {
  position: absolute; top: 8px; padding: 3px 9px;
  border-radius: var(--r-pill); font-size: 11px; font-weight: 700;
  background: rgba(10,22,45,.6); color: #fff; backdrop-filter: blur(4px);
}
.showcase-meta { display: flex; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-2); }

/* 卡密区 */
.card-actions { display: flex; gap: var(--sp-3); }
.card-actions > .btn { flex: 1; }
.card-note { margin-top: var(--sp-3); font-size: 12px; color: var(--text-3); line-height: 1.6; }

/* 页脚 */
.footer {
  margin-top: var(--sp-8); padding: var(--sp-5) 0 var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.footer-brand { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 6px; color: var(--text-2); font-size: 13px; font-weight: 700; line-height: 1.5; }
.footer-brand span { color: var(--text-3); font-size: 12px; font-weight: 500; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; }
/* 页脚链接补足可点高度（移动端热区） */
.footer-links a { font-size: 12.5px; color: var(--text-2); display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; }
.footer-icp { display: inline-flex; align-items: center; min-height: 30px; padding: 0 4px; color: var(--text-3); font-size: 11px; white-space: nowrap; }
.footer-records { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 0 var(--sp-3); }
.footer-police { gap: var(--sp-1); }
:root[data-device="mobile"][data-layout="mobile"] .footer-records { flex-direction: column; gap: 0; }

/* -------------------------------------------------------------
   触控热区（审计口径 ≥40px）：手机端把三个「看着小、常按」的控件补足；
   桌面端不放大视觉，只把画板面板的小按钮调高一档（鼠标 / 触屏都好点）。
   ------------------------------------------------------------- */
:root[data-device="mobile"] .ai-acts .btn { height: 40px; }
/* 小按钮与图标按钮在手机端统一抬到 40px 热区（原来 34px，手指点着容易偏） */
:root[data-device="mobile"] .btn-sm { height: 40px; }
:root[data-device="mobile"] .icon-btn { min-width: 40px; min-height: 40px; }

/* -------------------------------------------------------------
   6. 客服弹层里的二维码
   （客服入口已挪进顶栏导航，右下角那颗悬浮球不再使用）
   ------------------------------------------------------------- */
.kefu-qr {
  width: 150px; height: 150px; margin: 0 auto;
  border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px; text-align: center; padding: 12px;
}
.kefu-qr--image { padding: 0; border: 0; border-radius: 0; background: transparent; }
.kefu-qr--image img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* -------------------------------------------------------------
   7. 帮助页折叠
   ------------------------------------------------------------- */
.acc { border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card); overflow: hidden; background: var(--surface); }
.acc + .acc { margin-top: var(--sp-2); }
.acc-head {
  width: 100%; display: flex; align-items: center; gap: var(--sp-3);
  min-height: var(--sp-16); padding: var(--sp-2) var(--sp-4); text-align: left;
}
.acc-head .qn {
  width: 24px; height: 24px; flex: none; border-radius: var(--r-sm);
  background: var(--primary-soft); color: var(--primary-strong);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
/* 帮助页序号：圆形底色，避免和正文糊成一片 */
.acc-idx {
  flex: none; width: var(--sp-6); height: var(--sp-6); border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-strong);
  font-size: 12.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.acc-title { display: block; font-size: var(--type-body); font-weight: var(--font-weight-semibold); line-height: var(--line-body); }
.acc-sum { display: block; margin-top: var(--sp-1); color: var(--text-3); font-size: var(--type-supporting); line-height: var(--line-supporting); }
.acc-arrow { flex: none; width: var(--sp-4); height: var(--sp-4); display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); transition: transform .18s var(--ease-mid); }
.acc.open .acc-arrow { transform: rotate(180deg); }
:root[data-layout="mobile"] .acc-wide {
  overflow: hidden; border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow-none);
}
:root[data-layout="mobile"] .acc-wide .acc { border: 0; border-radius: 0; background: transparent; }
:root[data-layout="mobile"] .acc-wide .acc + .acc { margin-top: 0; border-top: 1px solid color-mix(in srgb, var(--border) 62%, transparent); }
.acc-body { padding: 0 var(--sp-4) var(--sp-4); font-size: 14px; color: var(--text-2); line-height: 1.75; }
.acc-body p { margin: 0 0 8px; }
.acc-body ol { padding-left: 20px; list-style: decimal; }
.acc-body li { margin-bottom: 6px; }
.acc-body .kbd {
  display: inline-block; padding: 1px 6px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text);
}

/* -------------------------------------------------------------
   8. 画板
   ------------------------------------------------------------- */
.board-wrap {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column;
  background: var(--bg);
}
.board-top {
  flex: none; padding-top: var(--safe-t);
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.board-top .inner {
  height: 54px; padding: 0 var(--sp-2) 0 var(--sp-2);
  display: flex; align-items: center; gap: 2px;
}
.board-top-title { flex: none; min-width: 0; margin: 0; color: var(--text); font-size: 16px; font-weight: 700; line-height: 1.3; }
/* 画板返回：浅蓝底圆角，与子页返回按钮同一套语言 */
.board-top .icon-btn {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--primary-soft); color: var(--primary-strong);
}
.board-top .icon-btn:active { background: var(--primary-ghost); }
.board-top .tools { display: flex; align-items: center; margin-left: auto; gap: 0; }
.board-tool {
  height: 44px; min-width: 44px; padding: 0 9px; border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 17px; gap: 1px;
}
.board-tool span { font-size: 11px; }
.board-tool:active { background: var(--surface-2); }


/* 画布区 */
.board-main { flex: 1; display: flex; min-height: 0; position: relative; }
.board-stage {
  flex: 1; position: relative; overflow: hidden;
  background: var(--board-bg);
  touch-action: none;
}
.board-canvas-wrap { position: absolute; inset: 0; display: block; }
.board-canvas-wrap canvas { display: block; touch-action: none; }

/* 手机端：画布左侧浮动竖排工具条 */
.tool-rail {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  z-index: 6; display: flex; flex-direction: column; gap: 2px;
  padding: 4px 4px 5px; border-radius: var(--r-md);
  /* 老板 2026-09-23：缩小一档 + 更透的磨砂玻璃，别挡画布 */
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}
.tool-rail.dragging { box-shadow: var(--shadow-2); background: color-mix(in srgb, var(--surface) 86%, transparent); }
/* 裁边时让开：这个工具条会压住画布左边那条亮线（手机上实测挡住 2/3），
   淡出 + 不吃指针事件，四边就都能拖了；退出裁边（取消/应用）立刻恢复 */
.tool-rail.cropping { opacity: .3; pointer-events: none; transition: opacity .15s var(--ease-out); }
/* 顶部把手：按住上下拖（位置记进本机偏好） */
.tool-rail .rail-grip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: var(--h-lg); height: var(--h-lg); min-height: var(--h-lg); padding: 0;
  margin: 0 0 2px; border: 0; border-radius: 6px; background: transparent;
  cursor: grab; touch-action: none;
  color: var(--text-3);
}
.tool-rail .rail-grip:active { cursor: grabbing; background: var(--surface-2); }
.tool-rail .rail-grip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tool-rail .rail-grip i { width: 14px; height: 2px; border-radius: 2px; background: currentColor; opacity: .55; }
.rail-btn {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
/* 同上：画布左侧工具条 / 底部工具栏的选中态也加深，两端口径一致 */
.rail-btn.on {
  background: color-mix(in srgb, var(--primary) 24%, var(--surface));
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary) 50%, transparent);
}
.rail-btn:active { background: var(--surface-2); }

/* 切换工具时的中上浮提示：半透明液态玻璃小胶囊，停留一会儿向上淡出
   （只提示「当前切成了什么工具」，不吃点击、不挡画布） */
.tool-hint {
  /* 178px 是手机端与电脑端都空着的一条带：在模式开关/对齐尺寸按钮之下、图纸之上，
     正好是「中上」的位置，不压住任何控件 */
  position: fixed; top: calc(var(--safe-t) + 178px); left: 50%;
  z-index: 90; pointer-events: none; transform: translateX(-50%);
}
.tool-hint-in {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  border: 1px solid color-mix(in srgb, #fff 42%, transparent);
  box-shadow: 0 6px 18px rgba(16, 34, 71, .16);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  color: var(--text); font-size: 12.5px; font-weight: 700;
}
:root[data-theme="dark"] .tool-hint-in { border-color: rgba(255, 255, 255, .18); }
.tool-hint-enter-active { transition: opacity .18s var(--ease-out), transform .24s var(--ease-out); }
.tool-hint-leave-active { transition: opacity .26s ease-in, transform .26s ease-in; }
.tool-hint-enter-from { opacity: 0; transform: translate(-50%, 8px) scale(.94); }
.tool-hint-leave-to { opacity: 0; transform: translate(-50%, -12px) scale(.98); }

/* ================= 参数设置面板 ================= */
.board-settings { display: flex; flex-direction: column; background: var(--surface); }
.bs-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.bs-body { flex: 1; overflow-y: auto; padding: 2px 14px 20px; -webkit-overflow-scrolling: touch; }
.set-block { padding: 13px 0; border-bottom: 1px solid var(--border); }
.set-block:last-child { border-bottom: 0; }
.set-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 9px; }
.set-label.between { display: flex; align-items: center; justify-content: space-between; }
.input-sm { height: 34px; font-size: 14px; flex: 1; min-width: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tg-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text-2);
  font-size: 11px; font-weight: 600; line-height: 1.2;
}
/* ⚠️ 选中态加深一档（原来用 --primary-soft #E3EDFF，压在卡片底上几乎分不出来，
   老板反馈「一眼看不到当前选的是什么工具」）：22% 主色 + 一圈主色内描边 */
.tg-btn.on {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
  color: var(--primary-strong);
  font-weight: 800;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary) 50%, transparent);
}
.tg-btn:active { transform: scale(.97); }
/* 工具分组：上＝常用，下＝其它（浅灰分割线） */
.tg-divider {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 2px 8px;
  color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .4px;
}
.tg-divider::before, .tg-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.bs-mask {
  position: fixed; inset: 0; z-index: 120;
  background: var(--overlay); animation: fade-in .2s var(--ease-out);
  backdrop-filter: blur(2px);
}

/* 电脑端：面板常驻右侧 */
:root[data-device="pc"] .board-settings {
  position: static; width: 306px; flex: none;
  border-left: 1px solid var(--border);
}
:root[data-device="pc"] .bs-head .icon-btn { display: none; }
:root[data-device="pc"] .board-settings { transform: none !important; }

/* 手机端：底部抽屉 */
:root[data-device="mobile"] .board-settings {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 130;
  max-height: 84vh;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-3);
  padding-bottom: var(--safe-b);
  transform: translateY(103%);
  transition: transform .28s var(--ease-mid);
}
:root[data-device="mobile"] .board-settings.open { transform: none; }

/* 只有电脑端隐藏（手机端显示） */
:root[data-device="pc"] .pc-hide { display: none !important; }

/* 参数变更确认条（紧贴操作点，不遮全屏） */
.resize-confirm {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 9;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface); border: 1.5px solid var(--primary);
  box-shadow: var(--shadow-2);
  font-size: 12.5px; line-height: 1.55; color: var(--text-2);
}
.resize-confirm .btn { flex: none; }

/* -------------------------------------------------------------
   18. 画板 · 手机端浮动尺寸条（边看图纸边调尺寸）
   ------------------------------------------------------------- */
.size-bar {
  /* 从「尺寸」按钮下方长出来的小弹窗（靠右），不再是贴着画布底部的横条 */
  /* 104 → 114：上面那排「对齐 / 尺寸」热区改成 44px 后，弹窗要跟着往下让一格 */
  position: absolute; top: 114px; right: 10px; left: auto; bottom: auto; z-index: 8;
  width: min(320px, calc(100% - 20px));
  padding: 12px 14px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  transform-origin: top right;
}
.sb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.sb-title {
  flex: 1; display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--text);
}
/* 「保留内容」小开关：亮=改尺寸保留已画内容，暗=按新格重新生成（老板 2026-09-23） */
.sb-keep {
  flex: none; padding: 3px 9px; border-radius: var(--r-pill); cursor: pointer;
  font-size: 11.5px; font-weight: 700; line-height: 1.5;
  color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border);
}
.sb-keep.on { color: #fff; background: var(--primary); border-color: var(--primary); }
.sb-row { display: flex; align-items: center; gap: 9px; }
.sb-row + .sb-row { margin-top: 7px; }
.sb-sep { height: 1px; background: var(--border); margin: 10px 0 8px; }
.sb-lb { flex: none; width: 28px; font-size: 11.5px; font-weight: 600; color: var(--text-2); }

/* 画布右上角那排浮动按钮（对齐 / 尺寸）：贴在画布-底图开关下方靠右 */
.stage-fabs {
  position: absolute; top: 62px; right: 10px; z-index: 7;
  /* 固定宽度：要和上面的「画布 ⇄ 底图」同一左右边界（老板要求两行对齐） */
  display: flex; gap: 8px; width: 150px;
}
.fab-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: var(--h-lg); padding: 0 12px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12.5px; font-weight: 700;
  box-shadow: var(--shadow-1);
}
.fab-btn.on { font-weight: 800; }

/* 图片网格对齐：把画布正中的九格放大到一整块预览里对（画布原尺寸下只有几十像素，对不准） */
.align-mask {
  position: fixed; inset: 0; z-index: 125;
  background: var(--overlay); backdrop-filter: blur(2px);
  animation: fade-in .2s var(--ease-out);
}
.align-modal {
  position: fixed; z-index: 126; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(360px, calc(100% - 24px));
  max-height: 92vh; overflow-y: auto;      /* 小屏也不至于顶到屏幕边 */
  padding: var(--sp-4);
  border-radius: var(--r-featured);
  background: var(--surface);
  box-shadow: var(--shadow-3);
}
.am-head { display: flex; align-items: center; gap: 8px; }
.am-title {
  flex: 1; display: flex; align-items: center; gap: 6px;
  font-size: 14.5px; font-weight: 800; color: var(--text);
}
.am-desc { margin: 8px 0 0; font-size: 11.5px; line-height: 1.65; color: var(--text-2); }
.am-desc b { color: var(--primary-strong); }
.am-stage {
  position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 44vh;
  margin-top: 10px; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
  touch-action: none; cursor: grab;
}
.am-stage:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 2px; }
.am-stage:active { cursor: grabbing; }
.am-stage canvas { display: block; }
.am-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.am-num { flex: none; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
/* 另外两个对齐窗口（整个图纸的中上 / 中下） */
.am-pair { display: flex; gap: 8px; margin-top: 8px; }
.am-mini {
  position: relative; flex: 1 1 0; min-width: 0; aspect-ratio: 1 / 1; max-height: 20vh;
  border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
  touch-action: none; cursor: grab;
}
.am-mini canvas { display: block; }
.am-tag {
  position: absolute; left: 6px; top: 6px; z-index: 1;
  padding: 1px 7px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--text-2); font-size: 11px; font-weight: 700;
  backdrop-filter: blur(6px);
}
.am-hint { margin: 6px 0 0; font-size: 11px; line-height: 1.6; color: var(--text-3); }
/* 格线颜色选择 */
.am-colors { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.am-clb { flex: none; font-size: 11.5px; color: var(--text-2); }
.am-color {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border);
}
.am-color.on { box-shadow: 0 0 0 2px var(--primary); transform: scale(1.08); }

/* 手绘模式才能切「底图」：图片生成模式下这颗按钮不可用 */
.mode-switch .m.off { opacity: .45; }

/* 画布左上角的小号图纸信息 */
.board-info {
  position: absolute; top: 10px; left: 10px; z-index: 6;
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  color: var(--text-2); font-size: 11px; font-weight: 700;
  backdrop-filter: blur(8px);
}
.board-info i { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.sb-num {
  flex: none; width: 58px; height: 30px;
  text-align: center; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text);
  padding: 0 2px; outline: none;
}
.sb-num:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ghost); }

/* 生成中提示 */
.gen-tip {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--text) 88%, transparent);
  color: var(--bg); font-size: 12px; font-weight: 500;
  box-shadow: var(--shadow-2);
}
.spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------
   19. 画板 · 手机端底部（动作行 + 标签行）
   ------------------------------------------------------------- */
.board-bottom {
  position: relative;                 /* 工具弹窗以它为定位参照 */
  flex: none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
}
:root[data-device="pc"] .board-bottom { display: none; }

/* 单行可横滑工具栏（参照竞品：一排到底，右侧渐隐提示还能滑） */
/* 图纸操作：分组胶囊（浅底 + 主色图标 + 组间分割线） */
.op-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 2px;
}
.base-controls {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; min-width: 0;
  padding: var(--sp-2);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.base-opacity-control { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; gap: var(--sp-1); }
.base-opacity-control label { flex: none; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.base-opacity-control .base-opacity-slider { flex: 1 1 auto; width: auto; min-width: 56px; height: 24px; }
.base-opacity-value { flex: none; min-width: 36px; color: var(--text-2); font-size: 12px; text-align: right; }
.base-actions { display: flex; flex: none; align-items: center; gap: var(--sp-1); }
.base-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: var(--h-lg); min-height: var(--h-lg); padding: 0 var(--sp-2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.base-action:active { color: var(--primary-strong); background: var(--primary-soft); }
.base-opacity-slider:focus-visible, .base-action:focus-visible, .op-btn.base-rotate:focus-visible {
  outline: 2px solid var(--primary-strong); outline-offset: 2px;
}
.op-group {
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3px;
  box-shadow: var(--shadow-1);
}
.op-group + .op-group { position: relative; }
.op-btn {
  width: var(--h-lg); height: var(--h-lg); border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background-color .15s, color .15s;
}
.op-btn + .op-btn { box-shadow: inset 1px 0 0 var(--border); }
.op-btn:active { background: var(--primary-soft); color: var(--primary-strong); }
.op-btn[disabled] { opacity: .3; }
.op-bar-pc { padding: 0 0 10px; gap: 8px; }
.op-bar-pc .op-group { border-radius: 13px; padding: 2px; box-shadow: none; }
.op-bar-pc .op-btn { width: var(--h-sm); height: var(--h-sm); border-radius: 10px; }

.board-tools { position: relative; }
/* 底部工具弹窗：小窗 + 指向箭头 */
.tool-pop {
  position: absolute; bottom: calc(100% - 4px); z-index: 20;
  transform: translateX(-50%);
  width: min(300px, calc(100vw - 24px));
  padding: 12px 13px 13px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  animation: pop-in .2s var(--ease-out);
}
.tool-pop .tp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tool-pop .tp-title { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 800; color: var(--text); }
.tool-pop .tp-desc { margin: 0 0 10px; font-size: 11.5px; line-height: 1.65; color: var(--text-2); }
.tp-arrow {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px; background: var(--surface);
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  border-bottom-right-radius: 3px;
}
.bt-scroll {
  display: flex; gap: 4px;
  padding: 6px calc(var(--h-lg) + var(--sp-1)) 6px 8px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.bt-scroll::-webkit-scrollbar { display: none; }
.bt-item {
  flex: none; min-width: 64px; height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 0 6px; border-radius: var(--r-md);
  color: var(--text-2); font-size: 11px; font-weight: 600;
  scroll-snap-align: start;
}
.bt-item span { white-space: nowrap; }
.bt-item:active { background: var(--surface-2); }
.bt-item.on { color: var(--primary-strong); }
.bt-item[disabled] { opacity: .35; }

/* 画板里的可切换控件（工具条 / 底部栏 / 工具格 / 对齐·尺寸浮动按钮）统一选中态：
   22% 主色实底 + 1.5px 主色内描边。原来四个地方各写一套（20%/24%、42%/50%），口径不一致。 */
.rail-btn.on, .bt-item.on, .tg-btn.on, .fab-btn.on {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 46%, transparent);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary) 46%, transparent);
}
/* 右侧渐隐 + 小箭头：提示可以继续往右滑 */
.board-tools::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 34px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--surface) 72%);
}
.bt-hint {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
/* 右边还有工具时的圆形箭头按钮（可点，往右翻一屏；滚到底自动消失） */
.bt-more {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); z-index: 3;
  width: var(--h-lg); height: var(--h-lg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  box-shadow: var(--shadow-1);
}
.bt-more:active { background: var(--primary-soft); color: var(--primary-strong); }
/* 只在手机端生效的隐藏（电脑端保持原有布局） */
:root[data-device="mobile"] .mobile-hide { display: none !important; }


/* -------------------------------------------------------------
   20. 画板 · 参数设置卡片（一屏放得下）
   ------------------------------------------------------------- */
.scard {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 11px 11px;
}
.scard + .scard { margin-top: 9px; }
.sc-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: var(--text);
  margin-bottom: 9px;
}
.sc-title.between { justify-content: space-between; }
/* 卡片标题右侧的「▾ 说明」：默认收起，把长文案都藏进去，面板才能一屏放下 */
.sc-help-btn {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  height: 26px; padding: 0 9px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-3); font-size: 11px; font-weight: 700;
}
.sc-help-btn .cv { transition: transform .18s var(--ease-mid); }
.sc-help-btn.on { color: var(--primary-strong); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.sc-help-btn.on .cv { transform: rotate(180deg); }
.sc-help {
  margin: 7px 0 2px; padding-top: 7px; border-top: 1px dashed var(--border);
  font-size: 11.5px; line-height: 1.65; color: var(--text-3);
}
.sc-help b { color: var(--text-2); }
/* 标题右侧并排的两个小动作（色号高亮 / 全部色号） */
.sc-title-acts { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.sc-title-acts .t-hint { display: inline-flex; align-items: center; min-height: 26px; padding: 0 2px; }
.sc-row { display: flex; align-items: center; gap: 8px; }
.sc-row + .sc-row { margin-top: 8px; }
.sc-lb { flex: none; width: 58px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.sc-val { flex: none; width: 38px; text-align: right; font-size: 12.5px; color: var(--text-2); }
.select-sm { height: 32px; font-size: 13px; padding: 0 8px; flex: 1; }
.sw-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 9px 6px;
  max-height: 128px; overflow-y: auto;
  padding-right: 2px;
}
.sw-grid .chip { min-width: 0; }
.sc-info {
  display: flex; flex-wrap: wrap; gap: 5px 16px;
  font-size: 12px; color: var(--text-2);
}
.sc-info b { color: var(--text); font-weight: 700; }

/* 右上角 画布 ⇄ 底图 切换 */
.mode-switch {
  position: absolute; top: 10px; right: 10px; z-index: 6;
  /* 同上：和下面的「对齐 / 尺寸」两行左右对齐 */
  display: flex; align-items: center; width: 150px;
  /* 蓝底分段控件：与主色一致，不再用半透明白底（在浅色画布上会显得“浮着一块”） */
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-radius: var(--r-pill);
  padding: 3px; box-shadow: var(--shadow-1);
}
.mode-switch .m {
  position: relative; z-index: 1;
  flex: 1; height: 40px; min-width: 0; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 700; color: var(--primary-strong);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
/* ⚠️ 选中态不再用白字：滑块是「绝对定位的兄弟元素」，白字压在半透明/浅色容器上时
   对比度只有 1.2:1（审计会判不达标，肉眼在浅色画布上也不稳）。改成
   白滑块 + 深蓝字：压在容器上 6.0:1、压在滑块上 6.7:1，两种读数都达标。 */
.mode-switch .m.on { font-weight: 800; }
.mode-switch .slider {
  /* 高度必须与 .m 完全一致，否则高亮底会“偏上”，文字不在正中 */
  position: absolute; top: 3px; height: 40px; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform .28s var(--ease-mid), width .28s var(--ease-mid);
}

/* 缩放还原按钮 */
/* 新手引导的 3 步卡片 */
.gd-wrap { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.gd-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.gd-card b { color: var(--text); }
.gd-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
/* 进度条（生成图纸时） */
.gen-bar { width: 150px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.28); overflow: hidden; }
.gen-bar i { display: block; height: 100%; background: #fff; transition: width .18s linear; }
/* 草稿恢复提示条（贴着画布顶部） */
.draft-tip {
  position: absolute; left: 50%; transform: translateX(-50%); top: 10px; z-index: 9;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px;
  /* 手机端不再是一条撑爆的胶囊：限宽 + 文字两行（老板 2026-09-23 真机反馈） */
  max-width: calc(100% - 20px);
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-2); font-size: 12.5px; color: var(--text-2);
}
.draft-tip .dt-ico { flex: none; color: var(--text-3); }
.draft-tip .dt-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.draft-tip .dt-text b { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.draft-tip .dt-text small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.draft-tip .dt-acts { display: flex; align-items: center; gap: 6px; flex: none; }
/* 按钮比大按钮小一档，整条不超过一行高度 */
.draft-tip .btn { height: 32px; padding: 0 12px; font-size: 12.5px; }
/* 选区工具条（拖出虚线框后浮出） */
.sel-bar {
  position: absolute; z-index: 9;
  display: flex; align-items: center; gap: 2px;
  padding: 4px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(8px);
  animation: pop-in .16s var(--ease-out);
}
.sel-bar .sb-btn {
  height: 30px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; color: var(--text-2);
  white-space: nowrap;
}
.sel-bar .sb-btn:active { background: var(--surface-2); }
.sel-bar .sb-btn:hover { color: var(--primary-strong); background: var(--primary-soft); }
.sel-bar .sb-x { color: var(--text-3); }
.sel-bar .sb-sep { width: 1px; height: 18px; margin: 0 3px; background: var(--border); }

/* 裁边工具条：比选区那条多一段实时读数（四边各裁掉几格 / 保留多少格），窄屏自动折行 */
/* 整条不吃指针事件（只让按钮吃）：它浮在保留范围上方，别把上边那条亮线挡住 */
.crop-bar { flex-wrap: wrap; row-gap: 2px; max-width: min(600px, calc(100% - 16px)); pointer-events: none; }
.crop-bar button { pointer-events: auto; }
/* 手机端那条：直接排在画布下方的动作条里（不浮动、不遮画布） */
.crop-bar.inline { position: static; margin: 6px 8px 0; max-width: none; justify-content: center; }
.crop-bar .crop-lb {
  padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--text-2);
  white-space: nowrap;
}
.crop-bar .crop-lb b { color: var(--primary-strong); font-weight: 800; }
.crop-bar .crop-sep { display: inline-block; width: 1px; height: 12px; margin: 0 7px; background: var(--border); vertical-align: -2px; }
.crop-bar .crop-go { color: #fff; background: var(--primary); }
.crop-bar .crop-go:hover { color: #fff; background: var(--primary-strong); }

.reset-zoom {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 6; height: 34px; padding: 0 14px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border); box-shadow: var(--shadow-1);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  display: flex; align-items: center; gap: 5px;
  backdrop-filter: blur(8px);
}

/* 画布下方色号条 */
.palette-strip {
  flex: none;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 7px var(--sp-3) 5px;
}
.palette-strip .lbl { font-size: 11px; color: var(--text-3); margin-bottom: 5px; }
.palette-strip .lbl .t-hint { margin-left: 4px; }
.palette-strip .ps-all { height: 30px; padding: 0 12px; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.palette-scroll { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.palette-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 40px;
}
.chip .sw {
  width: 30px; height: 30px; border-radius: 9px;
  border: 2px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.chip .cd { font-size: 11px; color: var(--text-3); font-weight: 600; }
.chip.on .sw { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ghost); }
.chip.on .cd { color: var(--primary-strong); }
/* 色号高亮：被高亮的那一个色号加一圈深色描边（和「当前色号」区分开） */
.chip.hl .sw { border-color: var(--primary-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 34%, transparent); }
/* 去杂色阈值可视化：占比低于阈值的色号描红虚线圈（去杂色时会被并掉的那几个） */
.chip.minor .sw { outline: 1.5px dashed var(--danger); outline-offset: 2px; }
.chip.minor .cd { color: var(--danger-strong); }   /* 红字压在浅色底上要够深：--danger 只有 3.28:1，AA 要求 4.5:1 */
/* 对称绘制的四种方式 */
.sym-row { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.sym-row .sym-lb { flex: none; font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.sym-btn {
  flex: 1; height: 26px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 700; color: var(--text-2);
}
.sym-btn.on { background: color-mix(in srgb, var(--primary) 22%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 46%, transparent); color: var(--primary-strong); }

/* 底部工具栏 */
.board-bottombar {
  flex: none;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px var(--sp-2) calc(6px + var(--safe-b));
}
.tool-scroll { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tool-scroll::-webkit-scrollbar { display: none; }
.tool {
  flex: none; width: 56px; height: 50px; border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-2); font-size: 18px;
}
.tool span { font-size: 11px; font-weight: 600; }
.tool:active { background: var(--surface-2); }
.tool.on { background: var(--primary-soft); color: var(--primary-strong); }
.tool[disabled] { opacity: .35; }

/* 底图设置面板 */
.subpanel {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-3); box-shadow: var(--shadow-2);
  backdrop-filter: blur(10px);
}
.subpanel .line { display: flex; align-items: center; gap: var(--sp-3); }
.subpanel .line + .line { margin-top: 10px; }
.subpanel .line label { font-size: 12.5px; color: var(--text-2); width: 52px; flex: none; }

/* 首页卡密：只保留两枚按钮（老板要求去掉多余文字） */
.ck-min { padding: 12px; }
.ck-min .ck-actions { display: flex; gap: 10px; }
.ck-min .ck-actions .btn { flex: 1; height: 46px; }
/* 卡密卡直接跟在效果展示后面，间距收小 */
.card-key.ck-min { margin-top: 14px; }

/* 下载设置弹窗内的设置行 */
.set-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.set-row:last-child { border-bottom: 0; }
.set-row .lb { font-size: 14px; font-weight: 500; }
.set-row .lb { display: block; }
/* 说明小字放到标题下面（老板要求），整体更紧凑 */
.set-row .ds { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.set-row { padding: 9px 0; }
.set-col { padding: 9px 0; }
.set-col { padding: 11px 0; border-bottom: 1px solid var(--border); }
.seg-mini { display: inline-flex; background: var(--surface-3); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg-mini button {
  height: 28px; padding: 0 10px; border-radius: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
  transition: color .16s var(--ease-mid), background-color .16s var(--ease-mid), box-shadow .16s var(--ease-mid);
}
.seg-mini button.on { background: var(--surface); color: var(--primary-strong); box-shadow: var(--shadow-1); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.swatches button {
  width: 28px; height: 28px; border-radius: 8px;
  border: 2px solid var(--border); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.swatches button.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ghost); }

/* -------------------------------------------------------------
   9. 图纸列表
   ------------------------------------------------------------- */
.tabs-line { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--border); position: relative; }
.tabs-line button {
  position: relative; display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: var(--h-lg); padding: 10px 0; font-size: 14.5px; font-weight: 600; color: var(--text-2);
  transition: color .16s var(--ease-mid), background-color .16s var(--ease-mid);
}
.tabs-line button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-xs); }
.tabs-line button.on { color: var(--primary-strong); }
.dwg-tab-count {
  min-width: 20px; height: 20px; padding: 0 var(--sp-1); border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-3); font-size: 11px; font-weight: 700;
  transition: background-color .16s var(--ease-mid), color .16s var(--ease-mid);
}
.tabs-line button.on .dwg-tab-count { background: var(--primary-soft); color: var(--primary-strong); }
/* 下划线指示器跟着选中的标签滑动（老板给的「顶部标签页跟手」） */
.tabs-line .tl-ink {
  position: absolute; left: 0; bottom: -1px; height: 2.5px; width: 0;
  border-radius: 2px; background: var(--primary);
  transition: transform .22s var(--ease-mid), width .22s var(--ease-mid);
}
/* 我的图纸：本地 / 云端是存储页签；模板库在同一行作为独立入口。 */
.dwg-bar { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.dwg-bar .tabs-line { flex: 0 1 auto; min-width: 0; gap: var(--sp-3); }
.dwg-bar .btn-template { min-height: var(--h-lg); flex: 0 0 auto; margin-left: auto; }
.drawings-empty { padding: var(--sp-6) var(--sp-4); }
.drawings-empty .empty-icon {
  width: 48px; height: 48px; margin: 0 auto var(--sp-3); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary-strong); opacity: 1;
}
.drawings-empty-title { margin: 0; color: var(--text); font-size: 16px; font-weight: 700; }
.drawings-empty-copy { max-width: 360px; margin: var(--sp-1) auto 0; line-height: 1.55; }
.drawings-empty .btn { min-height: var(--h-lg); margin-top: var(--sp-4); }
:root[data-layout="mobile"] .drawings-empty {
  min-height: clamp(15rem, calc(100dvh - 26rem), 30rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* -------------------------------------------------------------
   模板库：入口按钮（与普通按钮区分） + 卡片流
   ------------------------------------------------------------- */
/* 入口按钮：主色描边 + 浅色底，和实底主按钮明显区分 */
.btn-template {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border: 1.5px solid color-mix(in srgb, var(--primary) 55%, transparent);
  font-weight: 700;
}
.btn-template:hover { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }

/* 瀑布流：两列（电脑端四列），封面按原比例 → 卡片高低自然错落（小红书那种） */
.tpl-flow { column-count: 2; column-gap: var(--sp-3); }
/* 电脑端复刻小红书：5 列瀑布流（1220px 内容区 → 每列约 217px，和那边密度一致） */
:root[data-device="pc"] .tpl-flow { column-count: 5; column-gap: 16px; }
.tpl-card {
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card);
  overflow: hidden; display: flex; flex-direction: column;
  break-inside: avoid; margin: 0 0 var(--sp-3);
}
.tpl-cover {
  position: relative; width: 100%; padding: 0; border: 0; cursor: pointer;
  background: var(--surface-2); display: block; line-height: 0;
  transition: opacity .16s var(--ease-mid);
}
.tpl-cover:active { opacity: .9; }
@media (hover: hover) and (pointer: fine) {
  .tpl-cover:hover { opacity: .96; }
}
/* 关键：宽度铺满、高度按原比例（16:9 横、9:16 竖都不裁切） */
.tpl-cover img { width: 100%; height: auto; display: block; }
.tpl-cover-ph {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; font-size: 12px; color: var(--text-3); line-height: 1.5;
}
/* 非会员：封面做隐私模糊罩 + 中间一把锁，且不支持放大 */
.tpl-cover .blur { filter: blur(7px); transform: scale(1.06); }
.tpl-lock {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(11, 18, 32, .18);
}
.tpl-lock::before {
  content: ''; position: absolute; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(11, 18, 32, .5);
}
.tpl-lock .y-icon, .tpl-lock svg { position: relative; }
/* 封面右下角：下载量 */
.tpl-dl {
  position: absolute; right: 6px; bottom: 6px;
  font-size: 11px; font-weight: 700; color: #fff; line-height: 1.55;   /* 父级 line-height:0 会把角标压扁，这里显式给回 */
  background: rgba(11, 18, 32, .55); border-radius: var(--r-pill); padding: 2px 7px;
  backdrop-filter: blur(2px);
}
.tpl-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.tpl-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.tpl-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 11px; color: var(--text-3); }
:root[data-layout="mobile"] .tpl-empty {
  min-height: clamp(15rem, calc(100dvh - 22.5rem), 30rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* 模板页：搜索框 + 标签筛选（标签由后台自定义） */
.tpl-search {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; padding: 0 12px; height: 42px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  color: var(--text-3);
}
.tpl-search-input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font-size: 14px; color: var(--text); font-family: inherit;
}
.tpl-search-input:focus { outline: none; }
.tpl-search-clear {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--text-3); cursor: pointer;
}
.tpl-tags { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 4px; }
.tpl-tags::-webkit-scrollbar { display: none; }
.tpl-tag {
  white-space: nowrap; padding: 6px 12px; border-radius: var(--r-pill); font-size: 12.5px;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border); cursor: pointer;
}
:root[data-layout="mobile"] .tpl-tag { min-height: var(--h-lg); }
.tpl-tag.on { background: var(--primary); border-color: var(--primary); color: var(--text-invert); font-weight: 600; }
.tpl-tag-n { margin-left: 5px; opacity: .7; font-size: 11px; }
.tpl-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tpl-chip {
  padding: 2px 7px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-3); font-size: 10.5px;
}
.tv-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

/* 使用帮助 · 视频教程：Grouped List，视频仍按原回调打开外部平台。 */
.hv-list {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow-none);
}
.hv-item {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--sp-16); text-align: left;
  padding: var(--sp-2) var(--sp-4); border: 0; border-radius: 0;
  background: transparent; color: var(--text); cursor: pointer;
}
.hv-item + .hv-item { border-top: 1px solid color-mix(in srgb, var(--border) 62%, transparent); }
.hv-item:hover { background: var(--surface-2); }
/* 播放小三角：纯 CSS 画，不占用图标集 */
.hv-play {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); position: relative;
}
.hv-play::before {
  content: ''; position: absolute; left: 10px; top: 7px;
  border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.hv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hv-title { font-size: var(--type-body); font-weight: var(--font-weight-semibold); line-height: var(--line-body); color: var(--text); }
.hv-sub { font-size: var(--type-supporting); line-height: var(--line-supporting); color: var(--text-3); }
.hv-go { flex: 0 0 auto; width: var(--sp-4); height: var(--sp-4); color: var(--text-3); }
/* 「标题 + 图片」的那种：封面小图代替播放小标 */
.hv-cover {
  flex: 0 0 auto; width: 60px; height: 45px; border-radius: var(--r-sm);
  object-fit: cover; border: 1px solid var(--border);
}
.hv-empty { margin: 0; padding: 4px 2px; font-size: 12px; color: var(--text-3); }

/* 详情页：大图按原比例展示 + 底部固定「下载 / 编辑」 */
.tpl-view {
  position: fixed; inset: 0; z-index: 260;
  background: rgba(8, 14, 26, .92);
  display: flex; flex-direction: column;
}
.tv-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 14px; }
/* 整张图纸按原比例铺满可用宽度（小图也放大到看得清），超过高度就按比例缩回去 */
.tv-img { width: 100%; max-width: 820px; height: auto; max-height: 100%; object-fit: contain; border-radius: var(--r-md); }
.tv-bar {
  flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px calc(12px + var(--safe-b, 0px));
  background: var(--surface); border-top: 1px solid var(--border);
}
.tv-info { flex: 1 1 180px; min-width: 0; }
.tv-title { font-size: 14.5px; font-weight: 800; color: var(--text); }
.tv-meta { margin-top: 3px; font-size: 11.5px; color: var(--text-3); }
.tv-acts { flex: none; display: flex; gap: 8px; }
.tv-acts .btn { display: inline-flex; align-items: center; gap: 5px; }
.tv-close {
  position: absolute; right: 12px; top: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(255, 255, 255, .16); border: 0; cursor: pointer;
}

.list { display: flex; flex-direction: column; gap: var(--sp-3); }
.item {
  position: relative;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: var(--r-card);
  overflow: hidden;
}
.item-thumb {
  width: 56px; height: 56px; flex: none; border-radius: var(--r-md);
  /* 缩略图占位：画成「网格纸」而不是一块空灰块 */
  background-color: var(--surface-2);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 7px, color-mix(in srgb, var(--primary) 14%, transparent) 7px 8px),
    repeating-linear-gradient(90deg, transparent 0 7px, color-mix(in srgb, var(--primary) 14%, transparent) 7px 8px);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
}
.drawing-open {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sp-3);
  padding: 0; border: 0; border-radius: var(--r-control); background: transparent;
  color: inherit; text-align: left; cursor: pointer;
  transition: background-color .16s var(--ease-mid);
}
.drawing-open:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.drawing-open:active { background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) {
  .drawing-open:hover { background: var(--surface-2); }
}
/* 网格间隔滑条的 5 个刻度点：一眼看出能调到几 */
/* 网格线间隔：刻度是「空心圆」，直接骑在滑杆的轨道上（轨道从圆心穿过），
   滑杆圆头与刻度同宽，正好落在刻度正中心 */
.dl-range { position: relative; margin-top: 10px; }
.tick-row {
  position: absolute; left: 0; right: 0; top: 13px;   /* 滑杆高 26px、轨道 4px → 轨道中线在 13px */
  transform: translateY(-50%);
  display: flex; justify-content: space-between;
  pointer-events: none; z-index: 1;
}
.tick-row i {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border-2); background: transparent;
  transition: border-color .16s var(--ease-mid), transform .18s var(--ease-mid);
}
.tick-row i.on { border-color: var(--primary); transform: scale(1.12); }
/* 专用滑杆：命中区够高（好拖、跟手），轨道很细，圆头是空心的，和上面的刻度对齐 */
.dl-slider {
  -webkit-appearance: none; appearance: none;
  /* display:block + margin:0 是必须的：range 默认是行内元素且自带 2px 外边距，
     会让滑杆整体右移 2px（圆头对不上刻度），并把弹窗撑出横向滚动条 */
  display: block; margin: 0;
  width: 100%; height: 44px; background: transparent; outline: none;
  touch-action: none;
}
.tick-row { top: 22px; }
.dl-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--surface-3); }
.dl-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -5px;
  border-radius: 50%; border: 2px solid var(--primary); background: var(--surface);
  box-shadow: var(--shadow-1); cursor: pointer;
}

/* 下载设置：名称、导出选项、网格设置依次排列，不占用实时预览空间。 */
.modal:has(.dl-layout) { max-width: 560px; }
.modal:has(.dl-layout) > .modal-actions > .btn { min-width: 0; }
.dl-layout, .dl-settings { display: grid; gap: var(--sp-3); min-width: 0; text-align: left; }
.dl-field { min-width: 0; }
.dl-field > .lb { display: block; margin-bottom: var(--sp-2); }
.dl-field > .input { min-height: var(--h-lg); }
.dl-field > .ds { display: block; margin-top: var(--sp-1); line-height: 1.5; }
.dl-settings-section { display: grid; gap: var(--sp-2); min-width: 0; }
.dl-grid-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.dl-grid-toggle { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--text-2); font-size: 12px; font-weight: 600; }
.dl-grid-switch.switch { width: 46px; height: 44px; background: transparent; }
.dl-grid-switch.switch::before {
  content: ""; position: absolute; inset: 50% 0 auto; height: 27px; transform: translateY(-50%);
  border-radius: var(--r-pill); background: var(--surface-3); transition: background-color .18s var(--ease-mid);
}
.dl-grid-switch.switch.on { background: transparent; }
.dl-grid-switch.switch.on::before { background: var(--primary); }
.dl-grid-switch.switch::after { top: 50%; transform: translateY(-50%); }
.dl-grid-switch.switch.on::after { transform: translate(19px, -50%); }
.dl-group-title { margin: 0; color: var(--text-2); font-size: 13px; font-weight: 700; line-height: 1.3; }
.dl-switch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.dl-switch-card, .dl-control-card {
  min-width: 0; padding: var(--sp-3); border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface-2); text-align: left;
}
.dl-switch-card { padding: var(--sp-2); }
.dl-control-card { padding: var(--sp-2); }
.dl-switch-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.dl-switch-card .lb { min-width: 0; font-size: 13px; font-weight: 600; }
.dl-switch-card .ds, .dl-control-card > .ds { display: block; margin-top: var(--sp-1); line-height: 1.45; }
.dl-adjust-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.dl-control-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
/* 视觉轨道维持原尺寸，按钮本身扩到 44px 高，方便触屏和键盘操作。 */
.dl-switch-card .switch { width: 46px; height: 44px; background: transparent; }
.dl-switch-card .switch::before {
  content: ""; position: absolute; inset: 50% 0 auto; height: 27px; transform: translateY(-50%);
  border-radius: var(--r-pill); background: var(--surface-3); transition: background-color .18s var(--ease-mid);
}
.dl-switch-card .switch.on { background: transparent; }
.dl-switch-card .switch.on::before { background: var(--primary); }
.dl-switch-card .switch::after { top: 50%; transform: translateY(-50%); }
.dl-switch-card .switch.on::after { transform: translate(19px, -50%); }
.dl-control-card .swatches { gap: var(--sp-1); margin-top: var(--sp-1); }
.dl-control-card .swatches button { width: 44px; height: 44px; flex: none; border-radius: var(--r-sm); }
.dl-control-card .dl-range { margin-top: var(--sp-1); }
.dl-switch-card .switch:focus-visible, .dl-grid-switch:focus-visible, .dl-control-card .swatches button:focus-visible,
.dl-field .input:focus-visible, .dl-slider:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
:root[data-device="mobile"] .dl-adjust-grid { grid-template-columns: minmax(0, 1fr); }
:root[data-device="mobile"] .dl-settings { gap: var(--sp-2); }
:root[data-device="mobile"] .dl-settings-section { gap: var(--sp-1); }
:root[data-device="mobile"] .dl-field > .lb { margin-bottom: var(--sp-1); }
:root[data-device="mobile"] .dl-switch-grid { gap: var(--sp-1); }
:root[data-device="mobile"] .dl-switch-card { padding: var(--sp-1); }
:root[data-device="mobile"] .dl-control-card .swatches {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
}
:root[data-device="mobile"] .dl-control-card .swatches button { width: 100%; min-width: 0; }
@media (max-width: 359px) {
  .dl-switch-card { padding: var(--sp-1); }
  .dl-switch-card .lb, .dl-switch-card .ds { font-size: 11px; }
}
.dl-slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--surface-3); }
.dl-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--primary); background: var(--surface); cursor: pointer;
}
.item-thumb canvas, .item-thumb img { width: 100%; height: 100%; object-fit: contain; }
.item-dimensions { color: var(--text-3); font-size: 10px; }
.item-body { flex: 1; min-width: 0; }
.drawing-title-row { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.item-title { font-size: 14.5px; font-weight: 600; }
.drawing-title-row .item-title { flex: 1; min-width: 0; }
.drawing-storage-tag {
  flex: none; min-height: 20px; padding: 0 var(--sp-2); border-radius: var(--r-pill);
  display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700;
}
.drawing-storage-tag.is-local { background: var(--primary-soft); color: var(--primary-strong); }
.drawing-storage-tag.is-cloud { background: var(--surface-2); color: var(--text-2); }
.item-meta {
  font-size: 11.5px; color: var(--text-3); margin-top: var(--sp-1);
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
}
.drawing-date {
  display: flex; align-items: center; gap: var(--sp-1);
  margin-top: var(--sp-1); color: var(--text-3); font-size: 11.5px;
}
.drawing-mode-tag { height: 18px; font-size: 10px; }

/* 左滑删除 */
.swipe { position: relative; overflow: hidden; border-radius: var(--r-card); }
.swipe-inner { position: relative; z-index: 1; background: var(--surface); transition: transform .24s var(--ease-out); }
.swipe-actions {
  position: absolute; inset: 0 0 0 auto; display: flex;
  width: 160px;
}
.swipe-actions button {
  flex: 1; color: #fff; font-size: 14px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.swipe-actions .del { background: var(--danger); }
.swipe-actions .more { background: var(--text-3); }
/* 落点预览：滑过阈值时即将停靠的按钮轻微放大 + 加内阴影，松手前就知道会停在哪个操作上 */
.swipe-actions button { transition: transform .18s var(--ease-mid), box-shadow .18s var(--ease-mid); }
.swipe.will-open .swipe-actions button { transform: scale(1.04); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }

/* 长按多选：左侧勾选圈 + 选中态外框 */
.pick-dot {
  position: absolute; left: 10px; top: 50%; margin-top: -11px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-2); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; transition: background-color .16s var(--ease-mid), border-color .16s var(--ease-mid);
}
.swipe.picking .item { padding-left: 40px; }
.swipe.on .pick-dot { background: var(--primary); border-color: var(--primary); }
.swipe.on .item { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }

/* 吸底操作栏：左统计 + 右操作，自动避开底部安全区（老板给的组件⑦） */
.select-dock {
  position: fixed; left: 0; right: 0; z-index: 88;
  bottom: calc(var(--tab-h) + var(--safe-b));
  display: flex; align-items: center; gap: 8px;
  max-width: var(--page-max); margin: 0 auto;
  padding: 10px var(--sp-4);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-top: 1px solid var(--border);
}
:root[data-device="pc"] .select-dock { max-width: 1100px; bottom: 0; border-radius: 16px 16px 0 0; }
.select-dock .sd-info { flex: 1; font-size: 13px; color: var(--text-2); }
.select-dock .sd-info b { color: var(--primary-strong); font-size: 15px; }
.select-dock .btn { flex: none; }

/* 下拉刷新提示（仅手机端手势用） */
.chip-scroll {
  gap: 8px; flex-wrap: nowrap; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 2px;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip-scroll > * { flex: none; scroll-snap-align: center; }

.pull-tip {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  overflow: hidden; font-size: 12px; color: var(--text-3);
  transition: height .22s var(--ease-out);
}
.pull-tip .spin { width: 14px; height: 14px; border-width: 2px; }

/* 全屏看图：深底、左右滑动翻页、可切原图/图纸（App 式图片浏览） */
.img-viewer {
  position: fixed; inset: 0; z-index: 190;
  background: rgba(8, 14, 26, .94);
  display: flex; flex-direction: column;
  animation: fade-in .18s var(--ease-out);
  touch-action: pan-y;
}
.img-viewer.out { animation: fade-in .18s var(--ease-in) reverse; }
.img-viewer .iv-bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 12px) 14px 10px;
  color: #fff; font-size: 13px;
}
.img-viewer .iv-title { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-viewer .iv-count { flex: none; opacity: .7; font-variant-numeric: tabular-nums; }
.img-viewer .iv-side {
  flex: none; height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 12px; font-weight: 700;
}
.img-viewer .iv-close { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.img-viewer .iv-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 10px 20px; overflow: hidden; }
.img-viewer .iv-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: var(--r-md); transition: transform .22s var(--ease-out);
}
.img-viewer .iv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.img-viewer .iv-nav.prev { left: 10px; }
.img-viewer .iv-nav.next { right: 10px; }
.img-viewer .iv-nav:active { background: rgba(255, 255, 255, .3); }
@keyframes iv-in { from { opacity: .3; transform: scale(.98); } to { opacity: 1; transform: none; } }

/* -------------------------------------------------------------
   10. 我的
   ------------------------------------------------------------- */
.me-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-5) 0 var(--sp-4);
}
/* 账户卡：身份与会员权益合并，减少页面卡片层数。 */
.mine-account-card {
  margin-top: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-featured);
  background: var(--surface); box-shadow: var(--shadow-subtle);
}
.mine-account-head { display: flex; align-items: center; gap: var(--sp-3); }
.mine-account-identity { flex: 1 1 auto; min-width: 0; }
.mine-account-name-row { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--sp-2); min-width: 0; }
.mine-account-name { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--text); font-size: 18px; font-weight: 750; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
@supports (mask-image: linear-gradient(90deg, #000 0%, transparent 100%)) or (-webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 100%)) {
  .mine-account-name { text-overflow: clip; -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 82%, transparent 100%); mask-image: linear-gradient(90deg, #000 0%, #000 82%, transparent 100%); }
}
.mine-membership-badge { display: inline-flex; align-items: center; justify-content: center; height: var(--h-md); min-height: 36px; flex: 0 0 auto; flex-shrink: 0; padding: 0 var(--sp-4); border: 1px solid var(--border-2); border-radius: var(--r-control); background: var(--primary-soft); color: var(--primary-strong); font-size: var(--type-body); font-weight: var(--font-weight-bold); line-height: 1; white-space: nowrap; transform: translateY(calc((var(--sp-1) + 40px) / 2)); }
.mine-account-card .me-avatar { width: 60px; height: 60px; }
.mine-account-card .mine-account-name-row { padding-right: var(--sp-1); }
.mine-account-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin-top: var(--sp-1); }
.mine-account-card .mine-account-meta { flex-wrap: nowrap; gap: 0; margin-top: var(--sp-1); }
.mine-account-data { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 0; color: var(--text-2); font-size: 13px; }
.mine-account-data small { flex: none; font-size: 13px; }
.mine-account-card .mine-account-data small { color: var(--text-3); font-size: 13px; }
.mine-account-data b { overflow: hidden; color: var(--text); font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.mine-account-card .mine-account-data--id { flex: none; gap: calc(var(--sp-1) / 2); white-space: nowrap; }
.mine-account-card .mine-account-data--id small { color: var(--text-2); font-weight: var(--font-weight-regular); line-height: 1.2; }
.mine-account-card .mine-account-data--id b { font-family: inherit; font-variant-numeric: tabular-nums; line-height: 1.2; }
.mine-account-copy { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: var(--r-control); background: transparent; color: var(--text-2); }
.mine-account-data--id .mine-account-copy { justify-content: flex-start; padding-left: var(--sp-2); }
.mine-account-copy::before { content: ''; position: absolute; inset: 0; width: var(--h-xs); height: var(--h-xs); margin: auto; border-radius: var(--r-control); background: transparent; pointer-events: none; }
.mine-account-copy > span { position: relative; }
.mine-account-copy:active { color: var(--primary-strong); }
.mine-account-copy:active::before { background: var(--primary-soft); }
.mine-account-copy:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 2px; }
@media (max-width: 359px) {
  .mine-account-card { margin-inline: calc(-1 * var(--sp-2)); padding-inline: var(--sp-2); }
  .mine-account-card .mine-account-head { gap: var(--sp-1); }
  .mine-account-card .mine-account-name-row { padding-right: 0; }
}
.mine-account-membership { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.mine-account-plan-icon { flex: none; color: var(--primary-strong); }
.mine-account-membership-copy { flex: 1 1 auto; min-width: 0; }
.mine-account-status-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); }
.mine-account-card .mine-account-membership-copy { display: flex; align-items: center; gap: var(--sp-2); }
.mine-account-card .mine-account-status-line { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; white-space: nowrap; }
.mine-account-plan { color: var(--primary-strong); font-size: 14px; font-weight: 700; }
.mine-account-status-line strong { color: var(--text); font-size: 14px; font-weight: 700; }
.mine-account-membership-copy > small { display: block; margin-top: var(--sp-1); color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.mine-account-card .mine-account-membership-copy > small { flex: none; margin-top: 0; text-align: right; white-space: nowrap; }
.mine-account-membership.is-inactive .mine-account-plan-icon,
.mine-account-membership.is-inactive .mine-account-plan,
.mine-account-membership.is-inactive .mine-account-status-line strong { color: var(--text-3); }
.mine-account-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); margin-top: var(--sp-3); }
.mine-account-actions .btn { width: 100%; min-width: 0; height: var(--h-lg); padding-inline: var(--sp-2); white-space: nowrap; }

/* 未登录：登录引导卡（参考竞品：圆形图标 + 标题 + 副标题 + 主按钮） */
.login-cta {
  margin-top: var(--sp-4); padding: 30px 20px 26px;
  border-radius: var(--r-xl); background: var(--surface);
  box-shadow: var(--shadow-1); text-align: center;
}
.login-cta .lc-ico {
  width: 78px; height: 78px; margin: 0 auto; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.login-cta .lc-t { margin-top: 16px; font-size: 19px; font-weight: 800; color: var(--text); }
.login-cta .lc-d { margin-top: 6px; font-size: 13px; color: var(--text-3); }
.login-cta .lc-btn { margin-top: 20px; height: 46px; padding: 0 26px; }

.me-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: var(--primary-grad); color: #fff;
  font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.me-avatar img, .ab-avatar img, .settings-avatar-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.mine-settings-link { min-height: var(--h-lg); display: inline-flex; align-items: center; gap: 7px; flex: none; }
.mine-page-header .mine-settings-link { height: 44px; min-height: 44px; gap: var(--sp-1); padding-inline: var(--sp-3); border-color: color-mix(in srgb, var(--primary) 26%, var(--border)); border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-strong); box-shadow: none; font-size: 13px; font-weight: 700; }
.acc-banner .ab-avatar { overflow: hidden; }
.mine-page-header + .login-cta, .mine-page-header + .mine-account-card { margin-top: var(--sp-3); }
.cell-group { border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-none); }
.mine-sec--light .cell-group { margin: 0; padding: 0; border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card); background: var(--surface); list-style: none; overflow: hidden; box-shadow: var(--shadow-none); }
.cell {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: var(--h-lg); padding: var(--sp-2) var(--sp-4); width: 100%; text-align: left;
}
.cell + .cell { border-top: 1px solid color-mix(in srgb, var(--border) 62%, transparent); }
.mine-sec--light .cell-group > li + li { border-top: 1px solid color-mix(in srgb, var(--border) 62%, transparent); }
.cell .ico { width: var(--sp-6); height: var(--sp-6); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cell .tt { flex: 1; font-size: var(--type-body); font-weight: var(--font-weight-semibold); line-height: var(--line-body); }
/* 列表行支持两行文案：标题 + 灰色小字说明（未登录的「主题外观 / 联系客服」用） */
.cell .tt small { display: block; margin-top: var(--sp-1); font-size: var(--type-supporting); font-weight: var(--font-weight-regular); line-height: var(--line-supporting); color: var(--text-3); }
.cell .rt {
  font-size: var(--type-supporting); line-height: var(--line-supporting); color: var(--text-3);
  /* 右侧说明太长时省略号收尾，别把左边标题挤到换行（老板 2026-09-23：色卡参考换行了） */
  flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cell .ar { width: var(--sp-4); height: var(--sp-4); display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); flex: none; }
.cell.danger .tt { color: var(--danger); }

/* 账户设置 */
.settings-intro { margin: var(--sp-4) 0 var(--sp-5); color: var(--text-2); font-size: 14px; line-height: 1.6; }
.settings-group { margin: 0; }
.settings-group > h2.section-title { padding: 0; }
.settings-list {
  overflow: hidden; border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow-none);
}
.settings-row {
  width: 100%; min-height: var(--sp-16); display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4); text-align: left; color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 62%, transparent);
  transition: background-color .15s var(--ease-mid);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row:hover, .settings-row:active { background: var(--surface-2); }
.settings-row-icon { width: var(--sp-6); height: var(--sp-6); flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--primary-strong); }
.settings-row-copy { min-width: 0; flex: 1; display: grid; gap: var(--sp-1); }
.settings-row-copy b { font-size: var(--type-item-title); font-weight: var(--font-weight-semibold); line-height: var(--line-item-title); }
.settings-row-copy small { color: var(--text-3); font-size: var(--type-supporting); line-height: var(--line-supporting); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-row-arrow { width: var(--sp-6); height: var(--sp-6); display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--text-3); }
.settings-more { margin-top: var(--sp-6); }
.settings-card {
  margin: 0 0 var(--sp-4); padding: var(--sp-5);
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: var(--r-card);
  background: var(--surface); box-shadow: none;
}
.help-contact { border-radius: var(--r-card); }
.settings-card h2 { margin: 0 0 var(--sp-4); font-size: 17px; font-weight: 800; }
.settings-note { display: block; color: var(--text-3); font-size: 12.5px; line-height: 1.55; }
.settings-avatar-row { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.settings-avatar-preview {
  display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden;
  width: 72px; height: 72px; border-radius: 50%; background: var(--primary-grad); color: #fff;
  font-size: 26px; font-weight: 800; box-shadow: 0 0 0 4px var(--primary-ghost);
}
.settings-avatar-actions { display: grid; gap: 6px; min-width: 0; }
.settings-file-label { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: var(--h-lg); width: fit-content; cursor: pointer; }
.settings-file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.settings-file-label:focus-within { outline: 2px solid var(--primary-strong); outline-offset: 3px; }
.settings-form { display: grid; gap: var(--sp-3); }
.settings-form .field { display: grid; gap: 6px; }
.settings-form .field-label { color: var(--text); font-size: 13.5px; font-weight: 700; }
.settings-form .input { min-height: var(--h-lg); }
.settings-form .btn { min-height: var(--h-lg); justify-self: start; }
.settings-inline { display: flex; align-items: center; gap: var(--sp-2); }
.settings-inline .input { min-width: 0; flex: 1; }
.settings-inline .btn { flex: none; white-space: nowrap; }
.settings-password { border-top: 1px solid color-mix(in srgb, var(--border) 62%, transparent); margin-top: var(--sp-5); padding-top: var(--sp-5); }
.settings-message { min-height: 1.4em; margin: 0; color: var(--danger-strong); font-size: 13px; line-height: 1.45; }
.settings-message:empty { display: none; }
.settings-message.success { color: var(--primary-strong); }
.settings-modal-options { display: grid; gap: var(--sp-4); text-align: left; }
.settings-modal-options fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-modal-options fieldset:first-of-type { grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(0, .8fr)); }
.settings-modal-options legend { grid-column: 1 / -1; width: 100%; margin-bottom: var(--sp-1); color: var(--text); font-size: 13px; font-weight: 750; }
.settings-choice { width: 100%; min-width: 0; min-height: 44px; display: inline-flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.settings-modal-options fieldset:first-of-type .settings-choice { gap: var(--sp-1); padding-inline: var(--sp-2); }
.settings-choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; }
.settings-choice input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.settings-choice:focus-within { outline: none; }
.settings-choice input:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 3px; border-radius: 50%; }
.settings-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }
.settings-actions .btn { width: 100%; min-height: var(--h-lg); }
.settings-actions .btn-soft:hover { background: color-mix(in srgb, var(--primary) 21%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 34%, transparent); }
.settings-actions .settings-delete { border-color: color-mix(in srgb, var(--danger) 28%, transparent); background: var(--danger-soft); color: var(--danger-strong); }
.settings-actions .settings-delete:hover { background: color-mix(in srgb, var(--danger) 12%, var(--danger-soft)); }
.settings-page .btn:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 3px; }
.settings-password-dialog { display: grid; gap: var(--sp-3); min-width: 0; text-align: left; }
.settings-password-dialog .field { display: grid; gap: var(--sp-2); min-width: 0; }
.settings-password-dialog .input { min-height: var(--h-lg); font-size: 16px; }
.settings-password-dialog .settings-message { text-align: left; }
.settings-password-dialog #settings-password-contact { justify-self: start; }
.back-to-top {
  position: fixed; right: var(--sp-4); bottom: calc(var(--safe-b) + var(--sp-4)); z-index: 70;
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--primary-strong);
  box-shadow: var(--shadow-2); transition: transform .15s var(--ease-mid), background-color .15s var(--ease-mid);
}
.back-to-top.with-tabbar { bottom: calc(var(--safe-b) + var(--tab-h) + var(--sp-4)); }
.back-to-top:hover { transform: translateY(-2px); background: var(--surface-2); }
.back-to-top:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .back-to-top { transition: none; } }

@media (max-width: 420px) {
  .settings-card { padding: var(--sp-4); }
  .settings-inline { align-items: stretch; flex-direction: column; }
  .settings-inline .btn { width: 100%; }
}
@media (max-width: 480px) {
  .settings-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .settings-actions .btn { height: auto; min-height: 48px; padding: var(--sp-2); white-space: normal; line-height: 1.35; }
}

/* -------------------------------------------------------------
   10.5 首页「我们的亮点」卡片：图标 + 标题一行（自动左对齐），下面隔开一段再放说明
   （这段样式以前写在 about.js 的注入 <style> 里，重构时丢了，现在放全局）
   ------------------------------------------------------------- */
.hl-card { display: block; }
.hl-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hl-ico {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  background: var(--primary-soft); color: var(--primary-strong);
  display: inline-flex; align-items: center; justify-content: center;
}
.hl-t {
  font-size: 17px; font-weight: 800; letter-spacing: -.2px; color: var(--text);
  /* 标题带淡蓝阴影，比正文更跳出来 */
  text-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 26%, transparent),
               0 3px 10px color-mix(in srgb, var(--primary) 30%, transparent);
}
.hl-d { margin: 14px 0 0; font-size: 13.5px; line-height: 1.78; color: var(--text-2); }

/* -------------------------------------------------------------
   11. 登录 / 注册选号 / 激活
   ------------------------------------------------------------- */
.auth-head { padding: var(--sp-8) 0 var(--sp-5); text-align: center; }
.auth-head img { height: 40px; margin: 0 auto var(--sp-3); }
.auth-head .st { font-size: 14px; color: var(--text-2); }

/* 候选号：5 列 × 2 行铺满，10 个号码一屏看完（原来 2 列 5 行，把注册弹窗撑得比登录高一截） */
.pick-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.pick {
  position: relative;
  min-width: 0; min-height: 40px;
  padding: 8px 0;
  border-radius: 10px;
  /* 半透明浅灰、扁平圆角矩形（老板口径）；去掉 1.5px 边框，靠底色区分 */
  background: color-mix(in srgb, var(--text) 6%, transparent);
  text-align: center;
  transition: background-color .15s, box-shadow .15s, transform .12s var(--ease-mid);
}
.pick:active { transform: scale(.97); }
.pick .num {
  font-size: 13px; font-weight: 700; letter-spacing: 0;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.pick.on { background: color-mix(in srgb, var(--primary) 12%, transparent); box-shadow: inset 0 0 0 1.5px var(--primary); }
.pick.on .num { color: var(--primary-strong); }
.pick.on::after {
  content: "✓"; position: absolute; top: -7px; right: -7px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--surface);
}

.pwd-meter { display: flex; gap: 4px; margin-top: 8px; }
.pwd-meter i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.pwd-meter i.lv1 { background: var(--danger); }
.pwd-meter i.lv2 { background: var(--warning); }
.pwd-meter i.lv3 { background: var(--success); }

.cardkey-input {
  letter-spacing: 2px; text-transform: uppercase;
  font-variant-numeric: tabular-nums; text-align: center;
  font-size: 17px; font-weight: 600;
}
/* 登录 ID 的说明文字不跟卡密逐字母拉开，确保 320px 窄屏仍能读完整占位提示。 */
.mbox-tabs ~ .stack-4 .cardkey-input::placeholder { letter-spacing: normal; }

.plan-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.plan {
  padding: var(--sp-4) var(--sp-3); border-radius: var(--r-md);
  background: var(--surface); border: 1.5px solid var(--border); text-align: center;
}
.plan .nm { font-size: 16px; font-weight: 700; }
.plan .ds { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* -------------------------------------------------------------
   12. 裁剪器
   ------------------------------------------------------------- */
.crop-wrap { position: fixed; inset: 0; z-index: 100; background: #0B1220; display: flex; flex-direction: column; }
.crop-top, .crop-bottom { flex: none; padding: calc(var(--safe-t) + 10px) var(--sp-4) 10px; display: flex; align-items: center; justify-content: space-between; }
.crop-bottom { padding: 10px var(--sp-4) calc(var(--safe-b) + 12px); flex-direction: column; gap: var(--sp-4); }
.crop-top { color: #fff; }
.crop-stage { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.crop-stage img { max-width: 100%; max-height: 100%; }
.crop-ratio { display: flex; gap: var(--sp-2); justify-content: center; }
.crop-ratio button {
  height: 34px; padding: 0 14px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.8);
  font-size: 13px; font-weight: 600;
}
.crop-ratio button.on { background: #fff; color: #0B1220; }

/* -------------------------------------------------------------
   13. 通用页面头
   ------------------------------------------------------------- */
.page-head { padding: var(--sp-5) 0 var(--sp-3); }
.page-head .ttl { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.page-head .sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* 一级页标题与操作在首行，副标题独占下一行。 */
.drawings-page-header .y-header-inner,
.bead-library-page-header .y-header-inner,
.mine-page-header .y-header-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto; align-items: center;
  column-gap: var(--sp-3); row-gap: var(--sp-1);
}
.drawings-page-header .y-header-copy,
.bead-library-page-header .y-header-copy,
.mine-page-header .y-header-copy { display: contents; }
.drawings-page-header .ttl,
.bead-library-page-header .ttl,
.mine-page-header .ttl { grid-column: 1; grid-row: 1; min-width: 0; }
.drawings-page-header .y-header-actions,
.bead-library-page-header .y-header-actions,
.mine-page-header .y-header-actions { grid-column: 2; grid-row: 1; }
.drawings-page-header .sub {
  grid-column: 1 / -1; grid-row: 2; width: 100%; margin-top: 0;
  overflow-wrap: anywhere;
}
.bead-library-page-header .sub {
  grid-column: 1 / -1; grid-row: 2; width: 100%; margin-top: 0;
}
.mine-page-header .sub {
  grid-column: 1 / -1; grid-row: 2; width: 100%; margin-top: 0;
}
.drawings-page-header .btn-template { min-height: var(--h-lg); padding-inline: var(--sp-4); }
.bead-library-page-header .bead-entry-button {
  height: var(--h-lg); min-height: var(--h-lg); padding-inline: var(--sp-3); font-size: 13px;
}

/* -------------------------------------------------------------
   15. 弹窗内部通用结构（登录 / 注册 / 激活 / 续费）
   ------------------------------------------------------------- */
.mbox { padding: var(--sp-5); }
.mbox-head { display: flex; align-items: flex-start; gap: 10px; }
.mbox-head .ico-w {
  width: 34px; height: 34px; flex: none; border-radius: var(--r-md);
  background: var(--primary-soft); color: var(--primary-strong);
  display: flex; align-items: center; justify-content: center;
}
.mbox-title { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.mbox-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; line-height: 1.5; }
.mbox-close { position: absolute; top: 12px; right: 12px; }
.mbox-tabs {
  display: flex; gap: 4px; margin: 16px 0;
  background: var(--surface-3); padding: 3px; border-radius: var(--r-pill);
}
.mbox-tabs button {
  flex: 1; height: 34px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: color .16s var(--ease-mid), background-color .16s var(--ease-mid), box-shadow .16s var(--ease-mid);
}
.mbox-tabs button.on { background: var(--surface); color: var(--primary-strong); box-shadow: var(--shadow-1); }
.mbox-tip {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 14px; padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--primary-soft); color: var(--primary-strong);
  font-size: 12px; line-height: 1.6;
}
.auth-switch-warning {
  display: grid; gap: var(--sp-2); margin: 0 0 var(--sp-2);
  border-color: color-mix(in srgb, var(--warning) 36%, var(--border));
}
.auth-switch-warning-message {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  font-size: var(--type-supporting); font-weight: var(--font-weight-semibold); line-height: var(--line-supporting);
}
.auth-switch-warning-message y-icon { flex: none; margin-top: 2px; }
.auth-switch-warning-message p { margin: 0; }
.auth-switch-phrase-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-width: 0;
  padding: var(--sp-1) var(--sp-2); border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--border));
  border-radius: var(--r-control); background: var(--surface);
}
.auth-switch-phrase {
  min-width: 0; margin: 0; color: var(--warning-strong); font-size: var(--type-item-title);
  font-weight: var(--font-weight-bold); line-height: var(--line-item-title); overflow-wrap: anywhere;
}
.auth-switch-copy { flex: none; color: var(--warning-strong); }
.auth-switch-copy:hover { background: color-mix(in srgb, var(--warning-soft) 65%, var(--surface)); }
.auth-switch-copy:focus-visible { outline: 2px solid var(--warning-strong); outline-offset: 2px; }

/* 会员到期时间等小行 */
.meta-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
.meta-row:last-child { border-bottom: 0; }
.meta-row .k { color: var(--text-2); }
.meta-row .v { font-weight: 600; }
.meta-row .kefu-copy { min-height: var(--h-lg); color: var(--primary-strong); text-align: right; }

/* 获取卡密：二维码 + 三步引导 */
.qr-wrap {
  margin: 16px auto 0; width: 190px; height: 190px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer; padding: 0; color: inherit; text-align: center;
  box-shadow: var(--shadow-1);
}
.qr-wrap img { width: 100%; height: 100%; object-fit: contain; }
.qr-ph {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-3); font-size: 12px; text-align: center; padding: 12px;
}
.qr-ph small { font-size: 11px; color: var(--text-3); opacity: .85; line-height: 1.4; }

.steps { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; gap: 10px; align-items: flex-start; }
.step .idx {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-strong);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.step .st { font-size: 14px; font-weight: 700; }
.step .sd { font-size: 12px; color: var(--text-2); line-height: 1.6; margin-top: 2px; }

/* 仅手机端显示 / 仅电脑端显示 的工具类 */
.mobile-only { display: block; }
:root[data-device="pc"] .mobile-only { display: none !important; }
/* ⚠️ 手机端必须隐藏电脑端专用元素（此前缺这条规则，桌面操作按钮在手机端露出来了） */
.pc-only { display: none; }
:root[data-device="pc"] .pc-only { display: flex; }


/* -------------------------------------------------------------
   23. 底图设置气泡（贴在「底图」开关下方）
   ------------------------------------------------------------- */
.base-pop {
  position: absolute; top: 46px; right: 8px; bottom: auto; left: auto;
  z-index: 12; width: 292px; padding: 12px 14px 10px;   /* 加了数字输入框，宽度放开一点 */
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(10px);
  animation: pop-in .2s var(--ease-out);
}
.base-pop .line + .line { margin-top: 9px; }
.base-pop .line label { width: 40px; font-size: 12px; }
.base-pop::before {
  content: ""; position: absolute; top: -6px; right: 22px;
  width: 12px; height: 12px; transform: rotate(45deg);
  background: var(--surface);
  border-left: 1px solid var(--border); border-top: 1px solid var(--border);
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* 弹窗宽版（色卡参考 / 公告等） */
.modal-wide { max-width: 640px; width: min(640px, 94vw); }
/* 登录/注册、激活续费、获取卡密：内容自带 .mbox 内边距，外层不再重复 padding。
   ⚠️ 之前是 overflow:hidden —— 内容比 84vh 高时底部会被直接裁掉（获取卡密就被切过），
   现在交给 .modal 自带的 max-height + 滚动，并在底部留出安全区空隙 */
.modal-flush { max-width: 392px; padding: 0; }
.modal-flush .mbox { padding: var(--sp-5) var(--sp-5) calc(var(--sp-5) + var(--safe-b)); }
.modal-flush.getcard-modal {
  max-height: 94vh;
  max-height: min(94dvh, 760px);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-flush.getcard-modal > .getcard-layout {
  position: relative; display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; padding: 0;
}
.getcard-head {
  flex: none; padding: var(--sp-3) calc(var(--sp-5) + 40px) var(--sp-1) var(--sp-5);
}
.getcard-heading { min-width: 0; }
.getcard-account {
  display: block; width: fit-content; max-width: 100%; margin: 0 auto;
  padding: 2px var(--sp-2); border-radius: var(--r-sm);
  background: var(--primary-soft); color: var(--primary-strong);
  font-size: 11px; font-weight: 600; line-height: 1.35; text-align: center; white-space: nowrap;
}
.getcard-account strong { font-weight: 800; }
.getcard-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; padding: 0 var(--sp-5) var(--sp-3);
}
.getcard-body:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: -2px; }
.getcard-qr {
  display: block; width: min(248px, 100%); height: auto; min-height: 0; aspect-ratio: auto;
  margin: var(--sp-1) auto 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; overflow: visible;
}
.getcard-qr img { display: block; width: 100%; height: auto; object-fit: contain; }
.getcard-qr .qr-ph { min-height: 180px; justify-content: center; box-sizing: border-box; }
.getcard-body .steps { margin-top: var(--sp-2); gap: var(--sp-2); }
.getcard-body .step .st { font-size: 13px; }
.getcard-body .step .sd { font-size: 12px; line-height: 1.45; margin-top: 1px; }
.getcard-footer {
  flex: none; padding: var(--sp-2) var(--sp-5) calc(var(--sp-3) + var(--safe-b));
  border-top: 1px solid color-mix(in srgb, var(--border) 76%, transparent); background: var(--surface);
}
.getcard-footer .modal-actions { margin-top: 0; flex-wrap: nowrap; }
.getcard-footer .modal-actions > .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; }
@media (max-height: 700px) {
  .getcard-qr { width: min(190px, 100%); }
  .getcard-body { padding-bottom: var(--sp-2); }
}
@media (max-height: 600px) {
  .getcard-qr { width: min(152px, 100%); }
  .getcard-body .steps { margin-top: var(--sp-1); gap: var(--sp-1); }
  .getcard-body .step .sd { line-height: 1.35; }
  .getcard-body { padding-bottom: 0; }
}
/* 电脑端登录：左右分屏（左品牌 + 右表单），老板给的配方② */
:root[data-device="pc"] .modal-flush:has(.mbox-split) { max-width: 760px; }
.mbox-split { display: grid; grid-template-columns: 280px 1fr; padding: 0 !important; }
.mbox-split .auth-brand {
  padding: 26px 22px; border-radius: var(--r-xl) 0 0 var(--r-xl);
  background: linear-gradient(165deg, color-mix(in srgb, var(--primary) 14%, var(--surface)) 0%,
    color-mix(in srgb, var(--primary) 5%, var(--surface)) 65%, var(--surface) 100%);
  display: flex; flex-direction: column; gap: 12px;
}
/* ⚠️ 左栏是 column + 默认 align-items:stretch 的 flex 容器：
   img 只写 height + width:auto 会被拉满容器宽度 → Logo 被横向扯成「扁扁的」。
   必须 align-self:flex-start 让它按原图比例（459×132）显示。 */
.mbox-split .auth-brand .ab-logo {
  height: 42px; width: auto; margin-bottom: 4px;
  align-self: flex-start; object-fit: contain;
}
.mbox-split .ab-slogan { font-size: 15px; font-weight: 800; letter-spacing: -.2px; line-height: 1.5; }
.mbox-split .ab-list { display: flex; flex-direction: column; gap: 9px; margin: 6px 0 0; }
.mbox-split .ab-list li {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12.5px; line-height: 1.65; color: var(--text-2);
}
.mbox-split .ab-list li svg { flex: none; margin-top: 2px; color: var(--primary-strong); }
.mbox-split .ab-swatches { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 14px; }
.mbox-split .ab-sw {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 5px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  font-size: 11.5px; font-weight: 700; color: var(--text-2);
}
.mbox-split .ab-sw i { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
/* 电脑端登录 / 注册共用一个高度：两个页签内容多少不一致，不给下限就会「注册比登录高一截」。
   540px = 内容多的那一侧（注册选号，实测 533）再留几像素，两个页签切换时弹窗边框纹丝不动 */
.mbox-split .auth-form { padding: 22px 22px 20px; min-width: 0; }
:root[data-device="pc"] .mbox-split .auth-form { min-height: 540px; }

/* 同意条款（带勾选框）：跟在登录 / 注册按钮下方，不再单独占整个弹窗底部 */
.auth-agree {
  display: flex; align-items: flex-start; gap: 7px;
  margin-top: 12px; cursor: pointer;
  font-size: 12px; line-height: 1.55; color: var(--text-2);
}
.auth-agree input[type="checkbox"] {
  flex: none; width: 15px; height: 15px; margin: 1px 0 0;
  accent-color: var(--primary); cursor: pointer;
}
.auth-agree a { color: var(--primary-strong); font-weight: 600; }
/* 登录失败红字（设备被占用 / 被锁定这类需要看清的提示） */
.auth-err-inline {
  margin-top: 10px; padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px; line-height: 1.6; font-weight: 600;
}
.turnstile-box {
  display: grid; justify-items: start; gap: 8px;
  max-width: 100%; margin-top: 12px; padding: 12px; overflow-x: auto;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-2);
}
.turnstile-box > p { margin: 0; }
/* 「忘记密码」另起一行、靠右 */
.auth-forgot { display: flex; justify-content: flex-end; margin-top: 6px; }

/* 注册分步：步骤条 + 已选账号 + 完成页 */
.auth-steps { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; }
.auth-steps .as {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--text-3);
}
.auth-steps .as i {
  width: 20px; height: 20px; border-radius: 50%; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-3); font-size: 11.5px; font-weight: 800;
}
.auth-steps .as.on { color: var(--primary-strong); }
.auth-steps .as.on i { background: var(--primary-grad); color: #fff; }
.auth-steps .as.done i { background: var(--primary-soft); color: var(--primary-strong); }
.auth-steps .as-line { flex: 1; height: 2px; border-radius: 2px; background: var(--border); }
.auth-steps .as-line.on { background: var(--primary); }
.auth-picked {
  margin: 14px 0 0; padding: 9px 12px; border-radius: var(--r-md);
  background: var(--primary-soft); color: var(--primary-strong); font-size: 13px;
}
.auth-done { text-align: center; padding: 8px 0 4px; }
.auth-done .ad-ico {
  width: 64px; height: 64px; margin: 6px auto 12px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-strong);
  display: flex; align-items: center; justify-content: center;
}
.auth-done .ad-t { font-size: 18px; font-weight: 800; }
.auth-done .ad-d { margin-top: 8px; font-size: 13px; line-height: 1.75; color: var(--text-2); }
/* 手机端的宽弹窗（公告、下载设置）：跟着手机版布局走，但要限宽。
   原来是 width:100%，在宽窗口里手机版会把弹窗拉成一整条横贯全屏的长条。 */
:root[data-device="mobile"] .modal-wide { max-width: none; width: min(100%, 440px); }

/* 色卡参考字母分类 */
.pl-recent { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pl-recent .pl-rlb { font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.pl-recent .pl-rchip {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px 0 5px;
  border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 700; color: var(--text-2);
}
.pl-recent .pl-rchip i { width: 16px; height: 16px; border-radius: 5px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.pl-recent .pl-rchip:active { transform: scale(.97); }
.pl-letter {
  min-width: 34px; height: 30px; padding: 0 9px;
  border-radius: 9px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 12.5px; font-weight: 700;
}
.pl-letter.on { background: var(--primary); color: #fff; }
.pl-letter:active { transform: scale(.96); }

/* 我的 → 色卡参考：整页自然滚动，筛选区不再挤占独立色块滚动窗。 */
.palette-reference-page { padding-bottom: calc(var(--safe-b) + var(--sp-8)); }
.palette-page-intro {
  margin: var(--sp-3) 0 var(--sp-4); padding: var(--sp-4);
  border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface);
}
.palette-page-kicker { display: flex; align-items: center; gap: var(--sp-2); color: var(--primary-strong); font-size: 12px; font-weight: 700; }
.palette-page-current { display: flex; align-items: baseline; gap: var(--sp-2); margin-top: var(--sp-2); }
.palette-page-current strong { color: var(--text); font-size: 23px; line-height: 1.3; font-weight: 800; }
.palette-page-current span { color: var(--text-2); font-size: 13px; font-weight: 700; }
.palette-page-intro p { margin: 5px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.palette-page-brands,
.palette-page-letters,
.palette-page-recent-list { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.palette-page-brands::-webkit-scrollbar,
.palette-page-letters::-webkit-scrollbar,
.palette-page-recent-list::-webkit-scrollbar { display: none; }
.palette-page-brands { margin-bottom: var(--sp-3); }
.palette-page-brands button {
  flex: 1 0 auto; min-width: 72px; min-height: 44px; padding: 0 var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--r-control); background: var(--surface);
  color: var(--text-2); font-size: 14px; font-weight: 700;
}
.palette-page-brands button.on { border-color: color-mix(in srgb, var(--primary) 46%, var(--border)); background: var(--primary-soft); color: var(--primary-strong); }
.palette-page-search {
  display: flex; align-items: center; gap: var(--sp-2); min-height: 48px; padding: 0 var(--sp-3);
  border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface); color: var(--text-3);
}
.palette-page-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ghost); }
.palette-page-search input { flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.palette-page-search input::-webkit-search-cancel-button { display: none; }
.palette-page-search button { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: var(--r-pill); color: var(--text-3); }
.palette-page-letters { margin: var(--sp-3) 0 var(--sp-4); padding-bottom: 2px; }
.palette-page-letters button {
  flex: none; min-width: 44px; height: 44px; padding: 0 10px; border-radius: var(--r-control);
  background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 700;
}
.palette-page-letters button.on { background: var(--primary); color: #fff; }
.palette-page-section-head,
.palette-page-results-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.palette-page-section-head { margin-bottom: var(--sp-2); }
.palette-page-section-head strong,
.palette-page-results-head strong { color: var(--text); font-size: 14px; font-weight: 700; }
.palette-page-section-head span,
.palette-page-results-head span { color: var(--text-3); font-size: 12px; }
.palette-page-recent { margin-bottom: var(--sp-4); }
.palette-page-recent-list button {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; padding: 0 10px 0 6px;
  border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: 12px;
}
.palette-page-recent-list i { width: 22px; height: 22px; border-radius: 7px; border: 1px solid color-mix(in srgb, var(--border-2) 72%, transparent); }
.palette-page-results-head { margin: 0 0 var(--sp-2); }
.palette-page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: var(--sp-2); }
.palette-page-color {
  display: flex; flex-direction: column; align-items: center; min-width: 0; min-height: 82px; padding: 7px 3px 5px;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-md); background: var(--surface);
}
.palette-page-swatch { width: 40px; height: 40px; border: 2px solid var(--border); border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.palette-page-color strong { max-width: 100%; margin-top: 4px; color: var(--text-2); font-size: 12px; line-height: 1.25; }
.palette-page-color span { max-width: 100%; overflow: hidden; color: var(--text-3); font-size: 10px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.palette-page-empty { padding: var(--sp-8) var(--sp-4); border-radius: var(--r-card); background: var(--surface); color: var(--text-3); text-align: center; font-size: 14px; }
.palette-page-note { margin: var(--sp-4) 0; color: var(--text-3); font-size: 11px; line-height: 1.6; }
@media (min-width: 768px) {
  :root[data-device="pc"] .palette-page-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: var(--sp-3); }
}

/* 裁剪弹窗：白卡片底 */
.crop-modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
}

/* -------------------------------------------------------------
   末节：移动端热区补足（必须放最后，覆盖前面的紧凑尺寸）
   ------------------------------------------------------------- */
.rail-btn { width: var(--h-lg); height: var(--h-lg); }
.bs-head .icon-btn { width: var(--h-lg); height: var(--h-lg); }

/* 平板：页面沿用电脑端的信息密度；底部导航与画板仍是触控布局。 */
@media (min-width: 768px) {
  :root[data-layout="tablet"] {
    --page-max: 1220px;
    --page-pad: var(--sp-6);
    --nav-h: 60px;
    --tab-h: 60px;
  }
  :root[data-layout="tablet"] .nav-inner { gap: var(--sp-3); }
  :root[data-layout="tablet"] .tabbar-inner { max-width: 760px; }
  :root[data-layout="tablet"] .tab-item { font-size: 12px; }
  :root[data-layout="tablet"] .tpl-tag,
  :root[data-layout="tablet"] .empty .btn-sm { min-height: var(--h-lg); }
  :root[data-layout="tablet"] .drawer { max-width: 640px; }
  :root[data-layout="tablet"] .modal-wide { width: min(640px, 100%); max-width: 640px; }

  :root[data-layout="tablet"] .page-head {
    padding: var(--sp-8) 0 var(--sp-4);
    margin-bottom: var(--sp-6); border-bottom: 1px solid var(--border);
  }
  :root[data-layout="tablet"] .page-head .ttl { font-size: 26px; }
  :root[data-layout="tablet"] .page-head .sub { font-size: 14px; margin-top: var(--sp-2); }
  :root[data-layout="tablet"] .section-title { font-size: 16px; margin: var(--sp-8) 0 var(--sp-4); }
  :root[data-layout="tablet"] .cell-group {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3);
    border: 0; border-radius: 0; background: transparent; overflow: visible;
  }
  :root[data-layout="tablet"] .cell-group .cell {
    min-width: 0; border: 1px solid var(--border); border-radius: var(--r-control);
    background: var(--surface); box-shadow: var(--shadow-none);
    padding: var(--sp-4); min-height: var(--h-lg);
  }
  :root[data-layout="tablet"] .cell-group .cell + .cell { border-top: 1px solid var(--border); }

  :root[data-layout="tablet"] .hero {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: var(--sp-6); align-items: start; text-align: left;
    padding: var(--sp-8);
  }
  :root[data-layout="tablet"] .hero h1 { font-size: 32px; grid-column: 1; grid-row: 1; text-align: left; }
  :root[data-layout="tablet"] .hero .slogan { grid-column: 1; grid-row: 2; }
  :root[data-layout="tablet"] .hero .sub-slogan { grid-column: 1; grid-row: 3; }
  :root[data-layout="tablet"] .hero-actions { grid-column: 1; grid-row: 4; }
  :root[data-layout="tablet"] .hero-preview { grid-column: 2; grid-row: 1 / span 5; align-self: center; margin: 0; width: 100%; }
  :root[data-layout="tablet"] .hero-stats { grid-column: 1; grid-row: 5; width: 100%; margin-top: var(--sp-4); justify-content: flex-start; }
  :root[data-layout="tablet"] .hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  :root[data-layout="tablet"] .hero-entry { min-height: 60px; font-size: 14px; }
  :root[data-layout="tablet"] .hero:not(.hero-has-preview) { display: block; text-align: center; }
  :root[data-layout="tablet"] .hero:not(.hero-has-preview) h1 { text-align: center; }
  :root[data-layout="tablet"] .hero:not(.hero-has-preview) .hero-actions { max-width: 640px; margin-inline: auto; }
  :root[data-layout="tablet"] .hero-keys {
    display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3);
    grid-column: 1 / -1; grid-row: 6; margin-top: var(--sp-6);
    padding-top: var(--sp-5); border-top: 1px solid var(--border); text-align: left;
  }
  :root[data-layout="tablet"] .hero-keys .hk-label b { display: block; font-size: 14.5px; color: var(--text); }
  :root[data-layout="tablet"] .hero-keys .hk-label small { display: block; margin-top: var(--sp-1); font-size: 12px; color: var(--text-3); }
  :root[data-layout="tablet"] .hero-keys .btn { min-height: var(--h-lg); }
  :root[data-layout="tablet"] .home-cells .cell { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  :root[data-layout="tablet"] .home-cells .cell .rt,
  :root[data-layout="tablet"] .home-cells .cell .ar { display: none; }
  :root[data-layout="tablet"] .home-cells .cell .tt { font-weight: 700; }
  :root[data-layout="tablet"] .list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-4); align-items: stretch;
  }
  :root[data-layout="tablet"] .list > div,
  :root[data-layout="tablet"] .list .swipe,
  :root[data-layout="tablet"] .list .swipe-inner,
  :root[data-layout="tablet"] .list .item { height: 100%; }
  :root[data-layout="tablet"] .list .item {
    flex-direction: column; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-4);
  }
  :root[data-layout="tablet"] .list .drawing-open { width: 100%; flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  :root[data-layout="tablet"] .list .item-thumb { width: 100%; height: 132px; border-radius: var(--r-md); }
  :root[data-layout="tablet"] .list .item-body { width: 100%; }
  :root[data-layout="tablet"] .list .item-title { font-size: 15.5px; }
  :root[data-layout="tablet"] .list .item-meta { font-size: 12.5px; }
  :root[data-layout="tablet"] .list .item .ar,
  :root[data-layout="tablet"] .list .swipe-actions { display: none; }
  :root[data-layout="tablet"] .list .swipe-inner { transform: none !important; }
  :root[data-layout="tablet"] .list .dc-actions.pc-only { display: flex; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-2); }
  :root[data-layout="tablet"] .list .dc-actions .icon-btn {
    min-width: var(--h-lg); min-height: var(--h-lg); width: var(--h-lg) !important; height: var(--h-lg) !important;
    border: 1px solid var(--border); background: var(--surface-2);
  }
  :root[data-layout="tablet"] .dwg-swipe-hint { display: none; }
  :root[data-layout="tablet"] .about-hl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
  :root[data-layout="tablet"] .about-hl-grid .card { height: 100%; }
  :root[data-layout="tablet"] .acc-wide,
  :root[data-layout="tablet"] .ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); align-items: start; }
  :root[data-layout="tablet"] .acc-wide .acc + .acc,
  :root[data-layout="tablet"] .ai-grid .acc + .acc { margin-top: 0; }
  :root[data-layout="tablet"] .ai-card { grid-template-columns: 160px minmax(0, 1fr); padding: var(--sp-4); }
  :root[data-layout="tablet"] .pc-dash .page-head { display: flex; align-items: flex-end; gap: var(--sp-4); }
  :root[data-layout="tablet"] .pc-dash .acc-banner { flex-wrap: wrap; }
  :root[data-layout="tablet"] .pc-dash .ab-id { min-width: 0; flex: 1 1 260px; }
  :root[data-layout="tablet"] .pc-dash .ab-vip { flex: 1 1 260px; }
  :root[data-layout="tablet"] .pc-dash .pd-drawings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :root[data-layout="tablet"] .pc-dash .chip-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root[data-layout="tablet"] .pc-dash .chip-btn { min-height: var(--h-lg); }
  :root[data-layout="tablet"] .pc-dash .panel-head .link-blue {
    min-height: var(--h-lg); display: inline-flex; align-items: center;
  }
  :root[data-layout="tablet"][data-theme="dark"] .pc-dash .tag-info { color: var(--primary-strong); }
  :root[data-layout="tablet"] .tpl-flow { column-count: 3; }
  :root[data-layout="tablet"] .settings-page { max-width: min(960px, var(--page-max)); }
  :root[data-layout="tablet"] .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  :root[data-layout="tablet"] .board-top .inner { height: 60px; padding: 0 var(--sp-4); gap: var(--sp-2); }
  :root[data-layout="tablet"] .board-bottom {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  }
  :root[data-layout="tablet"] .board-bottom .crop-bar.inline { grid-column: 1 / -1; }
  :root[data-layout="tablet"] .board-mobile-colors { display: flex; grid-column: 1 / -1; }
  :root[data-layout="tablet"] .op-bar { grid-column: 1; padding: var(--sp-2); }
  :root[data-layout="tablet"] .board-tools { grid-column: 2; min-width: 0; }
  :root[data-layout="tablet"] .bt-scroll { padding-block: var(--sp-2); }
  :root[data-layout="tablet"] .base-controls { grid-column: 1 / -1; }
  :root[data-layout="tablet"] .tool-rail { left: var(--sp-3); }
}

@media (max-width: 360px) {
  :root[data-device="mobile"] .base-controls { gap: 4px; padding: 6px; }
  :root[data-device="mobile"] .base-opacity-control { gap: 4px; }
  :root[data-device="mobile"] .base-opacity-control label { font-size: 11px; }
  :root[data-device="mobile"] .base-opacity-control .base-opacity-slider { min-width: 48px; }
  :root[data-device="mobile"] .base-opacity-value { min-width: 32px; font-size: 11px; }
  :root[data-device="mobile"] .base-actions { gap: 4px; }
  :root[data-device="mobile"] .base-action { gap: 3px; padding-inline: 5px; font-size: 10.5px; }
}

@media (min-width: 1024px) {
  :root[data-layout="tablet"] .home-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  :root[data-layout="tablet"] .list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :root[data-layout="tablet"] .about-hl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :root[data-layout="tablet"] .pc-dash .pd-drawings { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  :root[data-layout="tablet"] .pc-dash .chip-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  :root[data-layout="tablet"] .stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  :root[data-layout="tablet"] .tpl-flow { column-count: 4; }
}

/* ================= 有图纸：九宫格校准 ================= */
.gip-page { position: fixed; z-index: 20; inset: 0; display: flex; flex-direction: column; width: 100%; max-width: none; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; margin: 0; padding: calc(var(--safe-t) + var(--sp-2)) var(--sp-4) calc(var(--safe-b) + var(--sp-2)); background: var(--bg); }
.gip-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); flex: none; min-height: 56px; margin-bottom: var(--sp-2); padding: var(--sp-1) var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1); }
.gip-back { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; border-radius: var(--r-md); background: var(--surface-2); }
.gip-progress { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.gip-steps { display: flex; align-items: center; gap: 3px; flex: none; }
.gip-steps span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); font-size: 11px; font-weight: 700; }
.gip-steps span.is-complete, .gip-steps span.is-current { background: var(--primary); color: var(--text-invert); }
.gip-steps span.is-current { box-shadow: 0 0 0 3px var(--primary-ghost); }
.gip-steps i { display: block; width: 8px; height: 2px; border-radius: var(--r-pill); background: var(--border-2); }
.gip-heading { display: grid; gap: 1px; min-width: 0; }
.gip-heading h1 { margin: 0; color: var(--text); font-size: 15px; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.gip-heading h1:focus { outline: 2px solid var(--primary); outline-offset: 3px; }
.gip-heading > span { color: var(--text-3); font-size: 11px; line-height: 1.25; white-space: nowrap; }
.gip-confirm { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1); min-height: 48px; padding-inline: var(--sp-3); border-radius: var(--r-md); white-space: nowrap; }
.gip-confirm:disabled { cursor: not-allowed; opacity: .56; }
.gip-workspace { display: flex; flex: 1; flex-direction: column; gap: var(--sp-2); min-height: 0; }
.gip-file { display: none; }
.gip-stage { position: relative; flex: 1; width: 100%; height: auto; min-height: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface-2); touch-action: none; user-select: none; cursor: grab; }
.gip-stage:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.gip-stage.is-cropping { cursor: default; }
.gip-stage.is-dragging { cursor: grabbing; }
.gip-image-plane { position: absolute; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-1); pointer-events: none; }
.gip-image-plane svg { display: block; width: 100%; height: 100%; }
.gip-view-controls { display: flex; align-items: center; gap: var(--sp-1); }
.gip-view-controls button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 var(--sp-2); }
.gip-view-controls output { min-width: 48px; color: var(--text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.gip-view-controls button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.gip-grid-handle { position: absolute; z-index: 3; display: grid; place-items: center; width: 48px; height: 48px; transform: translate(-50%, -50%); border: 0; border-radius: 50%; background: transparent; color: var(--text-invert); touch-action: none; user-select: none; }
.gip-grid-handle::before { width: 24px; height: 24px; border: 3px solid var(--surface); border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px var(--primary); content: ''; }
.gip-grid-handle::after { position: absolute; top: 50%; padding: 4px 8px; transform: translateY(-50%); border-radius: var(--r-sm); color: var(--text-invert); font-size: 12px; font-weight: 700; white-space: nowrap; content: attr(data-handle-label); }
.gip-grid-handle-move { cursor: move; }
.gip-grid-handle-move::after { right: calc(100% + 4px); background: var(--primary); }
.gip-grid-handle-scale { cursor: nwse-resize; }
.gip-grid-handle-scale::before { background: var(--warning-strong); box-shadow: 0 0 0 2px var(--warning-strong); }
.gip-grid-handle-scale::after { left: calc(100% + 4px); background: var(--warning-strong); }
.gip-grid-line { fill: none; stroke: var(--primary-strong); stroke-width: 1.25; opacity: .88; vector-effect: non-scaling-stroke; }
.gip-grid-guide { fill: var(--primary-ghost); fill-opacity: .16; stroke: var(--primary-strong); stroke-width: 2; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.gip-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-4); color: var(--text-3); text-align: center; }
.gip-empty p { max-width: 32ch; margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.55; }
.gip-stage-error { position: absolute; z-index: 4; inset: var(--sp-4) var(--sp-4) auto; }
.gip-error { color: var(--danger); font-size: 12.5px; line-height: 1.5; }
.gip-loading { position: absolute; inset: auto 0 var(--sp-3); display: flex; align-items: center; justify-content: center; gap: var(--sp-2); color: var(--text-2); font-size: 12px; pointer-events: none; }
.gip-crop-box { position: absolute; z-index: 2; border: 2px solid var(--surface); outline: 2px solid var(--primary); outline-offset: -2px; box-shadow: 0 0 0 9999px rgba(5,10,20,.58); touch-action: none; user-select: none; cursor: move; }
.gip-crop-box:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 3px; }
.gip-crop-grid { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(to right, rgba(255,255,255,.55) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.55) 1px, transparent 1px); background-size: 33.333% 33.333%; opacity: .72; }
.gip-crop-handle { position: absolute; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; touch-action: none; cursor: crosshair; }
.gip-crop-handle::after { width: 13px; height: 13px; border: 2px solid var(--primary-strong); border-radius: 3px; background: var(--surface); content: ''; }
.gip-crop-handle:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: -2px; }
.gip-crop-handle.is-tl { left: 0; top: 0; }
.gip-crop-handle.is-tm { left: 50%; top: 0; transform: translateX(-50%); }
.gip-crop-handle.is-tr { right: 0; top: 0; }
.gip-crop-handle.is-ml { left: 0; top: 50%; transform: translateY(-50%); }
.gip-crop-handle.is-mr { right: 0; top: 50%; transform: translateY(-50%); }
.gip-crop-handle.is-bl { left: 0; bottom: 0; }
.gip-crop-handle.is-bm { left: 50%; bottom: 0; transform: translateX(-50%); }
.gip-crop-handle.is-br { right: 0; bottom: 0; }
.gip-crop-handle.is-tl::after, .gip-crop-handle.is-tm::after, .gip-crop-handle.is-tr::after { align-self: start; margin-top: 4px; }
.gip-crop-handle.is-bl::after, .gip-crop-handle.is-bm::after, .gip-crop-handle.is-br::after { align-self: end; margin-bottom: 4px; }
.gip-crop-handle.is-tl::after, .gip-crop-handle.is-ml::after, .gip-crop-handle.is-bl::after { justify-self: start; margin-left: 4px; }
.gip-crop-handle.is-tr::after, .gip-crop-handle.is-mr::after, .gip-crop-handle.is-br::after { justify-self: end; margin-right: 4px; }
.gip-crop-controls { display: grid; gap: var(--sp-2); flex: none; width: min(100%, 720px); margin: 0 auto; padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1); }
.gip-crop-ratios { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-1); }
.gip-crop-ratios button { min-height: 44px; padding: 0 var(--sp-2); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 650; }
.gip-crop-ratios button.is-selected { background: var(--primary-soft); color: var(--primary-strong); }
.gip-crop-ratios button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.gip-crop-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.gip-crop-dimensions { color: var(--text); font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gip-recognition { position: fixed; z-index: 31; inset: 0; display: grid; place-items: center; padding: var(--sp-4); background: var(--bg); }
.gip-recognition-card { display: grid; justify-items: center; gap: var(--sp-2); color: var(--text); text-align: center; }
.gip-recognition-spinner { width: 34px; height: 34px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: gip-spin .8s linear infinite; }
.gip-recognition-card strong { font-size: 16px; }
.gip-recognition-card p { margin: 0; color: var(--text-2); font-size: 14px; }
@keyframes gip-spin { to { transform: rotate(360deg); } }
.gip-help { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.gip-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.gip-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-4); flex: none; width: min(100%, 720px); margin: 0 auto; padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1); }
.gip-control-main { display: grid; grid-template-columns: 140px 160px; align-items: center; gap: var(--sp-3); min-width: 0; }
.gip-nudge-panel { display: grid; justify-items: center; gap: var(--sp-1); }
.gip-offset-readout { color: var(--text-3); font-size: 11px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gip-spacing { display: grid; gap: var(--sp-2); min-width: 0; color: var(--text); }
.gip-spacing-label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); color: var(--text-2); font-size: 12px; }
.gip-spacing-label span:first-child { color: var(--text); font-weight: 700; }
.gip-spacing-actions { display: grid; grid-template-columns: 44px minmax(44px, 1fr) 44px; align-items: center; gap: var(--sp-1); color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gip-spacing-btn, .gip-nudge button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 var(--sp-2); border-radius: var(--r-md); background: var(--surface-2); }
.gip-spacing-readout { min-width: 0; color: var(--text); font-size: 17px; text-align: center; }
.gip-nudge { display: grid; grid-template-columns: repeat(3, 44px); justify-content: center; gap: var(--sp-1); }
.gip-nudge > span { width: 44px; height: 44px; }
.gip-nudge button:focus-visible, .gip-spacing-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.gip-bottom-controls { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); padding-top: var(--sp-2); border-top: 1px solid var(--border); }
.gip-view-controls button, .gip-replace { border-radius: var(--r-md); background: var(--surface-2); }
.gip-replace { min-width: 44px; min-height: 44px; padding-inline: var(--sp-2); font-size: 12px; white-space: nowrap; }
@media (max-width: 767px) {
  .gip-page { padding: calc(var(--safe-t) + var(--sp-2)) var(--sp-2) calc(var(--safe-b) + var(--sp-2)); }
  .gip-head { grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--sp-1); min-height: 52px; margin-bottom: var(--sp-1); padding-inline: var(--sp-1); }
  .gip-progress { gap: var(--sp-1); }
  .gip-steps { gap: 2px; }
  .gip-steps span { width: 20px; height: 20px; font-size: 10px; }
  .gip-steps i { width: 4px; }
  .gip-heading h1 { font-size: 14px; }
  .gip-heading > span { font-size: 10px; }
  .gip-confirm { gap: 2px; padding-inline: var(--sp-2); font-size: 12px; }
  .gip-confirm y-icon { width: 16px; }
  .gip-workspace { gap: var(--sp-2); }
  .gip-controls { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); width: 100%; padding: var(--sp-2); }
  .gip-control-main { grid-template-columns: 140px minmax(0, 1fr); gap: var(--sp-2); }
  .gip-spacing-actions { grid-template-columns: 44px minmax(44px, 1fr) 44px; }
  .gip-spacing-readout { font-size: 15px; }
  .gip-bottom-controls { flex-direction: row; justify-content: center; gap: var(--sp-2); }
  .gip-view-controls { gap: 2px; }
  .gip-view-controls button { padding-inline: var(--sp-1); }
  .gip-view-controls output { min-width: 44px; font-size: 11px; }
  .gip-crop-controls { gap: var(--sp-2); width: 100%; padding: var(--sp-2); }
  .gip-crop-ratios { gap: 4px; }
  .gip-crop-ratios button { padding-inline: var(--sp-1); }
  .gip-crop-bottom { gap: var(--sp-1); }
  .gip-crop-dimensions { font-size: 13px; }
}
@media (max-width: 359px) {
  .gip-page { padding-inline: var(--sp-2); }
  .gip-heading > span { display: none; }
  .gip-confirm { padding-inline: 6px; }
  .gip-spacing-label { font-size: 11px; }
  .gip-crop-bottom { flex-direction: column; }
  .gip-crop-dimensions { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .gip-page *, .gip-page *::before, .gip-page *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .gip-recognition-spinner { animation: none; }
}

/* -------------------------------------------------------------
   手机画板工作台 · 第 1 批（其他规则仅 <768px；用色条供平板复用）
   ------------------------------------------------------------- */
.board-mobile-colors {
  display: none; align-items: center; gap: var(--sp-1); min-width: 0;
  padding: 3px var(--sp-2); border-bottom: 1px solid var(--border);
}
.board-mobile-color-open,
.board-mobile-palette {
  display: flex; flex: none; align-items: center; justify-content: center; gap: 2px;
  width: var(--h-lg); height: var(--h-lg); border-radius: var(--r-md);
  color: var(--text-2); background: var(--surface-2);
}
.board-mobile-color-open { flex-direction: column; font-size: 9px; line-height: 1; }
.board-mobile-palette { flex-direction: column; gap: 0; font-size: 9px; line-height: 1.1; }
.board-mobile-used {
  display: flex; flex: 1 1 auto; align-items: center; gap: 3px; min-width: 0;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.board-mobile-used::-webkit-scrollbar { display: none; }
.board-mobile-color {
  display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: var(--h-lg); min-height: var(--h-lg); padding: 2px 3px;
  border: 1px solid transparent; border-radius: var(--r-sm); color: var(--text-2);
}
.board-mobile-color .sw { width: 12px; height: 12px; border: 1px solid color-mix(in srgb, var(--text) 18%, transparent); border-radius: 4px; }
.board-mobile-color .cd { max-width: 42px; overflow: hidden; font-size: 9px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.board-mobile-color.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.board-mobile-color.hl { box-shadow: inset 0 0 0 2px var(--warning-strong); }
.board-mobile-colors-empty { padding-inline: var(--sp-1); color: var(--text-3); font-size: 11px; white-space: nowrap; }
.board-mobile-color-open:focus-visible,
.board-mobile-color:focus-visible,
.board-mobile-palette:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.bt-item.mobile-dock-item { display: none; }

@media (max-width: 767px) {
  :root[data-device="mobile"] .board-mobile-colors { display: flex; }
  :root[data-device="mobile"] .board-tool { min-width: 44px; padding-inline: 6px; }
  :root[data-device="mobile"] .mode-switch { width: 136px; }
  :root[data-device="mobile"] .mode-switch .m,
  :root[data-device="mobile"] .mode-switch .slider { height: 44px; }

  :root[data-device="mobile"] .tool-rail.mobile-tool-rail-legacy {
    display: flex !important; gap: 1px; padding: 1px;
    border-radius: var(--r-sm);
    background: color-mix(in srgb, var(--surface) 76%, transparent);
    box-shadow: var(--shadow-1);
    backdrop-filter: blur(8px) saturate(1.08);
    -webkit-backdrop-filter: blur(8px) saturate(1.08);
    user-select: none;
  }
  :root[data-device="mobile"] .mobile-tool-rail-legacy .rail-grip { margin: 0; }
  :root[data-device="mobile"] .mobile-tool-rail-legacy .rail-btn { width: var(--h-lg); height: var(--h-lg); padding: 0; }
  :root[data-device="mobile"] .mobile-tool-rail-legacy .rail-btn svg { width: 17px; height: 17px; }

  /* 撤回/恢复排在工具 Dock 首位，避免悬浮控件覆盖画布。 */
  :root[data-device="mobile"] .op-bar { display: none; }
  :root[data-device="mobile"] .bt-item.mobile-dock-item { display: flex; }
  :root[data-device="mobile"] .bt-item.board-color-entry { display: none; }
  :root[data-device="mobile"] .bt-scroll > .bt-item { order: var(--mobile-order, 99); }
  :root[data-device="mobile"] .bt-scroll { gap: 2px; padding: 3px calc(var(--h-lg) + var(--sp-1)) 3px var(--sp-2); }
  :root[data-device="mobile"] .bt-item {
    min-width: 50px; height: var(--h-lg); gap: 2px; padding: 0 3px;
    font-size: 10px; scroll-snap-align: start;
  }
  :root[data-device="mobile"] .bt-item > span:last-child { font-size: 0; line-height: 1; }
  :root[data-device="mobile"] .bt-item > span:last-child::after {
    content: attr(data-mobile-label); font-size: 10px; line-height: 1.1; white-space: nowrap;
  }
  :root[data-device="mobile"] .bt-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
  :root[data-device="mobile"] .tool-pop .chip { min-height: var(--h-lg); }
}

@media (max-width: 360px) {
  :root[data-device="mobile"] .board-tool span { display: none; }
  :root[data-device="mobile"] .board-tool { width: var(--h-lg); padding-inline: 0; }
  :root[data-device="mobile"] .board-mobile-colors { gap: 3px; padding-inline: 6px; }
  :root[data-device="mobile"] .board-mobile-color-open,
  :root[data-device="mobile"] .board-mobile-palette { width: var(--h-lg); }
  :root[data-device="mobile"] .bt-item { min-width: 48px; }
}

/* ---------- 豆库（手机优先） ---------- */
.bead-page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.bead-page-title { min-width: 0; }
.bead-page-title .ttl { overflow-wrap: anywhere; }
.bead-back-button {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  min-height: var(--h-lg); margin-bottom: var(--sp-1); padding-inline: var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); color: var(--primary-strong); font-weight: 700;
  transition: background-color .15s var(--ease-mid), border-color .15s var(--ease-mid), transform .12s var(--ease-mid);
}
.bead-back-button:hover { border-color: var(--border-2); background: var(--surface-2); }
.bead-back-button:active { transform: scale(.97); }
.bead-back-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bead-head-actions { display: flex; flex: none; align-items: center; gap: var(--sp-2); }
.bead-batch-open { min-height: var(--h-lg); padding-inline: var(--sp-3); white-space: nowrap; }
.bead-entry-button { flex: none; min-width: 88px; min-height: var(--h-lg); padding-inline: var(--sp-3); }
.bead-entry-button span { font-size: 21px; font-weight: 400; line-height: 1; }
.bead-warehouse-list { display: grid; gap: var(--sp-2); padding-top: var(--sp-3); }
.bead-warehouse-list > ul { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.bead-warehouse-swipe { position: relative; min-width: 0; overflow: hidden; border-radius: var(--r-card); touch-action: pan-y; }
.bead-warehouse-actions { position: absolute; inset: 0 0 0 auto; z-index: 0; display: flex; width: 136px; align-items: stretch; transition: transform .24s var(--ease-out); }
.bead-warehouse-action { display: flex; flex: 1; min-width: 0; min-height: var(--h-lg); flex-direction: column; align-items: center; justify-content: center; padding: var(--sp-1); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.2; text-align: center; }
.bead-warehouse-action:disabled { opacity: .55; }
.bead-warehouse-action:focus-visible { position: relative; z-index: 2; outline: 2px solid var(--text); outline-offset: -4px; }
.bead-warehouse-pin { background: var(--primary); }
.bead-warehouse-delete { background: var(--danger); }
.bead-warehouse-card { position: relative; z-index: 1; display: grid; width: 100%; min-height: 76px; grid-template-columns: 42px minmax(0, 1fr) auto 18px; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-card); background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); text-align: left; transition: transform .22s var(--ease-out), border-color .16s var(--ease-mid), background-color .16s var(--ease-mid); user-select: none; }
.bead-warehouse-card:active { border-color: var(--primary); background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) {
  .bead-warehouse-card:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
}
.bead-warehouse-card:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
:root:not([data-device="pc"]) .bead-warehouse-swipe.is-open .bead-warehouse-card,
:root:not([data-device="pc"]) .bead-warehouse-swipe.is-dragging .bead-warehouse-card { border-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; box-shadow: none; }
.bead-warehouse-swipe.is-dragging .bead-warehouse-card,
.bead-warehouse-swipe.is-dragging .bead-warehouse-actions { transition: none; }
.bead-warehouse-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: var(--r-control); background: var(--primary-soft); color: var(--primary-strong); }
.bead-warehouse-swatches { display: grid; width: 40px; height: 40px; grid-template-columns: repeat(2, 10px); grid-template-rows: repeat(2, 10px); place-content: center; gap: 4px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.bead-warehouse-swatches i { width: 10px; height: 10px; border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); border-radius: 50%; }
.bead-warehouse-info { display: grid; min-width: 0; gap: 4px; }
.bead-warehouse-info strong { overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.bead-warehouse-info > strong { display: flex; align-items: center; gap: var(--sp-1); }
.bead-warehouse-info small { overflow: hidden; color: var(--text-3); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.bead-warehouse-info .bead-warehouse-pin-label { flex: none; padding: 2px 6px; border-radius: var(--r-pill); background: var(--primary-soft); color: var(--primary-strong); font-size: 10px; line-height: 1.2; }
.bead-warehouse-balance { display: grid; justify-items: end; gap: 2px; white-space: nowrap; }
.bead-warehouse-balance strong { color: var(--primary-strong); font-size: 16px; font-variant-numeric: tabular-nums; }
.bead-warehouse-balance small { color: var(--text-3); font-size: 10px; }
.bead-warehouse-arrow { color: var(--text-3); font-size: 22px; }
.bead-warehouse-swipe-hint { margin: 0; padding: 0 var(--sp-1); color: var(--text-3); font-size: 11px; }
.bead-warehouse-save { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 32px; padding-inline: var(--sp-1); color: var(--text-3); font-size: 11px; }
.bead-save-status { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 0; }
.bead-warehouse-save .link-blue { flex: none; min-height: var(--h-lg); }
.bead-state.bead-empty-warehouse { display: grid; justify-items: center; align-content: center; gap: var(--sp-2); padding: var(--sp-4); border-color: color-mix(in srgb, var(--border) 64%, var(--surface)); border-radius: var(--r-featured); text-align: center; }
.bead-empty-mark { display: grid; width: 60px; height: 60px; place-items: center; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary-strong); }
.bead-empty-warehouse .bead-state-title { margin: 0; color: var(--text); font-size: 17px; line-height: 1.25; }
.bead-empty-warehouse .t-hint { max-width: 30ch; margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.55; }
.bead-empty-warehouse .btn { min-height: 44px; margin-top: var(--sp-1); }
.bead-shortages { margin: var(--sp-3) 0; padding: var(--sp-3); border: 1px solid color-mix(in srgb, var(--danger) 24%, var(--border)); border-radius: var(--r-card); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.bead-shortages-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.bead-shortages-head h2 { margin: 0; color: var(--danger-strong); font-size: 14px; font-weight: 800; }
.bead-shortages-head > span { color: var(--danger-strong); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bead-shortages-list { display: grid; gap: var(--sp-1); margin: var(--sp-2) 0 0; padding: 0; list-style: none; }
.bead-shortage-item { display: grid; width: 100%; min-height: 44px; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2); border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-control); background: var(--surface); color: var(--text-2); text-align: left; font-size: 12px; }
.bead-shortage-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bead-shortage-item > strong { min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.bead-shortage-balance { color: var(--danger-strong); font-weight: 800; font-variant-numeric: tabular-nums; }
.bead-shortage-action { color: var(--primary-strong); font-weight: 800; white-space: nowrap; }
.bead-overview { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0 var(--sp-3); border-bottom: 1px solid var(--border); }
.bead-overview-total, .bead-overview-stocked { display: flex; align-items: baseline; gap: var(--sp-2); }
.bead-overview-total span, .bead-overview-stocked span { color: var(--text-3); font-size: 12px; font-weight: 600; }
.bead-overview-total strong { color: var(--primary-strong); font-size: 18px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.bead-overview-total small { font-size: 12px; font-weight: 600; }
.bead-overview-stocked strong { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.bead-overview-divider { width: 1px; height: 18px; background: var(--border); }
.bead-overview-warehouse-row { display: flex; flex: 1 0 100%; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.bead-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--sp-2); padding: var(--sp-3) 0 0; }
.bead-control { display: grid; gap: 4px; min-width: 0; }
.bead-control label, .bead-action-amount label { color: var(--text-2); font-size: 12px; font-weight: 700; }
.bead-controls .input, .bead-action-colors .input, .bead-action-amount .input { width: 100%; min-width: 0; min-height: var(--h-lg); }
.bead-filters { display: flex; align-items: end; gap: 4px; }
.bead-filters button, .bead-action-modes button {
  min-height: var(--h-lg); padding: 0 var(--sp-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-weight: 700; white-space: nowrap;
}
.bead-letter-filters { display: flex; gap: 4px; margin-top: var(--sp-2); padding: 2px 1px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.bead-letter-filters button { flex: none; min-width: 40px; min-height: var(--h-lg); padding: 0 var(--sp-2); border: 1px solid color-mix(in srgb, var(--border) 76%, transparent); border-radius: var(--r-control); background: var(--surface-2); color: var(--text-2); font-weight: 700; }
.bead-letter-filters button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.bead-letter-filters button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bead-filters button[aria-pressed="true"], .bead-action-modes button[aria-pressed="true"] {
  border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong);
}
.bead-filters button:focus-visible, .bead-action-modes button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bead-search { grid-column: 1 / -1; }
.bead-save-line { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 32px; padding-inline: var(--sp-1); color: var(--text-3); font-size: 11px; }
.bead-save-line .link-blue { flex: none; min-height: var(--h-lg); }
.bead-error { margin: 0 0 var(--sp-2); color: var(--danger-strong); font-size: 13px; line-height: 1.5; }
.bead-grid-section { margin-top: var(--sp-1); }
.bead-grid-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); margin: 0 0 var(--sp-2); }
.bead-grid-heading h2 { margin: 0; color: var(--text); font-size: 14px; font-weight: 800; }
.bead-grid-heading > span { color: var(--text-3); font-size: 12px; }
.bead-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.bead-tile { min-width: 0; }
.bead-tile-button {
  display: grid; width: 100%; min-height: 126px; justify-items: center; align-content: start; gap: 4px;
  padding: var(--sp-2) 4px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); text-align: center;
  transition: border-color .15s, background-color .15s, transform .12s var(--ease-mid);
}
.bead-tile-button:active { transform: scale(.97); }
.bead-tile-button:hover { border-color: color-mix(in srgb, var(--primary) 38%, var(--border)); }
.bead-tile-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bead-tile-button.has-shortage { border-color: color-mix(in srgb, var(--danger) 44%, var(--border)); background: color-mix(in srgb, var(--danger) 5%, var(--surface)); }
.bead-tile-swatch { display: block; width: 42px; height: 42px; border: 1px solid var(--border-2); border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface) 24%, transparent); }
.bead-tile-code { max-width: 100%; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 800; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.bead-tile-name { max-width: 100%; overflow: hidden; color: var(--text-3); font-size: 11px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.bead-tile-stock { display: flex; align-items: baseline; gap: 2px; margin-top: 1px; color: var(--text-2); font-size: 11px; line-height: 1.15; white-space: nowrap; }
.bead-tile-stock strong { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.bead-tile-stock.is-zero, .bead-tile-stock.is-zero strong, .bead-tile-stock.is-negative, .bead-tile-stock.is-negative strong { color: var(--danger-strong); }
.bead-tile-stock-label { display: none; }
.bead-state { display: grid; justify-items: start; gap: var(--sp-2); padding: var(--sp-4); }
.bead-state .t-hint { margin: 0; }
.bead-state-title { color: var(--text); font-size: 15px; font-weight: 800; }
.bead-footnote { margin: var(--sp-3) 0 0; color: var(--text-3); font-size: 11px; line-height: 1.5; }
.bead-dialog { position: fixed; inset: auto 0 0; width: min(640px, 100vw); max-width: none; max-height: 90dvh; margin: 0 auto; padding: 0; overflow: auto; border: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; background: transparent; color: var(--text); }
.bead-dialog::backdrop { background: var(--overlay); }
.bead-dialog-card { display: grid; gap: var(--sp-3); min-height: min(66dvh, 540px); max-height: 90dvh; overflow-y: auto; padding: var(--sp-2) var(--sp-4) calc(var(--sp-4) + var(--safe-b)); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface); box-shadow: var(--shadow-3); }
.bead-drawer-handle { justify-self: center; width: 48px; height: 4px; border-radius: var(--r-pill); background: var(--border-2); }
.bead-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.bead-drawer-head h2 { margin: 0; color: var(--text); font-size: 18px; }
.bead-drawer-close { display: grid; flex: none; width: var(--h-lg); height: var(--h-lg); place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 27px; line-height: 1; }
.bead-drawer-close:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bead-action-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.bead-action-colors { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--sp-2); }
.bead-action-current { display: flex; align-items: center; gap: var(--sp-2); min-height: 58px; padding: var(--sp-2); border-radius: var(--r-md); background: var(--surface-2); }
.bead-action-swatch { flex: none; width: 38px; height: 38px; border: 1px solid var(--border-2); border-radius: var(--r-sm); }
.bead-action-current-name { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 2px; }
.bead-action-current-name strong { color: var(--text); font-size: 14px; }
.bead-action-current-name span { overflow: hidden; color: var(--text-3); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.bead-action-current-stock { display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.bead-action-current-stock span { color: var(--text-3); font-size: 11px; }
.bead-action-current-stock strong { color: var(--primary-strong); font-size: 17px; font-variant-numeric: tabular-nums; }
.bead-action-current-stock small { color: var(--text-3); font-size: 11px; }
.bead-action-amount { display: grid; gap: 4px; }
.bead-dialog-card .input { width: 100%; min-width: 0; }
.bead-create-fields { display: grid; gap: var(--sp-3); }
.bead-create-fields .input { min-height: var(--h-lg); }
.bead-series-note { margin: 0 !important; }
.bead-batch-card { min-height: min(78dvh, 680px); }
.bead-batch-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-2); }
.bead-batch-tools .btn, .bead-batch-tools .link-blue { min-height: var(--h-lg); }
.bead-batch-input { min-height: 160px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.6; }
.bead-batch-preview { display: grid; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.bead-batch-preview > strong { color: var(--primary-strong); font-size: 13px; }
.bead-batch-preview ul { display: grid; gap: var(--sp-1); max-height: 24dvh; overflow: auto; margin: 0; padding: 0; list-style: none; }
.bead-batch-preview li { display: flex; justify-content: space-between; gap: var(--sp-2); color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.bead-dialog-card .t-hint { margin: calc(-1 * var(--sp-2)) 0 0; line-height: 1.45; }
.bead-dialog-actions { position: sticky; bottom: calc(-1 * var(--sp-4)); display: flex; justify-content: flex-end; gap: var(--sp-2); margin: 0 calc(-1 * var(--sp-4)); padding: var(--sp-2) var(--sp-4) 0; background: var(--surface); }
.bead-dialog-actions .btn { flex: 1; min-height: var(--h-lg); }
@media (max-width: 360px) {
  .bead-grid { gap: 6px; }
  .bead-tile-button { min-height: 120px; padding-inline: 2px; }
  .bead-tile-swatch { width: 38px; height: 38px; }
  .bead-overview { gap: var(--sp-3); }
  .bead-head-actions { gap: 4px; }
  .bead-page-head .bead-batch-open, .bead-page-head .bead-entry-button { padding-inline: var(--sp-2); font-size: 11px; }
  .bead-warehouse-card { grid-template-columns: 36px minmax(0, 1fr) 16px; padding: var(--sp-2); }
  .bead-warehouse-icon { width: 34px; height: 34px; }
  .bead-warehouse-swatches { width: 34px; height: 34px; grid-template-columns: repeat(2, 9px); grid-template-rows: repeat(2, 9px); gap: 3px; }
  .bead-warehouse-swatches i { width: 9px; height: 9px; }
  .bead-warehouse-balance { grid-column: 2; justify-items: start; }
  .bead-warehouse-arrow { grid-column: 3; grid-row: 1 / span 2; }
  .bead-create-fields { gap: var(--sp-2); }
  .bead-dialog-card { padding-inline: var(--sp-3); }
  .bead-dialog-actions { margin-inline: calc(-1 * var(--sp-3)); padding-inline: var(--sp-3); }
}
@media (min-width: 768px) {
  .bead-overview-warehouse-row { flex: 1 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .bead-warehouse-card, .bead-warehouse-actions { transition: none; }
}

/* 图纸卡片核料入口与只读核料结果 */
.item-check-mobile {
  display: none; flex: none; align-items: center; justify-content: center; gap: 3px;
  min-width: var(--h-lg); min-height: var(--h-lg); padding: 0 var(--sp-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--primary-soft); color: var(--primary-strong); font-size: 11px; font-weight: 700;
}
.item-check-mobile:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
:root[data-device="mobile"] .item-check-mobile { display: inline-flex; }
:root[data-layout="tablet"] .item-check-mobile { display: none !important; }
.bead-check-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.bead-check-head .btn { flex: none; min-height: var(--h-lg); }
.bead-check-summary {
  display: grid; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow-1);
}
.bead-check-summary-main { min-width: 0; }
.bead-check-source { display: inline-block; color: var(--primary-strong); font-size: 11px; font-weight: 800; }
.bead-check-summary-main h1 { overflow-wrap: anywhere; margin: var(--sp-1) 0 0; color: var(--text); font-size: 18px; line-height: 1.35; }
.bead-check-summary-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.bead-check-summary-stats > div { display: grid; align-content: start; gap: 3px; min-width: 0; padding: var(--sp-2); border-radius: var(--r-sm); background: var(--surface-2); }
.bead-check-summary-stats span { color: var(--text-3); font-size: 11px; font-weight: 700; }
.bead-check-summary-stats strong { overflow-wrap: anywhere; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.bead-check-readonly { margin: var(--sp-3) 0; color: var(--text-2); font-size: 12px; line-height: 1.5; }
.bead-check-actions { display: grid; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-5); }
.bead-check-confirm-trigger { min-height: var(--h-lg); }
.bead-check-confirm-summary { display: grid; gap: var(--sp-1); padding: var(--sp-2); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: 12px; }
.bead-check-confirm-summary strong { color: var(--text); overflow-wrap: anywhere; }
.bead-check-confirm-list { display: grid; gap: var(--sp-1); max-height: 34dvh; overflow: auto; margin: 0; padding: 0; list-style: none; }
.bead-check-confirm-list li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); min-height: 36px; padding: var(--sp-1) var(--sp-2); border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 12px; }
.bead-check-confirm-list li strong { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.bead-check-confirm-list li strong.is-negative { color: var(--danger-strong); }
.bead-check-shortages { margin-bottom: var(--sp-4); padding: var(--sp-3); border: 1px solid color-mix(in srgb, var(--danger) 24%, var(--border)); border-radius: var(--r-card); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.bead-check-shortages h2, .bead-check-results-head h2 { margin: 0; color: var(--text); font-size: 14px; font-weight: 800; }
.bead-check-shortages h2 { color: var(--danger-strong); }
.bead-check-shortages ul { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0 0; padding: 0; list-style: none; }
.bead-check-shortages li { display: flex; align-items: baseline; gap: var(--sp-2); color: var(--danger-strong); font-size: 12px; }
.bead-check-results-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.bead-check-results-head > span { color: var(--text-3); font-size: 12px; }
.bead-check-list { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.bead-check-row { display: grid; grid-template-columns: minmax(70px, 1.1fr) minmax(0, 2fr); align-items: center; gap: var(--sp-2); min-width: 0; padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.bead-check-color { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.bead-check-swatch { display: block; flex: none; width: 28px; height: 28px; border: 1px solid var(--border-2); border-radius: var(--r-sm); }
.bead-check-color-info { display: grid; min-width: 0; gap: 2px; }
.bead-check-color-info strong { overflow-wrap: anywhere; color: var(--text); font-size: 12px; }
.bead-check-color-info small { color: var(--text-3); font-size: 10px; line-height: 1.25; }
.bead-check-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.bead-check-values > div { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.bead-check-values span { color: var(--text-3); font-size: 10px; line-height: 1.2; white-space: nowrap; }
.bead-check-values strong { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bead-check-values strong.is-negative, .bead-check-summary-stats strong.is-negative { color: var(--danger-strong); }
.bead-check-empty { margin: 0; }
:root[data-device="pc"] .bead-check-summary { grid-template-columns: minmax(240px, 1.1fr) minmax(0, 1.9fr); align-items: center; padding: var(--sp-5); }
:root[data-device="pc"] .bead-check-summary-main h1 { font-size: 22px; }
:root[data-device="pc"] .bead-check-row { grid-template-columns: minmax(220px, 1.1fr) minmax(0, 1.9fr); padding: var(--sp-3); }
:root[data-device="pc"] .bead-check-color-info strong { font-size: 14px; }
:root[data-device="pc"] .bead-check-values span { font-size: 11px; }
:root[data-device="pc"] .bead-check-values strong { font-size: 16px; }
:root[data-device="pc"] .bead-check-swatch { width: 36px; height: 36px; }

@media (max-width: 360px) {
  .bead-check-summary { padding: var(--sp-3); }
  .bead-check-row { grid-template-columns: minmax(64px, .9fr) minmax(0, 2fr); gap: 6px; padding: 6px; }
  .bead-check-color { gap: 5px; }
  .bead-check-swatch { width: 24px; height: 24px; }
  .bead-check-values { gap: 2px; }
  .bead-check-values span { font-size: 10px; }
  .bead-check-values strong { font-size: 12px; }
}

/* 移动端「我的」页不再显示公共品牌栏；标题接管页首空间，并保留独立应用窗口的安全区。 */
:root[data-device="mobile"] .mine-page-header {
  padding: calc(var(--safe-t) + var(--sp-2)) 0 var(--sp-3);
  margin-bottom: 0; border-bottom: 0;
}
:root[data-device="mobile"] .drawings-page-header {
  padding: calc(var(--safe-t) + var(--sp-3)) 0 var(--sp-3);
  margin-bottom: 0; border-bottom: 0;
}
:root[data-device="mobile"] .global-notice.page-header-route { top: 0; }
:root[data-device="mobile"] .bead-library-page-header {
  padding: calc(var(--safe-t) + var(--sp-2)) 0 var(--sp-3);
  margin-bottom: 0; border-bottom: 0;
}
:root[data-device="mobile"] .bead-library-detail-header {
  padding: calc(var(--safe-t) + var(--sp-2)) 0 var(--sp-3);
  margin-bottom: 0; border-bottom: 0;
}

/* P16：保留紧凑视觉同时把高频操作补足到项目的 44px 触控尺寸。 */
:root[data-device="pc"] .btn-sm { height: var(--h-lg); }
.draft-tip .btn { height: var(--h-lg); }
.sc-help-btn { height: var(--h-lg); min-height: var(--h-lg); }
:root[data-device="pc"] .sc-title-acts > button.t-hint { min-height: var(--h-lg); }

@media (prefers-reduced-motion: reduce) {
  .btn:active, :root[data-device="mobile"] .hero-entry:active,
  .bead-warehouse-card:active { transform: none; }
  .btn[aria-busy="true"]::after { animation: none; }
  .toast-enter-from, .toast-leave-to { transform: none; }
  .mask.fade-enter-from .modal, .mask.fade-leave-to .modal { transform: none; }
  .toast-enter-active, .toast-leave-active, .toast-move,
  .mask.fade-enter-active, .mask.fade-leave-active,
  .mask.fade-enter-active .modal, .mask.fade-leave-active .modal { transition-duration: .01ms; }
}
