:root {
  --paper: #f1f4f3;
  --cotton: #fbfcfa;
  --surface: #ffffff;
  --ink: #182f42;
  --body: #364b5b;
  --muted: #586d78;
  --line: #d8e0df;
  --line-dark: #b9c7c8;
  --blue: #2d5bb9;
  --blue-dark: #244b9b;
  --blue-soft: #eaf0fb;
  --wood: #a78554;
  --coral: #c45442;
  --sage: #3f624d;
  --shadow: 0 10px 28px rgba(24, 47, 66, .07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #7296e2; outline-offset: 3px; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; }

/* A narrow workbench header replaces the generic dashboard rail. */
.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  width: 100%;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 0 max(28px, calc((100vw - 1260px) / 2));
  color: #f7fafb;
  background: var(--ink);
  border-bottom: 1px solid #385064;
}
.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.7px;
}
.brand > span:last-child > span { color: #a9c2f3; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #6f8ba0;
  border-radius: 50%;
  background: #203d55;
}
.brand-mark svg { width: 23px; fill: none; stroke: #dce9ff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.workspace-switcher, .nav-label, .sidebar .nav-label-spaced + .nav-list, .profile-button { display: none !important; }
.sidebar .nav-label + .nav-list { display: flex; align-items: center; gap: 7px; }
.nav-item {
  position: relative;
  min-height: 68px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  color: #c4d0d8;
  border-radius: 0;
  font-size: 14px;
  transition: color .16s ease, background-color .16s ease;
}
.nav-item svg, .nav-item .nav-dot, .nav-item[href="#threads"] { display: none !important; }
.nav-item:hover { color: #fff; background: #203d55; }
.nav-item.active { color: #fff; box-shadow: inset 0 -3px 0 #a9c2f3; background: transparent; }
.sidebar-bottom { margin: 0 0 0 auto; }
.usage-card { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.usage-heading { display: flex; align-items: center; gap: 8px; color: #dbe3e8; font-size: 13px; }
.usage-heading span:last-child { padding: 4px 9px; color: #fff; border: 1px solid #657c8e; border-radius: 3px; font-size: 12px; }
.usage-card p, .upgrade-button, .sidebar-bottom .profile-button { display: none; }

.main-content { width: min(1260px, 100%); margin: 0 auto; padding: 0 28px 36px; }
.topbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.breadcrumbs { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.breadcrumbs svg { width: 12px; height: 12px; fill: none; stroke: #72848e; stroke-width: 1.6; }
.breadcrumbs b { color: var(--body); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
/* 用户中心：右上角图标 + 下拉菜单；未登录时图标带灰点，登录后变蓝点 */
.user-center { position: relative; }
.user-button { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #cddbeb; border-radius: 10px; color: #45627f; background: #fff; }
.user-button:hover { border-color: #87b5f3; color: var(--blue-dark); background: #f2f7ff; }
.user-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.user-button.signed-in { border-color: #a9c9f4; color: var(--blue-dark); background: #eef5ff; }
.user-state-dot { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: #93a4b8; }
.user-button.signed-in .user-state-dot { background: #2e9b70; }
.user-menu { position: absolute; z-index: 40; top: 44px; right: 0; width: 224px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 14px 34px rgba(23, 43, 77, .16); }
.user-menu-head { display: grid; gap: 2px; padding: 2px 4px 9px; border-bottom: 1px solid var(--line); }
.user-menu-head b { color: var(--ink); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.user-menu-head small { color: #526983; font-size: 13px; }
.user-menu-item { width: 100%; min-height: 34px; margin-top: 8px; padding: 7px 10px; border: 1px solid #cddbeb; border-radius: 8px; color: #3d5a7c; background: #fff; font-size: 13px; font-weight: 600; text-align: left; }
.user-menu-item:hover { border-color: #87b5f3; color: var(--blue-dark); background: #f2f7ff; }
.engine-status { display: inline-flex; align-items: center; gap: 8px; color: var(--body); font-size: 13px; }
.engine-status i, .recent-ready i, .preview-badge i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #368567; }
.engine-status.offline { color: #8f483c; }
.engine-status.offline i { background: var(--coral); }
.icon-button { display: none; }
.help-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 3px;
  color: var(--body);
  background: transparent;
  font-size: 13px;
}
.help-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 0 19px;
}
.eyebrow, .section-kicker { display: none; }
.page-intro h1 {
  margin: 0 0 5px;
  color: var(--ink);
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: .01em;
}
.page-intro h1 span { color: inherit; }
.intro-copy { margin: 0; color: var(--body); font-size: 14px; line-height: 1.6; }
.intro-note {
  display: flex;
  flex: none;
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.note-icon {
  width: 13px;
  height: 13px;
  flex: none;
  border: 2px solid var(--wood);
  border-radius: 50%;
  outline: 1px dashed var(--wood);
  outline-offset: 3px;
}
.intro-note span:last-child { display: grid; gap: 2px; }
.intro-note b { color: var(--ink); font-size: 14px; }
.intro-note small { color: var(--muted); font-size: 13px; }
.steps { display: flex; align-items: center; gap: 13px; padding: 0 0 16px; }
.step { display: flex; align-items: center; gap: 7px; color: #4c606b; font-size: 13px; white-space: nowrap; }
.step-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #b7c4c9;
  border-radius: 50%;
  color: #536976;
  background: transparent;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.step.active { color: var(--ink); font-weight: 600; }
.step.active .step-number { color: #fff; border-color: var(--ink); background: var(--ink); }
.step-connector { width: 44px; height: 1px; background: #bfcacc; }

.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 344px; align-items: start; gap: 28px; }
.work-column { display: grid; gap: 22px; min-width: 0; }
.panel { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.upload-panel { padding: 0; animation: canvas-arrive .45s cubic-bezier(.2,.75,.25,1) both; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h2, .settings-title h2, .recent-heading h2 { margin: 0; color: var(--ink); font-size: 18px; line-height: 1.35; letter-spacing: 0; font-weight: 650; }
.panel-heading p { margin: 4px 0 0; color: var(--body); font-size: 14px; line-height: 1.5; }
.secure-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 4px 0 4px 10px;
  color: var(--sage);
  border: 0;
  border-left: 1px solid #b9c9bf;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
}
.secure-pill svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dropzone {
  position: relative;
  min-height: 324px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #c8d1d0;
  border-radius: 3px;
  background-color: #e8eeec;
  background-image: repeating-linear-gradient(0deg, transparent 0 13px, rgba(34,64,77,.045) 13px 14px), repeating-linear-gradient(90deg, transparent 0 13px, rgba(34,64,77,.045) 13px 14px);
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}
.dropzone::before, .dropzone::after {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: min(254px, 62vw);
  aspect-ratio: 1;
  content: "";
  pointer-events: none;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
.dropzone::before {
  border: 7px solid #ae8d5b;
  box-shadow: inset 0 0 0 3px #e7ddc6, 0 5px 10px rgba(25,43,51,.12);
}
.dropzone::after { width: min(228px, 56vw); border: 1px dashed rgba(36,68,82,.42); }
.dropzone.dragging { border-color: var(--blue); background-color: #e4ebf8; }
.dropzone.dragging::before { border-color: var(--blue); }
.dropzone.has-file { min-height: 324px; border-color: #bdc9ca; background-color: #e8eeec; cursor: default; }
.dropzone.has-file::before, .dropzone.has-file::after { display: none; }
.empty-upload { position: relative; z-index: 1; width: min(100%, 400px); padding: 24px 18px; text-align: center; }
.upload-art { width: 70px; height: 70px; margin: 0 auto 13px; display: grid; place-items: center; }
.art-spark { display: none; }
.art-circle { width: 57px; height: 57px; display: grid; place-items: center; border: 1px solid #a9bac1; border-radius: 50%; color: var(--blue); background: var(--cotton); }
.art-circle svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.empty-upload h3, .selected-upload h3 { margin: 0 0 5px; color: var(--ink); font-size: 17px; font-weight: 650; line-height: 1.4; }
.empty-upload p { margin: 0; color: var(--body); font-size: 14px; }
.text-button { padding: 0; border: 0; border-bottom: 1px solid currentColor; color: var(--blue-dark); background: none; font-size: 14px; font-weight: 650; }
.file-hint { display: block; margin-top: 8px; color: var(--body); font-size: 13px; }
.selected-upload { width: 100%; min-height: 322px; padding: 24px; display: flex; align-items: center; justify-content: center; gap: 20px; }
.image-frame { width: min(48%, 235px); height: 235px; display: grid; place-items: center; flex: none; overflow: hidden; border: 1px solid #bdc9ca; border-radius: 2px; background: var(--cotton); }
.image-frame img { width: 100%; height: 100%; object-fit: contain; }
.file-details { min-width: 0; }
.file-ready { display: flex; align-items: center; gap: 7px; color: var(--sage); font-size: 13px; font-weight: 600; }
.file-ready i { width: 7px; height: 7px; border-radius: 50%; background: #368567; }
.selected-upload h3 { max-width: 270px; margin: 8px 0 4px; overflow-wrap: anywhere; }
.selected-upload p { margin: 0; color: var(--body); font-size: 13px; }
.remove-button { margin-top: 13px; padding: 7px 9px; border: 1px solid var(--line-dark); border-radius: 2px; color: var(--body); background: var(--cotton); font-size: 13px; }
.remove-button span { margin-left: 4px; }
.upload-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--body); font-size: 13px; line-height: 1.5; }
.upload-foot > span { display: flex; align-items: flex-start; gap: 7px; }
.upload-foot svg { width: 16px; height: 16px; flex: none; margin-top: 1px; fill: none; stroke: #60747d; stroke-width: 1.4; stroke-linecap: round; }
.upload-foot a { color: var(--blue-dark); font-weight: 600; white-space: nowrap; }
.upload-foot a b { margin-left: 4px; font-weight: 500; }

.settings-panel {
  position: relative;
  padding: 22px 22px 19px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--cotton);
}
.settings-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.settings-params { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.settings-params .setting-group { min-width: 0; margin-bottom: 14px; }
.settings-title h2 { font-size: 18px; }
.settings-gear { width: 32px; height: 32px; display: grid; place-items: center; color: var(--body); border: 1px solid var(--line); border-radius: 50%; background: transparent; }
.settings-gear svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.setting-group { margin-bottom: 18px; }
.setting-label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.setting-label > span:first-child:not(.info-tip) { float: right; color: var(--muted); font-size: 13px; font-weight: 400; }
.info-tip { float: right; width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid #9aabb2; border-radius: 50%; color: var(--body); font-size: 12px; font-weight: 500; }
.input-with-unit { height: 39px; display: flex; align-items: center; border: 1px solid var(--line-dark); border-radius: 2px; background: #fff; }
.input-with-unit:focus-within, .select-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(45,91,185,.13); }
.input-with-unit input { width: 100%; height: 100%; padding: 0 11px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; font-variant-numeric: tabular-nums; }
.input-with-unit input::-webkit-inner-spin-button { -webkit-appearance: none; }
.input-with-unit > span { padding-right: 11px; color: var(--body); font-size: 13px; }
.range-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; color: var(--body); font-size: 12px; }
.range-row input[type="range"], .color-setting > input[type="range"] { width: 100%; height: 4px; margin: 11px 0 0; appearance: none; border-radius: 3px; background: #d6dfdf; outline: none; }
.range-row input[type="range"] { flex: 1; margin: 0 3px; }
.range-row input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-slider-thumb { width: 15px; height: 15px; appearance: none; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.range-row input[type="range"]::-moz-range-thumb, input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.select-wrap { position: relative; border: 1px solid var(--line-dark); border-radius: 2px; background: #fff; }
.select-wrap select { width: 100%; height: 39px; appearance: none; padding: 0 34px 0 11px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; }
.select-wrap > svg { position: absolute; top: 12px; right: 10px; width: 15px; height: 15px; pointer-events: none; fill: none; stroke: #536976; stroke-width: 1.6; }
.setting-hint { margin: 6px 0 0; color: var(--body); font-size: 13px; }
.label-line { display: flex; align-items: center; justify-content: space-between; }
.label-line .setting-label { margin: 0; }
.label-line > b { color: var(--blue-dark); font-size: 15px; font-variant-numeric: tabular-nums; }
.label-line small { color: var(--body); font-size: 13px; font-weight: 400; }
.color-setting > input[type="range"] { margin-top: 14px; accent-color: var(--blue); }
.color-setting .range-row { margin-top: 5px; }
.setting-divider, .settings-divider { height: 1px; margin: 18px 0 15px; background: var(--line); }
.format-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.format-heading .setting-label { margin-bottom: 3px; }
.select-all { padding: 2px 0; border: 0; color: var(--blue-dark); background: transparent; font-size: 13px; }
.format-options { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; margin-top: 8px; }
.format-option { position: relative; min-width: 0; min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 3px; border: 1px solid var(--line); border-radius: 2px; background: #fff; text-align: center; cursor: pointer; transition: border-color .16s ease, background-color .16s ease; }
.format-option:hover { border-color: #96addc; }
.format-option:focus-within { outline: 3px solid #7296e2; outline-offset: 2px; }
.format-option input:focus-visible { outline: none; }
.format-option input { position: absolute; opacity: 0; pointer-events: none; }
.format-logo { width: 42px; height: 31px; display: grid; place-items: center; flex: none; border: 1px solid #c7d1d4; border-radius: 2px; color: #385a83; background: #fff; font-size: 13px; font-weight: 750; letter-spacing: .2px; }
.logo-pes { color: #994f43; }
.logo-vp3 { color: #56518a; }
.format-copy { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.format-copy b { color: var(--ink); font-size: 12px; font-weight: 600; }
.format-copy small { color: var(--body); font-size: 13px; }
.format-check { position: absolute; top: 5px; right: 5px; width: 15px; height: 15px; display: grid; place-items: center; border: 1px solid #889ba2; border-radius: 2px; background: #fff; }
.format-option.checked .format-check { border-color: var(--blue); background: var(--blue); }
.format-option.checked .format-check::after { width: 7px; height: 4px; border-bottom: 1.5px solid #fff; border-left: 1.5px solid #fff; content: ""; transform: rotate(-45deg) translateY(-1px); }
.more-formats { grid-column: 1 / -1; display: flex; width: 100%; min-height: 34px; position: relative; z-index: 2; align-items: center; justify-content: flex-start; gap: 8px; justify-self: stretch; margin-top: 3px; padding: 5px 0; border: 0; color: var(--blue-dark); background: transparent; text-align: left; font-size: 13px; }
.more-formats span { color: var(--body); }
.extra-format { animation: option-arrive .18s ease both; }
.quality-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 15px; padding: 0; border: 0; background: transparent; }
.quality-mark { width: 13px; height: 13px; flex: none; margin: 4px 1px 0; border: 2px solid var(--wood); border-radius: 50%; }
.quality-note b { display: block; color: var(--ink); font-size: 13px; font-weight: 650; }
.quality-note p { margin: 4px 0 0; color: var(--body); font-size: 13px; line-height: 1.5; }
.error-box { margin: 0 0 12px; padding: 9px 10px; border: 1px solid #d6a79f; border-radius: 2px; background: #fff6f3; color: #83382f; font-size: 13px; line-height: 1.5; }
.convert-button {
  position: relative;
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue-dark);
  border-radius: 2px;
  color: #fff;
  background: var(--blue);
  font-size: 15px;
  font-weight: 650;
  transition: background-color .16s ease, transform .12s ease;
}
.convert-button:hover:not(:disabled) { background: var(--blue-dark); }
.convert-button:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.convert-button:disabled { border-color: #d2dadd; color: #526674; background: #dfe5e5; cursor: not-allowed; }
.button-label { display: inline-flex; align-items: center; gap: 9px; }
.button-label svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.button-arrow { position: absolute; right: 14px; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.button-loading { display: inline-flex; align-items: center; gap: 9px; }
.button-loading i { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.time-estimate { margin-top: 9px; color: var(--body); text-align: center; font-size: 13px; }

.preview-panel { padding: 20px; border: 1px solid var(--line); border-radius: 3px; background: var(--cotton); }
.preview-panel:not(.hidden) { animation: panel-arrive .3s ease both; }
.preview-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 0 4px 10px; color: var(--sage); border-left: 1px solid #b9c9bf; font-size: 13px; }
.result-stats { display: flex; align-items: center; justify-content: space-around; gap: 8px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.result-stats > div { display: grid; gap: 3px; text-align: center; }
.result-stats b { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.result-stats span { color: var(--body); font-size: 13px; }
.result-stats > i { width: 1px; height: 24px; background: var(--line); }
.download-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 14px 0 9px; }
.download-header h3 { margin: 0 0 3px; color: var(--ink); font-size: 15px; }
.download-header p { margin: 0; color: var(--body); font-size: 13px; }
.format-count { color: var(--body); font-size: 13px; }
.download-list { display: grid; gap: 6px; }
.download-action { flex: none; margin-left: auto; padding: 6px 9px; border: 1px solid var(--blue); border-radius: 2px; color: var(--blue-dark); background: #fff; font-size: 13px; font-weight: 600; }
.download-action:hover { color: #fff; background: var(--blue); }
.warning-list { margin-top: 10px; }
.warning-item { padding: 8px 10px; border-left: 2px solid #a77b27; background: #f7f1e3; color: #634a20; font-size: 13px; line-height: 1.5; }

.recent-section { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }
.recent-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.recent-heading h2 { font-size: 17px; }
.recent-list { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.recent-card { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 5px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.recent-thumb { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border: 1px solid #c2cfcd; border-radius: 50%; color: var(--sage); background: #e7eeeb; font-size: 16px; }
.thumb-flower { color: var(--blue); background: #e8edf8; }
.thumb-mountain { background: #e8eeec; }
.thumb-mountain .limit-mark { color: #385d5a; font-family: inherit; font-size: 11px; font-weight: 700; }
.thumb-initial { color: var(--coral); background: #f7eae7; font-family: inherit; font-size: 17px; font-style: normal; }
.recent-info { min-width: 0; display: grid; gap: 2px; }
.recent-info b { color: var(--ink); font-size: 14px; font-weight: 600; }
.recent-info span { color: var(--body); font-size: 13px; line-height: 1.4; }
.recent-ready, .recent-more { display: none; }
.footer { display: flex; align-items: center; gap: 18px; margin-top: 24px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--body); font-size: 13px; }
.footer span:nth-child(2) { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.footer span:nth-child(2) i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--sage); }
.footer a { color: var(--blue-dark); }
.toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; max-width: min(90vw, 560px); padding: 11px 16px; transform: translateX(-50%); border: 1px solid #516879; border-radius: 3px; color: #fff; background: var(--ink); box-shadow: var(--shadow); font-size: 14px; pointer-events: none; }
.toast.show { animation: toast-arrive .2s ease-out; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes canvas-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes panel-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes option-arrive { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-arrive { from { opacity: 0; transform: translate(-50%, 5px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 主流程转换失败提示：固定在底部，不新增文档高度，避免破坏手机单屏 */
.convert-error-banner {
  position: fixed; z-index: 80; left: 50%; bottom: 24px;
  width: min(92vw, 560px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid #e7b4aa; border-radius: 10px;
  color: #7d332a; background: #fff6f3;
  box-shadow: 0 10px 30px rgba(125, 51, 42, .16);
  font-size: 13px; line-height: 1.45;
}
.convert-error-banner .retry-button { margin-left: auto; flex: none; }
.convert-error-icon {
  width: 20px; height: 20px; flex: none; display: grid; place-items: center;
  border-radius: 50%; color: #fff; background: #b04b3d;
  font-size: 13px; font-weight: 700;
}
.convert-button.is-busy { pointer-events: none; }
.convert-button.is-busy .button-arrow { display: none; }
@media (max-width: 760px) {
  .convert-error-banner { bottom: 12px; width: calc(100vw - 24px); align-items: flex-start; }
  .convert-error-banner .retry-button { margin-left: 0; }
}

@media (min-width: 1500px) {
  .main-content { padding-right: 36px; padding-left: 36px; }
  .studio-grid { grid-template-columns: minmax(0,1fr) 360px; gap: 34px; }
  .dropzone, .dropzone.has-file { min-height: 354px; }
}
@media (max-width: 980px) {
  .sidebar { gap: 20px; padding-right: 22px; padding-left: 22px; }
  .main-content { padding-right: 22px; padding-left: 22px; }
  .studio-grid { grid-template-columns: minmax(0,1fr) 320px; gap: 20px; }
  .settings-panel { padding: 18px; }
  .dropzone, .dropzone.has-file { min-height: 300px; }
  .recent-list { gap: 12px; }
}
@media (max-width: 760px) {
  .sidebar { height: 62px; gap: 12px; padding-right: 18px; padding-left: 18px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 31px; height: 31px; }
  .sidebar .nav-label + .nav-list { margin-left: auto; }
  .nav-item { min-height: 62px; padding: 0 9px; font-size: 13px; }
  .sidebar-bottom { margin-left: 0; }
  .usage-card { gap: 0; }
  .usage-heading span:first-child { display: none; }
  .usage-heading span:last-child { padding: 4px 7px; }
  .main-content { padding-right: 18px; padding-left: 18px; }
  .topbar { height: 43px; }
  .breadcrumbs { font-size: 13px; }
  .help-button { min-height: 31px; padding: 0 7px; font-size: 13px; }
  .page-intro { align-items: flex-start; padding: 22px 0 17px; }
  .page-intro h1 { font-size: 30px; }
  .intro-note { display: none; }
  .steps { gap: 8px; padding-bottom: 14px; }
  .step { gap: 5px; font-size: 13px; }
  .step-connector { width: clamp(12px, 5vw, 34px); }
  .studio-grid { grid-template-columns: 1fr; gap: 18px; }
  .work-column { gap: 18px; }
  .dropzone, .dropzone.has-file { min-height: 278px; }
  .settings-panel { padding: 18px; }
  .settings-title { margin-bottom: 16px; }
  .setting-group { margin-bottom: 15px; }
  .setting-divider, .settings-divider { margin: 15px 0; }
  .format-options { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
  .format-option { position: relative; min-height: 76px; flex-direction: column; justify-content: center; gap: 5px; padding: 8px 3px; text-align: center; }
  .format-logo { width: 46px; height: 30px; }
  .format-copy { align-items: center; }
  .format-copy b, .format-copy small { font-size: 13px; line-height: 1.3; }
  .format-check { position: absolute; top: 5px; right: 5px; width: 15px; height: 15px; }
  .more-formats { grid-column: 1 / -1; }
  .recent-list { grid-template-columns: 1fr; gap: 10px; }
  .recent-card { padding: 5px 0; }
  .footer { flex-wrap: wrap; gap: 8px 14px; }
  .footer span:nth-child(2) { width: 100%; margin-left: 0; order: 3; }
}
@media (max-width: 480px) {
  .sidebar { height: 58px; padding-right: 13px; padding-left: 13px; }
  .sidebar .nav-label + .nav-list { display: none; }
  .brand { gap: 8px; font-size: 17px; }
  .sidebar-bottom { margin-left: auto; }
  .main-content { padding-right: 14px; padding-left: 14px; }
  .topbar-actions { gap: 8px; }
  .help-button { width: 32px; height: 32px; overflow: hidden; justify-content: center; font-size: 0; }
  .help-button svg { width: 16px; height: 16px; flex: none; }
  .page-intro { padding-top: 19px; }
  .page-intro h1 { font-size: 28px; }
  .intro-copy { max-width: 310px; font-size: 13px; }
  .steps { gap: 6px; }
  .step { gap: 4px; font-size: 12px; }
  .step-number { width: 22px; height: 22px; font-size: 12px; }
  .step-connector { width: 12px; }
  .panel-heading h2, .settings-title h2 { font-size: 17px; }
  .panel-heading p { font-size: 13px; }
  .secure-pill { font-size: 13px; }
  .dropzone, .dropzone.has-file { min-height: 255px; }
  .dropzone::before { width: 210px; }
  .dropzone::after { width: 188px; }
  .empty-upload { padding: 17px 12px; }
  .empty-upload h3 { font-size: 16px; }
  .selected-upload { min-height: 253px; padding: 14px; flex-direction: column; gap: 12px; text-align: center; }
  .image-frame { width: 140px; height: 140px; }
  .selected-upload h3 { max-width: 260px; overflow-wrap: anywhere; }
  .remove-button { margin-top: 9px; }
  .upload-foot { flex-direction: column; gap: 6px; font-size: 13px; }
  .result-stats { flex-wrap: wrap; row-gap: 12px; }
  .result-stats > div { width: calc(50% - 15px); }
  .result-stats > i:nth-of-type(2) { display: none; }
  .preview-panel { padding: 15px; }
  .download-action { padding: 6px 7px; }
  .recent-heading h2 { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* EmbWorld: MakerWorld-inspired creator workbench, not a marketplace clone. */
:root {
  --paper: #f4f7fb;
  --cotton: #ffffff;
  --surface: #ffffff;
  --ink: #172b4d;
  --body: #3c536d;
  --muted: #5d7088;
  --line: #e1e9f3;
  --line-dark: #bfcee0;
  --blue: #1677f8;
  --blue-dark: #075fd8;
  --blue-soft: #eaf3ff;
  --wood: #2d7ce8;
  --sage: #347552;
  --coral: #c45442;
  --shadow: 0 8px 24px rgba(32, 78, 139, .08);
}
body { background: var(--paper); color: var(--ink); }
::selection { color: #0c3f91; background: #cfe3ff; }
:focus-visible { outline-color: #398cff; }
.sidebar {
  color: var(--ink);
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(26, 61, 108, .035);
}
.brand { color: var(--ink); letter-spacing: -.55px; }
.brand > span:last-child > span { color: var(--blue-dark); }
.brand-mark {
  border: 0;
  border-radius: 9px;
  background: var(--blue);
  box-shadow: 0 4px 11px rgba(22,119,248,.2);
}
.brand-mark svg { stroke: #fff; }
.nav-item {
  min-height: 42px;
  border-radius: 8px;
  color: #5b6e86;
  transition: color .16s ease, background-color .16s ease, transform .16s ease;
}
.nav-item:hover { color: var(--blue-dark); background: #f2f7ff; }
.nav-item.active {
  color: var(--blue-dark);
  border-radius: 8px;
  background: var(--blue-soft);
  box-shadow: none;
  font-weight: 650;
}
.usage-heading { color: #4c6078; }
.usage-heading span:last-child {
  color: var(--blue-dark);
  border-color: #cfe1fb;
  border-radius: 999px;
  background: #f0f6ff;
}
.topbar { border-color: var(--line); }
.breadcrumbs svg { stroke: #8194ac; }
.engine-status { color: #435b76; }
.page-intro h1 {
  color: var(--ink);
  font-family: inherit;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.025em;
}
.intro-copy { color: #4a607a; }
.intro-note {
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #d8e8fc;
  border-radius: 10px;
  background: #f2f7ff;
}
.note-icon {
  border-color: var(--blue);
  outline-color: #8bbafa;
}
.intro-note b { color: #1a3c67; }
.intro-note small { color: #506b8c; }
.step { color: #5a6e85; }
.step-number { border-color: #bbcadc; color: #536a84; }
.step.active .step-number {
  border-color: var(--blue-dark);
  background: var(--blue-dark);
  box-shadow: 0 3px 8px rgba(22,119,248,.2);
}
.step-connector { background: #c9d9ed; }
.studio-grid { grid-template-columns: minmax(0,1fr) 356px; gap: 24px; }
.panel-heading h2, .settings-title h2, .recent-heading h2 { color: var(--ink); }
.panel-heading p { color: #526983; }
.secure-pill {
  color: var(--blue-dark);
  border-left-color: #d2e3f8;
}
.dropzone {
  border: 2px dashed #a9c9f5;
  border-radius: 14px;
  background-color: #f8fbff;
  background-image: repeating-linear-gradient(0deg, transparent 0 13px, rgba(54,113,196,.045) 13px 14px), repeating-linear-gradient(90deg, transparent 0 13px, rgba(54,113,196,.045) 13px 14px);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.dropzone::before {
  border-color: #3987ef;
  box-shadow: inset 0 0 0 3px #dcecff, 0 5px 13px rgba(29,90,161,.13);
}
.dropzone::after { border-color: rgba(42,114,203,.45); }
.dropzone.dragging {
  border-color: var(--blue);
  background-color: #eaf3ff;
  box-shadow: inset 0 0 0 2px rgba(22,119,248,.08);
}
.dropzone.dragging::before { border-color: var(--blue-dark); }
.dropzone.has-file {
  border-style: solid;
  border-color: #c9d9ec;
  border-radius: 14px;
  background-color: #f5f9ff;
}
.art-circle {
  border-color: #bdd5f4;
  color: var(--blue);
  background: #fff;
}
.empty-upload h3, .selected-upload h3 { color: var(--ink); }
.text-button { color: var(--blue-dark); }
.file-hint, .selected-upload p, .upload-foot { color: #526983; }
.upload-foot a { color: var(--blue-dark); }
.image-frame { border-color: #d3e0ef; border-radius: 10px; }
.remove-button { border-color: #cad8e8; border-radius: 7px; color: #526983; }
.settings-panel {
  border-color: var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.settings-gear {
  border-color: #d9e5f2;
  border-radius: 9px;
  color: var(--blue-dark);
  background: #f7faff;
}
.setting-label { color: #1d3555; }
.input-with-unit, .select-wrap {
  border-color: #c9d7e8;
  border-radius: 8px;
}
.input-with-unit:focus-within, .select-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22,119,248,.13);
}
.select-wrap select { color: var(--ink); }
.setting-hint, .range-row, .label-line small { color: #5a6f88; }
.setting-divider, .settings-divider { background: #e7edf5; }
.format-option {
  border-color: #dbe5f1;
  border-radius: 9px;
  background: #fff;
}
.format-option:hover { border-color: #87b5f3; background: #f9fbff; }
.format-option.checked {
  border-color: #78aaf0;
  background: #eef5ff;
}
.format-logo { border-color: #d4e0ed; border-radius: 6px; }
.format-check { border-color: #a9bacf; border-radius: 4px; }
.format-option.checked .format-check {
  border-color: var(--blue);
  background: var(--blue);
}
.select-all, .more-formats { color: var(--blue-dark); }
.quality-note b { color: #254563; }
.quality-note p { color: #536b85; }
.quality-mark { border-color: var(--blue); }
.error-box { border-color: #e7b4aa; border-radius: 8px; }
.convert-button {
  min-height: 48px;
  border: 1px solid var(--blue-dark);
  border-radius: 9px;
  background: var(--blue);
  box-shadow: 0 5px 12px rgba(22,119,248,.17);
}
.convert-button:hover:not(:disabled) {
  background: #0869ec;
  box-shadow: 0 7px 16px rgba(22,119,248,.22);
}
.convert-button:disabled {
  border-color: #d2e0f1;
  color: #536d8b;
  background: #eaf1fa;
  box-shadow: none;
}
.remove-button, .help-button, .download-action { transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease; }
.remove-button:hover, .help-button:hover { border-color: #a8c6ef; color: var(--blue-dark); background: #f4f8ff; }
.convert-button:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.time-estimate { color: #5c718a; }
.preview-panel {
  border-color: var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.preview-badge { color: var(--blue-dark); border-left-color: #d2e3f8; }
.engine-status i, .recent-ready i, .preview-badge i { background: #2e9b70; }
.result-stats { border-color: #e3eaf3; }
.download-action { border-radius: 7px; }
.download-action:hover { border-color: var(--blue); background: var(--blue); }
.warning-item { border-radius: 0 7px 7px 0; }
.recent-section { border-color: var(--line); }
.recent-list { gap: 12px; }
.recent-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(32,78,139,.035);
}
.recent-thumb { border-color: #d4e4f7; color: var(--blue-dark); background: #edf5ff; }
.thumb-flower { color: #176edc; background: #e8f2ff; }
.thumb-mountain { background: #edf5ff; }
.thumb-mountain .limit-mark { color: #2768b4; }
.footer { border-color: var(--line); color: #556c85; }
.footer a { color: var(--blue-dark); }
.toast {
  border-color: #1456ae;
  border-radius: 9px;
  background: #173d70;
}
@media (max-width: 980px) {
  .studio-grid { grid-template-columns: minmax(0,1fr) 330px; gap: 18px; }
}
@media (max-width: 760px) {
  .sidebar { box-shadow: 0 2px 7px rgba(26,61,108,.035); }
  .nav-item { min-height: 42px; }
  .studio-grid { grid-template-columns: 1fr; }
  .recent-card { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .sidebar { box-shadow: 0 1px 5px rgba(26,61,108,.035); }
  .brand-mark { border-radius: 8px; }
  .page-intro h1 { font-size: 28px; }
  .dropzone, .dropzone.has-file { border-radius: 12px; }
  .settings-panel, .preview-panel { border-radius: 12px; }
}

.step, .step-number { transition: color .16s ease, background-color .16s ease, border-color .16s ease; }
.step.completed .step-number { border-color: #90b9ee; color: var(--blue-dark); background: #edf5ff; }
.step.completed { color: #49627e; }
.hoop-fit-status {
  grid-column: 1 / -1;
  margin: -4px 0 4px;
  padding: 9px 10px;
  border: 1px solid #d8e6f7;
  border-radius: 8px;
  color: #45627f;
  background: #f5f9ff;
  font-size: 13px;
  line-height: 1.5;
}
.hoop-fit-status.ready { border-color: #cfe4da; color: #2f644f; background: #f1f8f4; }
.hoop-fit-status.warning { border-color: #efd7a9; color: #76531e; background: #fff8e9; }
.image-preflight {
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid #d9e6f5;
  border-radius: 11px;
  background: #f8fbff;
  animation: state-arrive .22s ease-out both;
}
.preflight-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #1b3556; font-size: 14px; }
.preflight-heading span { color: #5c718a; font-size: 12px; }
.preflight-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.preflight-grid > div { display: grid; gap: 3px; min-width: 0; }
.preflight-grid > div > span { color: #5c718a; font-size: 12px; }
.preflight-grid > div > b { color: #1e3c62; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.image-preflight > p { margin: 9px 0 0; color: #49627e; font-size: 13px; line-height: 1.5; }
.upload-error, .inline-error {
  margin-top: 9px;
  padding: 9px 11px;
  border: 1px solid #e6bcb5;
  border-radius: 8px;
  color: #873d33;
  background: #fff7f5;
  font-size: 13px;
  line-height: 1.5;
}
.upload-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.upload-actions .remove-button { margin: 0; }
.format-help { margin: 10px 0 0; padding: 9px 10px; border: 1px solid #dfe9f5; border-radius: 8px; color: #365575; background: #f8fbff; }
.format-help summary { cursor: pointer; color: var(--blue-dark); font-size: 13px; font-weight: 600; }
.format-help p { margin: 7px 0 0; color: #506a86; font-size: 13px; line-height: 1.55; }
.format-help:focus-within { outline: 2px solid #8ab7f2; outline-offset: 2px; }
#format-error { margin-top: 7px; }
.conversion-status {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 11px;
  padding: 11px 12px;
  border: 1px solid #d4e5fa;
  border-radius: 9px;
  color: #244568;
  background: #f2f7ff;
  animation: state-arrive .18s ease-out both;
}
.conversion-status > span:last-child { display: grid; gap: 2px; }
.conversion-status b { color: #173b68; font-size: 14px; }
.conversion-status small { color: #526c89; font-size: 13px; line-height: 1.45; }
.conversion-spinner { width: 17px; height: 17px; flex: none; border: 2px solid #b5d0f2; border-top-color: var(--blue); border-radius: 50%; animation: conversion-spin .8s linear infinite; }
@keyframes state-arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes conversion-spin { to { transform: rotate(360deg); } }
.error-box { display: flex; align-items: center; gap: 10px; }
#error-message { flex: 1; }
.retry-button { flex: none; padding: 6px 9px; border: 1px solid #d9a7a0; border-radius: 7px; color: #7d332a; background: #fff; font-size: 13px; font-weight: 600; }
.retry-button:hover { background: #fff0ed; }
.result-stale { margin: 13px 0; padding: 10px 12px; border: 1px solid #eccf9d; border-radius: 8px; color: #6d4a15; background: #fff8e9; font-size: 13px; line-height: 1.5; }
.stale-download-note { margin: 0; padding: 10px 12px; border: 1px dashed #d6c18f; border-radius: 8px; color: #6e5526; background: #fffaf0; font-size: 13px; line-height: 1.5; }
.warning-item { display: grid; gap: 3px; }
.warning-item > b { font-size: 13px; }
.warning-item-partial { border-left-color: #bd8624; background: #fff8e9; color: #6f501d; }
.format-option:has(input:disabled) { cursor: wait; opacity: .7; }
input:disabled, select:disabled, button:disabled { cursor: not-allowed; }
.dropzone[aria-disabled="true"] { pointer-events: none; }

/* 尺寸联动、色板预览与实际线色卡 */
.size-row { grid-column: 1 / -1; display: grid; gap: 6px; margin: -2px 0 12px; }
.size-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.size-actions .text-button { flex: none; }
.size-actions .setting-hint { margin: 0; text-align: right; }
.palette-preview { margin: 0 0 12px; padding: 0; border: 0; background: transparent; }
.palette-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.palette-heading .setting-label { display: block; }
.palette-heading .setting-hint { margin: 3px 0 0; }
.palette-button { flex: none; min-height: 32px; padding: 6px 10px; border: 1px solid var(--blue); border-radius: 8px; color: var(--blue-dark); background: #fff; font-size: 13px; font-weight: 650; }
.palette-button:hover:not(:disabled) { color: #fff; background: var(--blue); }
.palette-button:disabled { border-color: #c9d7e8; color: #5a6f88; background: #f2f6fb; }
.palette-status { margin: 9px 0 0; color: #45627f; font-size: 13px; line-height: 1.5; }
.palette-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.palette-grid:empty { margin-top: 0; }
.swatch { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px 3px 3px; border: 1px solid #d7e2f0; border-radius: 999px; background: #fff; }
.swatch > i { width: 18px; height: 18px; flex: none; border: 1px solid rgba(23,43,77,.16); border-radius: 50%; }
.swatch > b { color: #526983; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.palette-note { margin: 9px 0 0; color: #526983; font-size: 13px; line-height: 1.5; }
.result-palette { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.result-palette-label { color: #526983; font-size: 13px; font-weight: 600; }
.result-palette .palette-grid { margin-top: 0; }

/* 画布编辑：变换、画笔、选区与可编辑色板 */
.canvas-stack { position: relative; width: 100%; height: 400px; display: grid; place-items: center; }
.canvas-stack canvas { grid-area: 1 / 1; display: block; }
#source-canvas { touch-action: none; border: 1px solid #d3e0ef; border-radius: 8px; background: #fff; box-shadow: 0 1px 4px rgba(23,43,77,.08); }
.overlay-canvas { pointer-events: none; }
.selected-upload { min-height: 0; padding: 52px 16px 16px; }
.image-editor { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.editor-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.editor-label { min-width: 64px; color: #526983; font-size: 13px; font-weight: 650; }
.icon-tool { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #cddbeb; border-radius: 8px; color: #3d5a7c; background: #fff; }
.icon-tool:hover:not(:disabled) { border-color: var(--blue); color: var(--blue-dark); background: #f2f7ff; }
.icon-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.image-tool { min-height: 32px; padding: 6px 10px; border: 1px solid #cddbeb; border-radius: 8px; color: #45627f; background: #fff; font-size: 13px; font-weight: 650; }
.image-tool:hover:not(:disabled) { border-color: #87b5f3; background: #f9fbff; }
.image-tool.active { border-color: var(--blue); color: var(--blue-dark); background: #eaf3ff; }
.editor-row-brush input[type="range"] { flex: 1 1 120px; min-width: 90px; }
.editor-status { margin: 4px 0 0; color: #526983; font-size: 13px; line-height: 1.5; }
.palette-list { display: grid; gap: 6px; margin-top: 9px; }
.palette-item { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border: 1px solid #dbe5f1; border-radius: 8px; background: #fff; }
.palette-item.excluded { opacity: .5; }
.palette-toggle { width: 16px; height: 16px; flex: none; accent-color: var(--blue); }
.palette-pick { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 1px solid #cddbeb; border-radius: 7px; background: #fff; }
.palette-pick > i { width: 16px; height: 16px; border: 1px solid rgba(23,43,77,.18); border-radius: 5px; background: var(--swatch, #fff); }
.palette-pick.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(22,119,248,.18); }
.palette-color { width: 32px; height: 26px; flex: none; padding: 0; border: 1px solid #cddbeb; border-radius: 6px; background: #fff; }
.palette-hex { color: #526983; font-size: 13px; font-variant-numeric: tabular-nums; }
.palette-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.editor-hint { color: #526983; font-size: 13px; line-height: 1.45; }
.switch-row { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e7edf5; cursor: pointer; }
.switch-row input { width: 16px; height: 16px; flex: none; margin-top: 2px; accent-color: var(--blue); }
.switch-row b { display: block; color: #1d3555; font-size: 13px; }
.switch-row small { color: #526983; font-size: 13px; line-height: 1.45; }

@media (max-width: 980px) {
  .canvas-stack { height: 360px; }
}
@media (max-width: 760px) {
  .canvas-stack { height: 320px; }
  .editor-label { min-width: 100%; }
}
@media (max-width: 480px) {
  .canvas-stack { height: 270px; }
  .palette-item { gap: 6px; padding: 5px 6px; }
}

/* 三步向导弹窗（对照 Chroma「Auto Digitizing」）：画布在左，步骤面板在右 */
body.wizard-open { overflow: hidden; }
.wizard { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; }
.wizard-backdrop { position: absolute; inset: 0; background: rgba(16, 35, 58, .45); backdrop-filter: blur(2px); }
.wizard-panel {
  position: relative;
  width: min(1180px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dbe5f1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 35, 58, .28);
  animation: wizard-arrive .2s cubic-bezier(.2,.75,.25,1) both;
}
@keyframes wizard-arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.wizard-header { display: flex; align-items: center; gap: 18px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.wizard-heading { min-width: 0; }
.wizard-kicker { margin: 0; color: #5d7088; font-size: 13px; letter-spacing: .01em; }
.wizard-heading h2 { margin: 1px 0 0; color: var(--ink); font-size: 19px; font-weight: 700; }
.wizard-heading h2:focus-visible { outline-offset: 3px; }
.wizard-progress { display: flex; align-items: center; gap: 8px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.wizard-progress li { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid #dbe5f1; border-radius: 999px; color: #5d7088; font-size: 13px; }
.wizard-progress li b { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: #eef3fa; color: #526983; font-size: 12px; font-variant-numeric: tabular-nums; }
.wizard-progress li.active { border-color: var(--blue); color: var(--blue-dark); background: #eaf3ff; font-weight: 650; }
.wizard-progress li.active b { color: #fff; background: var(--blue); }
.wizard-progress li.done { border-color: #cfe2fb; color: #3d5a7c; }
.wizard-progress li.done b { color: var(--blue-dark); background: #e2eeff; }
.wizard-close { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 1px solid #dbe5f1; border-radius: 9px; color: #526983; background: #fff; font-size: 19px; line-height: 1; }
.wizard-close:hover { border-color: #87b5f3; color: var(--blue-dark); background: #f2f7ff; }
.wizard-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 18px; padding: 16px 18px; overflow: hidden; }
.wizard-canvas { min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 10px; border: 1px solid #e1e9f3; border-radius: 12px; background: #f7fafe; }
.wizard-canvas .canvas-stack { height: min(58vh, 600px); }
.wizard-side { min-width: 0; min-height: 0; overflow-y: auto; padding-right: 4px; }
.wizard-step h3 { margin: 0 0 3px; color: var(--ink); font-size: 16px; font-weight: 680; }
.wizard-hint { margin: 0 0 12px; color: #526983; font-size: 13px; line-height: 1.5; }
.wizard-step .settings-params { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wizard-step .size-row { margin-bottom: 12px; }
.wizard-side .editor-status { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); }
.wizard-side .palette-preview { margin-top: 4px; }
.wizard-step #result-panel { margin-top: 14px; padding: 0; border: 0; box-shadow: none; }
.wizard-step #result-panel .panel-heading { margin-bottom: 10px; }
.wizard-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fbfcfe; }
.wizard-footer-right { display: flex; align-items: center; gap: 8px; }
.wizard-button { min-height: 38px; padding: 8px 16px; border: 1px solid #cddbeb; border-radius: 9px; color: #3d5a7c; background: #fff; font-size: 14px; font-weight: 650; }
.wizard-button:hover:not(:disabled) { border-color: #87b5f3; background: #f2f7ff; }
.wizard-button.primary { border-color: var(--blue); color: #fff; background: var(--blue); }
.wizard-button.primary:hover:not(:disabled) { border-color: var(--blue-dark); background: var(--blue-dark); }
.wizard-button:disabled { color: #8b9aac; background: #f4f7fb; }
.wizard-entry { margin-bottom: 4px; }
.wizard-entry .convert-button { width: 100%; }
.wizard-entry .setting-hint { margin-top: 7px; text-align: center; }

@media (max-width: 980px) {
  .wizard-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, auto) minmax(0, 1fr); overflow-y: auto; }
  .wizard-canvas .canvas-stack { height: min(42vh, 380px); }
}
@media (max-width: 760px) {
  .wizard { place-items: stretch; }
  .wizard-panel { width: 100%; max-height: 100dvh; height: 100dvh; border: 0; border-radius: 0; }
  .wizard-header { flex-wrap: wrap; gap: 8px; padding: 11px 14px; }
  .wizard-progress { order: 3; width: 100%; margin: 0; gap: 6px; }
  .wizard-progress li { flex: 1 1 0; min-width: 0; justify-content: center; padding: 5px 6px; font-size: 12px; }
  .wizard-progress li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wizard-body { padding: 12px 14px; gap: 12px; }
  .wizard-canvas { padding: 6px; }
  .wizard-canvas .canvas-stack { height: min(34vh, 300px); }
  .wizard-step .settings-params { grid-template-columns: minmax(0, 1fr); }
  .wizard-footer { padding: 10px 14px; }
  .wizard-button { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .wizard-panel { animation: none; }
}
@media (max-width: 760px) {
  .upload-actions { width: 100%; justify-content: center; }
  .upload-actions .remove-button { min-height: 36px; }
  .hoop-fit-status { padding: 8px 9px; }
  .format-help { margin-top: 9px; }
  .size-actions { flex-direction: column; align-items: flex-start; gap: 4px; }
  .size-actions .setting-hint { text-align: left; }
  .palette-heading { flex-direction: column; }
  .palette-button { width: 100%; }
}
@media (max-width: 480px) {
  .image-preflight { padding: 11px; }
  .preflight-grid { gap: 6px; }
  .preflight-grid > div > span { font-size: 12px; }
  .preflight-grid > div > b { font-size: 12px; }
  .error-box { align-items: flex-start; flex-wrap: wrap; }
  .retry-button { margin-left: auto; }
}

/* Simplified embroidery editor: one canvas, one live tool, real stitch conversion. */
.editor-intro { align-items: center; padding: 20px 0 17px; }
.editor-intro h1 { margin: 0; font-size: 29px; letter-spacing: -.035em; }
.editor-intro .intro-copy { margin: 5px 0 0; font-size: 14px; }
.canvas-format-hint { display: flex; align-items: center; gap: 9px; padding: 8px 11px; color: #385879; background: #eef5ff; font-size: 13px; line-height: 1.35; }
.canvas-format-hint small { color: #4f6680; font-size: 13px; }
.canvas-hint-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--blue); }
.studio-grid.editor-grid { grid-template-columns: 128px minmax(0, 1fr) 356px; gap: 18px; align-items: start; }
.tool-rail { display: grid; align-content: start; gap: 4px; padding: 12px 9px; border: 1px solid #dce7f4; border-radius: 12px; background: #fff; }
.tool-rail-heading { display: grid; gap: 1px; padding: 3px 8px 9px; }
.tool-rail-heading b { color: #263e5c; font-size: 13px; font-weight: 700; }
.tool-rail-heading small { color: #526983; font-size: 13px; }
.editor-tool { width: 100%; min-height: 55px; display: flex; align-items: center; gap: 9px; padding: 7px 8px; border: 1px solid transparent; border-radius: 8px; color: #526983; background: transparent; text-align: left; transition: background-color .16s ease, border-color .16s ease, color .16s ease; }
.editor-tool:hover { color: #2d4e73; background: #f5f8fc; }
.editor-tool-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 1px solid #dce6f2; border-radius: 8px; color: #607998; background: #fff; }
.editor-tool-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.text-tool-icon { font-size: 18px; font-weight: 700; }
.editor-tool-copy { width: 100%; min-width: 0; display: grid; gap: 1px; }
.editor-tool-copy b { color: inherit; font-size: 13px; font-weight: 650; white-space: nowrap; }
.editor-tool-copy small { color: #526983; font-size: 13px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.editor-tool-active { border-color: #cfe2fb; color: var(--blue-dark); background: #edf5ff; }
.editor-tool-active .editor-tool-icon { border-color: #aac9f2; color: var(--blue); }
.editor-tool-active .editor-tool-copy small { color: #4e6f96; }
.editor-tool.coming-soon { color: #526983; }
.editor-tool.coming-soon .editor-tool-icon { color: #8b9aac; background: #f8fafc; }
.editor-tool.coming-soon:hover { border-color: #e1e8f0; }
.editor-tool:focus-visible { outline-offset: 1px; }
.tool-rail-note { margin: 9px 6px 2px; padding-top: 10px; border-top: 1px solid #e7edf5; color: #526983; font-size: 13px; line-height: 1.5; }
.work-column { min-width: 0; }
.upload-panel .panel-heading { align-items: center; margin-bottom: 13px; }
.upload-panel .panel-heading h2 { font-size: 19px; }
.upload-panel .panel-heading p { margin-top: 2px; }
.dropzone, .dropzone.has-file { min-height: 535px; border-radius: 12px; }
.dropzone::before { width: min(310px, 62%); border-width: 8px; }
.dropzone::after { width: min(278px, 56%); }
.empty-upload { width: min(100%, 420px); padding: 28px 20px; }
.upload-art { width: 82px; height: 82px; margin-bottom: 16px; }
.art-circle { width: 66px; height: 66px; }
.art-circle svg { width: 31px; height: 31px; }
.empty-upload h3 { font-size: 20px; }
.empty-upload p { margin-top: 2px; }
.selected-upload { position: relative; min-height: 535px; flex-direction: column; gap: 12px; padding: 48px 20px 22px; }
.image-frame { width: min(68%, 360px); height: auto; aspect-ratio: 1; border-color: #d4e1f1; border-radius: 8px; background: #fff; }
.file-details { text-align: center; }
.file-ready { justify-content: center; }
.selected-upload h3 { max-width: min(80vw, 430px); }
.upload-actions { position: absolute; top: 12px; right: 12px; }
.upload-actions .remove-button { min-height: 33px; margin: 0; }
.upload-foot { align-items: center; margin-top: 9px; }
.settings-panel { min-width: 0; }
.settings-title h2 { font-size: 19px; }
.settings-gear { width: 34px; height: 34px; border-radius: 9px; }
.settings-params { grid-template-columns: 1fr; }
.settings-params .setting-group { margin-bottom: 12px; }
.setting-divider, .settings-divider { margin: 12px 0; }
.color-setting { padding-top: 2px; }
.convert-button { width: 100%; min-height: 48px; }
.time-estimate { text-align: center; }
.recent-section { margin-top: 22px; }

@media (max-width: 980px) {
  .studio-grid.editor-grid { grid-template-columns: 116px minmax(0, 1fr); gap: 16px; }
  .tool-rail { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 78px; }
  .work-column { grid-column: 2; grid-row: 1; }
  .editor-grid > .settings-panel { grid-column: 2; grid-row: 2; }
  .dropzone, .dropzone.has-file { min-height: 470px; }
  .selected-upload { min-height: 470px; }
}
@media (max-width: 760px) {
  .editor-intro { padding: 17px 0 13px; }
  .editor-intro h1 { font-size: 25px; }
  .editor-intro .intro-copy { max-width: 290px; font-size: 13px; }
  .canvas-format-hint { gap: 7px; padding: 6px 8px; font-size: 13px; }
  .canvas-format-hint small { font-size: 13px; }
  .studio-grid.editor-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tool-rail { position: static; grid-column: 1; grid-row: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 8px; overflow: visible; }
  .tool-rail-heading { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; padding: 0 3px 5px; }
  .tool-rail-heading small { font-size: 13px; }
  .editor-tool { min-width: 0; min-height: 84px; flex-direction: column; justify-content: center; gap: 3px; padding: 5px 2px; text-align: center; }
  .editor-tool-icon { width: 27px; height: 27px; border-radius: 7px; }
  .editor-tool-icon svg { width: 16px; height: 16px; }
  .editor-tool-copy { justify-items: center; gap: 0; }
  .editor-tool-copy b { font-size: 13px; }
  .editor-tool-copy small { font-size: 13px; }
  .tool-rail-note { display: none; }
  .work-column, .editor-grid > .settings-panel { grid-column: 1; grid-row: auto; }
  .dropzone, .dropzone.has-file { min-height: 420px; }
  .dropzone::before { width: min(280px, 72vw); }
  .dropzone::after { width: min(250px, 65vw); }
  .selected-upload { min-height: 420px; padding-top: 48px; }
  .image-frame { width: min(70%, 300px); }
  .settings-params { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .settings-params .setting-group { min-width: 0; }
  .hoop-fit-status { grid-column: 1 / -1; }
  .color-setting { grid-column: 1 / -1; }
  .upload-foot { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (max-width: 480px) {
  .editor-intro { align-items: center; gap: 8px; }
  .editor-intro .intro-copy { max-width: 235px; }
  .canvas-format-hint { flex: none; padding: 6px 7px; font-size: 13px; }
  .canvas-format-hint small { font-size: 13px; }
  .tool-rail { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 7px 5px; }
  .editor-tool { min-height: 88px; }
  .editor-tool-copy b { font-size: 13px; }
  .editor-tool-copy small { font-size: 13px; }
  .dropzone, .dropzone.has-file { min-height: 380px; }
  .dropzone::before { width: min(250px, 72vw); }
  .dropzone::after { width: min(222px, 64vw); }
  .empty-upload { padding: 20px 10px; }
  .empty-upload h3 { font-size: 17px; }
  .selected-upload { min-height: 380px; padding: 47px 12px 18px; }
  .image-frame { width: min(72%, 270px); }
  .upload-actions { top: 9px; right: 8px; }
  .upload-actions .remove-button { min-height: 30px; padding: 5px 7px; font-size: 11px; }
  .settings-panel { padding: 16px; }
}


/* 下载需要登录时的说明与按钮 */
.download-note { margin: 0 0 9px; padding: 8px 10px; border: 1px solid #d8e8fc; border-radius: 8px; color: #385879; background: #f2f7ff; font-size: 13px; line-height: 1.5; }
.download-action { cursor: pointer; }
.download-action:disabled { opacity: .6; cursor: wait; }

/* 下载区：全部下载按钮 */
.download-header-right { display: inline-flex; align-items: center; gap: 10px; }
.download-all { min-height: 32px; padding: 6px 12px; border: 1px solid var(--blue); border-radius: 8px; color: var(--blue-dark); background: #fff; font-size: 13px; font-weight: 650; white-space: nowrap; }
.download-all:hover:not(:disabled) { color: #fff; background: var(--blue); }
.download-all:disabled { border-color: #cddbeb; color: #8296ac; background: #f4f7fb; cursor: wait; }

/* 色板待刷新：列表淡出 + 按钮高亮，明确“下面的色板是旧的” */
.palette-list.is-stale { opacity: .55; }
.palette-button.needs-apply { border-width: 2px; box-shadow: 0 0 0 3px rgba(22, 119, 248, .14); }

/* 手机端：工具栏只留「图片导入」，其余占位工具折叠到「更多工具」后面 */
.tool-more { display: none; }
@media (max-width: 760px) {
  .tool-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-more { display: flex; }
  .tool-rail .editor-tool.coming-soon { display: none; }
  .tool-rail.expanded { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-rail.expanded .editor-tool.coming-soon { display: flex; }
}

/* 单屏工作台：整页高度锁定视口，画布吃掉剩余空间，正常情况下不出现页面滚动。
   视口过矮（< 680px）时用 min-height 兜底，宁可滚动也不裁切内容。 */
.app-shell { height: 100dvh; min-height: 680px; display: flex; flex-direction: column; }
.sidebar { flex: 0 0 auto; }
.main-content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding-bottom: 14px; }
.topbar { flex: 0 0 auto; }
.editor-intro { flex: 0 0 auto; display: flex; align-items: center; gap: 18px; padding: 14px 0 12px; }
.intro-line { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.intro-line h1 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.intro-line .intro-copy { margin: 0; font-size: 13px; color: #526983; }
.studio-grid.editor-grid { flex: 1 1 auto; min-height: 0; align-items: stretch; }
.work-column { min-height: 0; display: flex; flex-direction: column; }
.upload-panel { min-height: 0; display: flex; flex-direction: column; flex: 1 1 auto; }
.dropzone, .dropzone.has-file { min-height: 0; flex: 1 1 auto; height: auto; }
.selected-upload { min-height: 0; flex: 1 1 auto; }
/* 主页面里画布框要和文件信息共用纵向空间：用 flex 分配，不能用 height:100%
   （height:100% 会加上兄弟元素的高度，导致画布向上溢出容器）。 */
.dropzone.has-file { place-items: stretch; }
.selected-upload { height: 100%; }
.selected-upload .canvas-stack { flex: 1 1 0; height: auto; min-height: 160px; }
.settings-panel { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.wizard-entry { flex: 0 0 auto; }
.side-notes { margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 9px; list-style: none; }
.side-notes li { display: grid; gap: 1px; }
.side-notes b { color: #1d3555; font-size: 13px; font-weight: 650; }
.side-notes span { color: #526983; font-size: 13px; line-height: 1.45; }
.side-foot { margin: auto 0 0; padding-top: 12px; color: #526983; font-size: 13px; line-height: 1.45; }

@media (max-height: 780px) {
  .editor-intro { padding: 10px 0 9px; }
  .intro-line h1 { font-size: 21px; }
  .side-notes { gap: 7px; margin-top: 11px; padding-top: 10px; }
  .side-notes span { font-size: 12px; }
}

@media (max-width: 980px) {
  .studio-grid.editor-grid { grid-template-rows: auto minmax(0, 1fr) auto; }
}
@media (max-width: 760px) {
  .app-shell { height: 100dvh; min-height: 640px; }
  .main-content { padding-bottom: 10px; }
  .editor-intro { padding: 9px 0 8px; gap: 10px; }
  .intro-line { display: block; }
  .intro-line h1 { font-size: 19px; }
  .intro-line .intro-copy { font-size: 12px; }
  .studio-grid.editor-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .side-notes { display: none; }
  .side-foot { margin: 8px 0 0; padding-top: 0; border: 0; text-align: center; }
  .tool-rail { padding: 6px 5px; }
  .settings-panel { padding: 12px 14px; }
  .settings-title { margin-bottom: 8px; }
}

/* 手机单屏：隐藏与页头重复的标题和底部提示，把高度留给画布 */
@media (max-width: 760px) {
  .upload-panel .panel-heading { display: none; }
  .upload-foot { display: none; }
  .upload-panel { gap: 0; }
  .canvas-stack { min-height: 190px; }
  .image-preflight { margin-top: 8px; padding: 9px 10px; }
  .preflight-heading { margin-bottom: 6px; }
  .preflight-grid { gap: 4px 10px; }
  .preflight-grid > div > span { font-size: 12px; }
  .preflight-grid > div > b { font-size: 12px; }
  #image-advice { margin-top: 6px; font-size: 12px; }
}

/* 手机端进一步压缩非画布区域，把高度让给画布 */
@media (max-width: 760px) {
  .tool-rail-heading { display: none; }
  .tool-rail { padding: 5px; gap: 4px; }
  .editor-tool { min-height: 68px; }
  .side-foot { display: none; }
  .settings-panel .settings-title { margin-bottom: 6px; }
  .settings-panel .settings-title h2 { font-size: 16px; }
  .preflight-heading { display: none; }
  #image-advice { display: none; }
  .preflight-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preflight-grid > div > span { font-size: 11px; }
  .image-preflight { padding: 8px 9px; }
}

/* 图稿状态下：画布占满上方，文件名与操作压在底部一行，尽量把高度留给画布 */
.selected-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px 14px;
  padding: 14px 16px 12px;
  align-items: end;
}
/* 画布格必须是“填满第一行且可收缩”，否则 grid 会按画布内容高度把行撑大、溢出容器 */
.selected-upload .canvas-stack { grid-column: 1 / -1; grid-row: 1; min-height: 0; height: auto; align-self: stretch; overflow: hidden; }
.file-details { grid-column: 1; grid-row: 2; display: flex; align-items: baseline; gap: 8px; min-width: 0; text-align: left; }
.file-details .file-ready { display: none; }
.file-details h3 { margin: 0; max-width: 300px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-details p { margin: 0; font-size: 13px; color: #526983; }
.upload-actions { grid-column: 2; grid-row: 2; position: static; display: flex; gap: 8px; }
.upload-actions .remove-button { margin: 0; min-height: 32px; }

/* 窄桌面：右栏收窄，给画布多一点宽度 */
@media (max-width: 1180px) and (min-width: 981px) {
  .studio-grid.editor-grid { grid-template-columns: 108px minmax(0, 1fr) 300px; gap: 14px; }
}

/* 矮屏手机：进一步压缩页头与侧栏，保证画布仍可用 */
@media (max-width: 760px) and (max-height: 800px) {
  .editor-intro { padding: 6px 0; }
  .intro-line .intro-copy { display: none; }
  .canvas-format-hint { font-size: 11px; padding: 4px 7px; }
  .settings-panel { padding: 10px 12px; }
  .settings-panel .settings-title { display: none; }
  .wizard-entry .setting-hint { display: none; }
  .editor-tool { min-height: 58px; }
  .tool-rail { padding: 4px; gap: 3px; }
  .canvas-stack { min-height: 140px; }
}

/* 向导弹窗：色板两列 + 收紧间距，让第 2 步尽量在一屏内放下（桌面） */
@media (min-width: 761px) {
  .wizard-side .palette-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .wizard-side .palette-item { padding: 3px 6px; }
  .wizard-side .palette-preview { margin-bottom: 8px; }
  .wizard-side .setting-group { margin-bottom: 8px; }
  .wizard-side .color-setting .setting-hint { display: none; }
  .wizard-side .palette-heading .setting-hint { margin-top: 0; }
  .wizard-side .palette-status { margin-top: 6px; }
  .wizard-side .palette-note { display: none; }
  .wizard-side .switch-row { margin-top: 8px; padding-top: 8px; }
  .wizard-side .editor-row { margin-bottom: 6px; }
  .wizard-side .editor-status { margin-top: 10px; padding-top: 8px; }
  .wizard-step h3 { font-size: 15px; }
  .wizard-hint { margin-bottom: 8px; }
}

/* 再压一轮：面板更高、头部更紧、色板行更矮、工具行更短（桌面） */
@media (min-width: 761px) {
  .wizard-panel { max-height: calc(100dvh - 16px); }
  .wizard-header { padding: 10px 16px; }
  .wizard-body { padding: 12px 16px; }
  .wizard-footer { padding: 9px 16px; }
  .wizard-button { min-height: 34px; padding: 6px 14px; font-size: 13px; }
  .wizard-side .palette-item { padding: 2px 5px; gap: 6px; }
  .wizard-side .palette-pick { width: 22px; height: 22px; }
  .wizard-side .palette-pick > i { width: 14px; height: 14px; }
  .wizard-side .palette-color { width: 26px; height: 22px; }
  .wizard-side .image-tool { min-height: 30px; padding: 4px 9px; font-size: 13px; }
  .wizard-side .icon-tool { width: 30px; height: 30px; }
  .wizard-side .editor-row { gap: 6px; }
  .wizard-side .switch-row { margin-top: 6px; padding-top: 6px; }
  .wizard-side .switch-row small { font-size: 12px; }
  .wizard-side .palette-status { font-size: 12px; }
}
@media (max-width: 980px) {
  .wizard-body { overflow: hidden; }
}

.canvas-stitch-note {
  position: absolute;
  z-index: 4;
  left: 12px;
  bottom: 10px;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  color: #33506f;
  background: rgba(255, 255, 255, .88);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.canvas-toggle {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  border: 1px solid #cddbeb;
  border-radius: 999px;
  color: #33506f;
  background: rgba(255, 255, 255, .94);
  font-size: 12px;
  font-weight: 650;
}
.canvas-toggle:hover { border-color: var(--blue); color: var(--blue-dark); background: #fff; }

/* 侧栏生成结果卡 */
.side-result { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.side-result-head b { color: #1d3555; font-size: 13px; font-weight: 650; }
.side-result-head span { color: #526983; font-size: 12px; }
.side-result-list { display: grid; gap: 6px; }
.side-result-list .download-action { width: 100%; margin: 0; text-align: center; }
.side-result-note { margin: 8px 0 0; color: #526983; font-size: 12px; line-height: 1.45; }

/* 按绣花机品牌下载：机型选择行 + 主下载按钮 + 「全部格式」折叠（默认收起，避免 8 个按钮撑高单屏） */
.side-machine { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.side-machine > span { flex: none; color: #526983; font-size: 12px; font-weight: 650; }
.side-machine select {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #cddbeb;
  border-radius: 8px;
  color: #1d3555;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
}
.side-machine select:hover { border-color: #9dbce6; }
#side-primary-download {
  width: 100%;
  min-height: 40px;
  margin: 0;
  border: 1px solid var(--blue);
  border-radius: 9px;
  color: #fff;
  background: var(--blue);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .01em;
}
#side-primary-download:hover:not(:disabled) { border-color: var(--blue-dark); background: var(--blue-dark); }
#side-primary-download:disabled { opacity: .55; cursor: wait; }
.side-machine-hint { margin: 7px 0 0; color: #526983; font-size: 11.5px; line-height: 1.45; }
.side-format-details { margin-top: 6px; }
.side-format-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  border: 1px dashed #c7d8ee;
  border-radius: 8px;
  color: var(--blue-dark);
  background: #f7faff;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.side-format-details > summary::-webkit-details-marker { display: none; }
.side-format-details > summary::after { content: "＋"; color: #7c94b2; font-size: 13px; font-weight: 500; }
.side-format-details[open] > summary::after { content: "－"; }
.side-format-details > .side-result-list { margin-top: 7px; }

/* 「完成并查看结果」后高亮侧栏下载卡，替代滚动定位 */
.side-result.is-flash { border-radius: 10px; box-shadow: 0 0 0 3px rgba(22,119,248,.18); background: #f2f7ff; transition: background-color .2s ease; }

/* 线序表与 DST 线色说明：结果区新增信息，保持小字紧凑，避免撑高单屏布局 */
.thread-chart { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 9px; }
.thread-chart-label { flex: none; color: #526983; font-size: 12px; font-weight: 650; }
.thread-chart-list { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding: 0; list-style: none; }
.thread-chart-item { display: inline-flex; align-items: center; gap: 5px; color: #3d5a7c; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.thread-chart-index { color: #526983; }
.thread-chart-swatch { width: 12px; height: 12px; flex: none; border: 1px solid rgba(23,43,77,.22); border-radius: 3px; }
.thread-chart-hex { color: #33506f; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 600; }
.thread-color-note { margin: 0 0 9px; color: #526983; font-size: 12px; line-height: 1.5; }
.thread-color-note + .download-list { margin-top: 0; }

/* 有生成结果时，右侧卡片优先显示下载，次要说明让位 */
@media (min-width: 981px) {
  .settings-panel.has-result .side-notes { display: none; }
  .settings-panel.has-result .side-foot { margin-top: 10px; padding-top: 0; border: 0; }
}

/* 第 3 步右栏紧凑化：步骤标题已说明用途，去掉重复标题并压缩统计/下载行 */
@media (min-width: 761px) {
  .wizard-side #result-panel .panel-heading { display: none; }
  .wizard-side .result-stats { padding: 8px 2px; }
  .wizard-side .result-stats b { font-size: 15px; }
  .wizard-side .download-header { margin: 10px 0 6px; }
  .wizard-side .download-header p { display: none; }
  .wizard-side .format-options { gap: 5px; }
  .wizard-side #result-palette { margin-top: 8px; padding-top: 8px; }
  .wizard-side .thread-chart { margin-top: 8px; }
}

/* 第 3 步格式选择改成紧凑小块，把高度留给统计与下载 */
@media (min-width: 761px) {
  .wizard-side .format-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wizard-side .format-option { min-height: 44px; padding: 3px 5px; gap: 5px; }
  .wizard-side .format-logo { width: 40px; height: 22px; font-size: 11px; }
  .wizard-side .format-copy b { font-size: 11px; line-height: 1.2; }
  .wizard-side .format-copy small { display: none; }
  .wizard-side .format-check { width: 14px; height: 14px; }
  .wizard-side .format-help { margin-top: 6px; }
  .wizard-side .quality-note { display: none; }
}


/* ---------- 第 3 步一屏：结果区压缩 + 生成控件生成后收起 ---------- */
.wizard-side #result-panel { margin-top: 0; padding: 0; border: 0; box-shadow: none; }
.wizard-side #result-panel .panel-heading { display: none; }
.wizard-side .result-stats { padding: 6px 2px; gap: 6px; }
.wizard-side .result-stats b { font-size: 15px; }
.wizard-side .result-stats span { font-size: 12px; }
.wizard-side .result-palette { margin-top: 6px; padding-top: 6px; gap: 6px; }
.wizard-side .result-palette-label { font-size: 12px; }
.wizard-side .thread-chart { margin-top: 6px; gap: 2px 8px; }
.wizard-side .thread-chart-label { font-size: 11px; }
.wizard-side .thread-chart-item { font-size: 11px; }
.wizard-side .thread-chart-hex { font-size: 10px; }
.wizard-side .download-header { align-items: center; margin: 8px 0 6px; }
.wizard-side .download-header h3 { margin: 0; font-size: 14px; }
.wizard-side .download-header p { display: none; }
.wizard-side .format-count { font-size: 12px; }
.wizard-side .download-all { min-height: 28px; padding: 4px 10px; font-size: 12px; }
.wizard-side .download-note { margin: 0 0 6px; padding: 4px 8px; font-size: 12px; }
.wizard-side .thread-color-note { margin: 0 0 6px; font-size: 12px; }
.wizard-side .download-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.wizard-side .download-card {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid #dbe5f1;
  border-radius: 9px;
  background: #fff;
  text-align: left;
}
.wizard-side .download-card:hover { border-color: var(--blue); background: #f7faff; }
.wizard-side .download-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.wizard-side .download-card-top b { color: var(--ink); font-size: 13px; }
.wizard-side .download-card-top span { color: #526983; font-size: 11px; font-variant-numeric: tabular-nums; }
.wizard-side .download-card-name { overflow: hidden; color: #526983; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.wizard-side .download-card-cta { color: var(--blue-dark); font-size: 12px; font-weight: 650; }
.wizard-side .warning-list { margin-top: 8px; border: 1px solid #efdfba; border-radius: 8px; background: #fbf6ea; }
.wizard-side .warning-list > summary { padding: 6px 9px; color: #6f501d; font-size: 12px; font-weight: 650; cursor: pointer; list-style: none; }
.wizard-side .warning-list > summary::-webkit-details-marker { display: none; }
.wizard-side .warning-list[open] > summary { border-bottom: 1px solid #efdfba; }
.wizard-side .warning-items { display: grid; gap: 4px; padding: 6px; }
.wizard-side .warning-item { padding: 6px 8px; font-size: 12px; }

.wizard-step.has-result > h3,
.wizard-step.has-result > .wizard-hint { display: none; }

.wizard-controls { margin: 4px 0 0; }
.wizard-controls > summary { display: block; padding: 4px 2px; color: #526983; font-size: 12px; font-weight: 650; cursor: pointer; list-style: none; }
.wizard-controls > summary::-webkit-details-marker { display: none; }
/* 收起后 summary 变成「更改格式 / 重新生成」入口；展开时是一行小标题 */
.wizard-controls:not([open]) > summary {
  display: block;
  padding: 6px 10px;
  border: 1px dashed #c7d8ee;
  border-radius: 8px;
  color: var(--blue-dark);
  background: #f7faff;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

@media (max-width: 760px) {
  /* 有结果时给右栏让高度：画布从 300px 收紧，结果区尽量一屏放下 */
  .wizard-panel.has-result .wizard-canvas .canvas-stack { height: min(28vh, 240px); }
  .wizard-side .result-stats { flex-wrap: nowrap; row-gap: 0; }
  .wizard-side .result-stats > div { width: auto; }
  .wizard-side .result-stats > i:nth-of-type(2) { display: block; }
  .wizard-side .result-stats b { font-size: 14px; }
  .wizard-side .download-card { padding: 6px; }
  .wizard-side .download-card-top b { font-size: 12px; }
  .wizard-side .download-card-cta { font-size: 11px; }
}

/* 手机第 3 步：把画布压到 210px，隐藏与生成无关的说明，让格式/结果与下载一屏放下 */
@media (max-width: 760px) {
  .wizard-panel.step-3 .wizard-canvas .canvas-stack { height: min(25vh, 210px); }
  .wizard-panel.step-3 #wizard-step-3 > h3,
  .wizard-panel.step-3 #wizard-step-3 > .wizard-hint,
  .wizard-panel.step-3 .wizard-side > .editor-status { display: none; }
  .wizard-panel.step-3 .format-help,
  .wizard-panel.step-3 .time-estimate { display: none; }
  .wizard-side .result-palette { display: none; }
  .wizard-side .result-stats { padding: 2px 0; }
  .wizard-side .result-stats b { font-size: 13px; }
  .wizard-side .result-stats span { font-size: 11px; }
  .wizard-side .thread-chart { margin-top: 4px; gap: 1px 7px; }
  .wizard-side .thread-chart-item { font-size: 10px; }
  .wizard-side .thread-chart-hex { font-size: 9px; }
  .wizard-side .download-card { padding: 5px 6px; }
}

/* 矮屏手机更紧：隐藏线色卡（线序表仍保留颜色与色值），优先保证下载与统计在一屏 */
@media (max-width: 760px) and (max-height: 720px) {
  .wizard-panel.has-result .wizard-canvas .canvas-stack,
  .wizard-panel.step-3 .wizard-canvas .canvas-stack { height: min(20vh, 140px); }
  .wizard-panel.step-3 .format-heading { display: none; }
  .wizard-side .result-palette { display: none; }
  .wizard-side .thread-color-note { display: none; }
  .wizard-side .thread-chart { margin-top: 3px; }
  .wizard-side .thread-chart-hex { display: none; }
}

/* 手机主页面：生成结果卡压缩成 3 列按钮，把纵向空间还给画布 */
@media (max-width: 760px) {
  .settings-panel.has-result .side-result-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .settings-panel.has-result .side-result-list [data-download-all] { grid-column: 1 / -1; }
  .settings-panel.has-result .side-result-list .download-action {
    min-width: 0;
    margin: 0;
    padding: 6px 3px;
    overflow: hidden;
    font-size: 11px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .settings-panel.has-result #side-thread-chart,
  .settings-panel.has-result #side-thread-color-note { display: none; }
  .settings-panel.has-result .side-result-note { margin-top: 6px; font-size: 11px; }
  .settings-panel.has-result .wizard-entry .setting-hint { display: none; }
}

/* ---------- Pixi 视口画布（按 Ember EditorViewport 重做） ---------- */
.canvas-source,
.canvas-stitch-source { display: none !important; }
.pixi-host {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #e9eef5;
  touch-action: none;
}
.pixi-host canvas { display: block; width: 100%; height: 100%; }
.pixi-host.is-panning { cursor: grabbing; }
.pixi-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid #cddbeb;
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 2px 8px rgba(23, 43, 77, .08);
}
.pixi-zoom button {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  color: #33506f;
  background: transparent;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}
.pixi-zoom button:hover { color: var(--blue-dark); background: #eef4ff; }
.pixi-zoom-scale {
  min-width: 42px;
  color: #526983;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.pixi-zoom-fit { font-size: 12px !important; }
@media (max-width: 760px) {
  .pixi-zoom { right: 6px; bottom: 6px; padding: 3px; }
  .pixi-zoom button { min-width: 26px; height: 26px; }
  .pixi-zoom-fit { display: none; }
}
.pixi-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  color: #526983;
  background: #eef2f7;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

/* 针迹层叠加：白底预览用 multiply 叠在原图上；滑杆控制叠加强度 */
.canvas-stitch-opacity {
  position: absolute;
  z-index: 5;
  left: 12px;
  top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid #cddbeb;
  border-radius: 999px;
  color: #33506f;
  background: rgba(255, 255, 255, .92);
  font-size: 12px;
  font-weight: 650;
}
.canvas-stitch-opacity input { width: 74px; accent-color: var(--blue); }
@media (max-width: 760px) {
  .canvas-stitch-opacity { left: auto; right: 8px; top: auto; bottom: 44px; }
  .canvas-stitch-opacity input { width: 56px; }
}

/* 第 3 步紧凑化：线色明细折叠 + 下载按钮条 */
.result-colors { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.result-colors > summary { cursor: pointer; color: #3d5a7c; font-size: 13px; font-weight: 650; }
.result-colors > summary:hover { color: var(--blue-dark); }
.result-colors[open] > summary { margin-bottom: 8px; }
.wizard-side .result-colors { margin-top: 8px; padding-top: 6px; }
.wizard-side .download-header { margin: 8px 0 6px; }

/* 手机端向导：缩短画布、色板两列、收紧间距，让三步都不再需要内部滚动 */
@media (max-width: 760px) {
  .wizard-canvas .canvas-stack { height: 26vh; min-height: 150px; }
  .wizard-body { padding: 10px 12px; gap: 10px; }
  .wizard-header { padding: 8px 12px; }
  .wizard-footer { padding: 8px 12px; }
  .wizard-step h3 { font-size: 15px; margin-bottom: 2px; }
  .wizard-hint { margin-bottom: 7px; font-size: 12px; }
  .wizard-side .palette-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .wizard-side .palette-item { padding: 2px 5px; gap: 5px; }
  .wizard-side .palette-pick { width: 22px; height: 22px; }
  .wizard-side .palette-pick > i { width: 14px; height: 14px; }
  .wizard-side .palette-color { width: 26px; height: 22px; }
  .wizard-side .palette-preview { margin-bottom: 6px; }
  .wizard-side .palette-status { margin-top: 5px; font-size: 12px; }
  .wizard-side .setting-group { margin-bottom: 7px; }
  .wizard-side .color-setting .setting-hint,
  .wizard-side .palette-note { display: none; }
  .wizard-side .image-tool { min-height: 28px; padding: 3px 8px; font-size: 12px; }
  .wizard-side .icon-tool { width: 28px; height: 28px; }
  .wizard-side .editor-row { gap: 5px; margin-bottom: 5px; }
  .wizard-side .switch-row { margin-top: 6px; padding-top: 6px; }
  .wizard-side .switch-row small { display: none; }
  .wizard-side .editor-status { margin-top: 8px; padding-top: 6px; font-size: 12px; }
  .wizard-side .result-colors { margin-top: 6px; padding-top: 5px; }
  .wizard-side .download-header { margin: 6px 0 5px; }
  .wizard-side .download-header p { display: none; }
  .wizard-side .result-stats { padding: 6px 2px; }
  .wizard-side .result-stats b { font-size: 15px; }
  .wizard-side .format-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .wizard-side .format-option { min-height: 42px; padding: 3px; gap: 4px; }
  .wizard-side .format-logo { width: 38px; height: 20px; font-size: 10px; }
  .wizard-side .format-copy b { font-size: 10px; }
  .wizard-side .format-copy small { display: none; }
  .wizard-side .quality-note { display: none; }
  .wizard-side .format-help { display: none; }
  .wizard-side .time-estimate { display: none; }
}
@media (max-width: 760px) and (max-height: 720px) {
  .wizard-canvas .canvas-stack { height: 20vh; }
}

/* 手机端：向导内容整体作为一个滚动区（取消面板内嵌套滚动），画布收小但仍可见 */
@media (max-width: 760px) {
  .wizard-body { grid-template-rows: auto auto; align-content: start; overflow-y: auto; min-height: 0; }
  .wizard-canvas { flex: 0 0 auto; }
  .wizard-canvas .canvas-stack { height: 30vh; min-height: 170px; }
  .wizard-side { overflow: visible; min-height: 0; padding-right: 0; }
}

/* 手机端最后 10px：线色备注在窄屏价值低，让结果页无需滚动 */
@media (max-width: 760px) {
  .wizard-side #thread-color-note { display: none; }
  .wizard-side .result-stats { padding: 4px 2px; }
  .wizard-side .result-stats span { font-size: 11px; }
}

/* 极矮手机（≤700px）：向导内边距再收一档 */
@media (max-width: 760px) and (max-height: 700px) {
  .wizard-body { padding: 8px 10px; }
  .wizard-side .result-colors { margin-top: 4px; padding-top: 4px; }
  .wizard-side .download-header { margin: 4px 0; }
  .wizard-side .result-stats b { font-size: 14px; }
}

/* ---------- 画布标尺 / 走线回放 ---------- */
.pixi-ruler { position: absolute; z-index: 4; pointer-events: none; }
.pixi-ruler-top { top: 0; left: 0; }
.pixi-ruler-left { top: 0; left: 0; }
.pixi-ruler-corner {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-right: 1px solid #d7e1ed;
  border-bottom: 1px solid #d7e1ed;
  color: #526983;
  background: #f7fafd;
  font-size: 9px;
  font-weight: 650;
  pointer-events: none;
}
.pixi-playback {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px;
  border: 1px solid #cddbeb;
  border-radius: 10px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 2px 10px rgba(23, 43, 77, .1);
  font-size: 12px;
  color: #33506f;
}
.pixi-playback > button {
  min-width: 64px;
  padding: 5px 9px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  color: #244b9b;
  background: #f2f7ff;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.pixi-playback > button:hover { color: #fff; background: var(--blue); }
.pixi-playback input[type="range"] { width: 140px; accent-color: var(--blue); }
.pixi-playback-count { min-width: 70px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pixi-playback-base { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; color: #526983; }
.pixi-playback-base input { accent-color: var(--blue); }
.pixi-playback select { padding: 3px 5px; border: 1px solid #cddbeb; border-radius: 6px; color: #33506f; background: #fff; font-size: 12px; }
@media (max-width: 760px) {
  .pixi-playback { left: 8px; right: 8px; bottom: 42px; transform: none; gap: 5px; padding: 4px 6px; }
  .pixi-playback input[type="range"] { flex: 1; width: auto; min-width: 40px; }
  .pixi-playback-count { min-width: 52px; font-size: 11px; }
  .pixi-playback-base { display: none; }
  .pixi-playback > button { min-width: 52px; padding: 4px 6px; font-size: 11px; }
}


/* ---------- 简化工作流：无向导弹窗、无参数调节 ---------- */
#wizard { display: none !important; }
#result-panel { display: none !important; }
.studio-grid.editor-grid { grid-template-columns: minmax(0, 1fr) 356px !important; gap: 18px !important; }
.settings-panel { overflow-y: auto; }
.settings-divider,
.side-notes { display: none !important; }
.settings-title .settings-gear { display: none; }
.wizard-entry { margin: 2px 0 12px; }
.wizard-entry .convert-button { min-height: 52px; font-size: 15px; }
.side-result-stats { margin: 4px 0 8px; color: #526983; font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .studio-grid.editor-grid { grid-template-columns: minmax(0, 1fr) !important; }
}

/* 简化流程手机端：给画布固定一行高度，右栏结果卡压缩，保持整页单屏 */
@media (max-width: 760px) {
  .studio-grid.editor-grid { grid-template-rows: minmax(230px, 1fr) auto !important; }
  .settings-panel { padding: 10px 12px; }
  .settings-panel .settings-title { display: none; }
  .settings-panel .side-foot { display: none; }
  .settings-panel .side-result-note { display: none; }
  .settings-panel .side-result { margin-top: 8px; padding-top: 8px; }
  /* 有结果后收起「一键转换」入口：手机单屏里把高度还给画布；换图/移除图片会清空结果并恢复入口 */
  .settings-panel.has-result .wizard-entry { display: none; }
  .wizard-entry { margin-bottom: 8px; }
  .wizard-entry .convert-button { min-height: 44px; font-size: 14px; }
  .selected-upload .canvas-stack { min-height: 120px; }
}


/* 移动前先隐藏，避免首帧出现在网格里 */
.studio-grid > .tool-rail { display: none !important; }

/* ---------- 画布工具坞：保留“敬请期待”，横向放在画布标题下 ---------- */
.upload-panel .tool-rail {
  display: flex !important;
  align-items: center;
  gap: 6px;
  flex: none;
  margin: 0 0 10px;
  padding: 6px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid #e2eaf4;
  border-radius: 12px;
  background: linear-gradient(180deg, #f9fbff 0%, #f5f9ff 100%);
  scrollbar-width: none;
}
.upload-panel .tool-rail::-webkit-scrollbar { display: none; }
.upload-panel .tool-rail-heading {
  display: flex;
  align-items: center;
  flex: none;
  padding: 0 8px 0 2px;
  margin-right: 2px;
  border-right: 1px solid #e1eaf4;
  align-self: stretch;
}
.upload-panel .tool-rail-heading b { color: #7c8ea4; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.upload-panel .tool-rail-heading small { display: none; }
.upload-panel .editor-tool {
  width: auto;
  min-width: 0;
  min-height: 40px;
  flex: none;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  color: #33506f;
  background: #fff;
  text-align: left;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.upload-panel .editor-tool:hover { border-color: #b9d0ee; background: #f7faff; }
.upload-panel .editor-tool-active,
.upload-panel .editor-tool-active:hover {
  border-color: #bcd4f6;
  color: #244b9b;
  background: #eaf3ff;
  box-shadow: inset 0 0 0 1px rgba(45, 91, 185, .04);
}
.upload-panel .editor-tool.coming-soon { border-style: dashed; background: #fbfdff; }
.upload-panel .editor-tool.coming-soon:hover { border-color: #c6d6ea; background: #f4f8ff; }
.upload-panel .editor-tool-icon { width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
.upload-panel .editor-tool-icon svg { width: 18px; height: 18px; }
.upload-panel .editor-tool-icon.text-tool-icon { color: #526983; font-size: 15px; font-weight: 700; }
.upload-panel .editor-tool-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.2; }
.upload-panel .editor-tool-copy b { color: inherit; font-size: 12px; font-weight: 650; white-space: nowrap; }
.upload-panel .editor-tool-copy small { color: #8b9cb1; font-size: 10px; white-space: nowrap; }
.upload-panel .tool-rail-note {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  margin: 0 4px 0 auto;
  padding: 0 4px;
  color: #8b9cb1;
  font-size: 11px;
  white-space: nowrap;
}
.upload-panel .tool-rail-note::before { content: "✦"; color: #7ea8e8; }
.upload-panel .tool-more { display: none !important; }
@media (max-width: 760px) {
  .upload-panel .tool-rail { gap: 3px; margin-bottom: 8px; padding: 4px; border-radius: 10px; }
  .upload-panel .tool-rail-heading { display: none; }
  .upload-panel .editor-tool { min-height: 34px; gap: 3px; padding: 3px 5px; }
  .upload-panel .editor-tool-icon { width: 14px; height: 14px; }
  .upload-panel .editor-tool-icon svg { width: 14px; height: 14px; }
  .upload-panel .editor-tool-copy b { font-size: 10px; }
  .upload-panel .editor-tool-copy small { display: block; font-size: 7.5px; color: #9aabbd; }
  .upload-panel .tool-rail-note { display: none; }
  .upload-panel .editor-tool.coming-soon { display: flex !important; }
}

/* ---------- 结果区「全部格式」展开：右栏内部滚动，默认单屏不滚动 ---------- */
.settings-panel.show-all-formats { overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 760px) {
  /* 手机上「全部格式」改为向上浮层：不改变布局，画布不会被压扁，页面仍单屏 */
  .settings-panel.show-all-formats { max-height: none; overflow: visible; }
  .side-format-details { position: relative; }
  .settings-panel.show-all-formats .side-format-details[open] > .side-result-list {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    max-height: min(52vh, 360px);
    overflow-y: auto;
    padding: 7px;
    border: 1px solid #d8e8fc;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(24, 47, 66, .18);
  }
}


/* 线色快捷档位（A1） */
.color-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 2px; }
.color-presets button {
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid #cddbeb;
  border-radius: 999px;
  color: #526983;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.color-presets button:hover { border-color: #87b5f3; color: var(--blue-dark); }
.color-presets button.active { border-color: var(--blue); color: #fff; background: var(--blue); }
.pixi-host.is-fallback { background: #e9eef5; }
.pixi-fallback-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.pixi-fallback-note {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  max-width: calc(100% - 20px);
  padding: 5px 9px;
  border: 1px solid #e3c98b;
  border-radius: 8px;
  color: #6b4d16;
  background: rgba(255, 249, 230, .95);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
}

/* ---------- 自动制版：摘要 + 可展开精细调整 ---------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.prep-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 12px; padding: 11px 12px; border: 1px solid #dbe7f5;
  border-radius: 10px; background: #f7fbff;
}
.prep-summary-copy { min-width: 0; display: grid; gap: 2px; }
.prep-summary-copy b { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.prep-summary-copy span { color: var(--body); font-size: 12px; font-variant-numeric: tabular-nums; }
.prep-color-badge {
  flex: none; display: inline-flex; align-items: baseline; gap: 2px;
  padding: 5px 9px; border: 1px solid #c9dcf4; border-radius: 999px;
  color: var(--blue-dark); background: #fff; font-size: 12px; font-weight: 600;
}
.prep-color-badge b { font-size: 17px; line-height: 1; }
.advanced-toggle {
  display: flex; width: 100%; align-items: center; gap: 7px;
  margin: 0 0 12px; padding: 8px 2px; border: 0; border-bottom: 1px solid var(--line);
  color: var(--ink); background: transparent; text-align: left; cursor: pointer;
}
.advanced-toggle span { font-size: 13px; font-weight: 650; }
.advanced-toggle small { color: var(--body); font-size: 12px; }
.advanced-toggle svg { width: 15px; height: 15px; margin-left: auto; fill: none; stroke: var(--body); stroke-width: 1.7; transition: transform .16s ease; }
.advanced-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.advanced-settings.collapsed { display: none; }
.color-setting .label-line { align-items: center; gap: 8px; }
.detected-pill {
  padding: 2px 7px; border: 1px solid #cfe1f4; border-radius: 999px;
  color: #35628f; background: #f4f9ff; font-size: 11px; font-weight: 600;
}
.detected-pill.manual { border-color: #dfe7ee; color: #5d7180; background: #f8fafc; }
.color-count-control {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  padding: 4px; border: 1px solid var(--line-dark); border-radius: 3px; background: #fff;
}
.color-count-control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(45,91,185,.13); }
.color-count-control input {
  min-width: 0; width: 100%; height: 34px; padding: 0 4px; border: 0; outline: 0;
  color: var(--ink); background: transparent; text-align: center; font-size: 20px;
  font-weight: 650; font-variant-numeric: tabular-nums;
}
.color-count-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.count-step {
  flex: none; width: 34px; height: 34px; border: 1px solid var(--line);
  border-radius: 2px; color: var(--blue-dark); background: #f8fbff; font-size: 20px;
  line-height: 1; cursor: pointer;
}
.count-step:hover { border-color: #9dbce6; background: #f0f7ff; }
.color-count-unit { flex: none; padding-right: 6px; color: var(--body); font-size: 12px; }
.color-setting #color-range { display: block; margin-top: 10px; }
.color-setting .color-presets { margin-top: 8px; }
.color-setting .setting-hint { margin-top: 7px; line-height: 1.45; }
@media (max-width: 760px) {
  .prep-summary { padding: 9px 10px; }
  .advanced-toggle { margin-bottom: 9px; }
}

/* ---------- 简化制版入口：先不暴露调色板编辑、画笔与绣框 ---------- */
#palette-preview,
#image-brush,
#hoop-setting,
#hoop-fit-status { display: none !important; }

/* ---------- 2026-10 layout：画布优先 + 设置在前 + 结果在后 ---------- */
.studio-grid.editor-grid { grid-template-columns: minmax(0, 1fr) 320px !important; }
.settings-panel { overflow-y: auto; }
.work-column { min-height: 0; }
.upload-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dropzone.has-file { flex: 1 1 auto; min-height: 0; }
.selected-upload { min-height: 0; height: 100%; }
.upload-foot { display: none !important; }
#image-preflight { margin: 0 0 12px; padding: 10px 11px; border: 1px solid #e2eaf4; border-radius: 10px; background: #f8fbff; }
#image-preflight .preflight-heading { margin-bottom: 7px; }
#image-preflight .preflight-grid { gap: 4px 8px; }
#image-preflight #image-advice { display: none; }
#image-preflight .preflight-grid > div > span { font-size: 11px; }
#image-preflight .preflight-grid > div > b { font-size: 12px; }

/* 尺寸一行；去掉重复滑块/预设 */
.settings-params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: end; }
.settings-params .setting-group { margin-bottom: 0; }
.settings-params .size-row { grid-column: 1 / -1; display: flex; justify-content: flex-end; margin-top: -2px; }
.settings-params .size-row .range-row { display: none !important; }
.settings-params .size-actions { display: flex; align-items: center; gap: 8px; }
.settings-params .size-actions .setting-hint { display: none; }
.color-setting #color-range,
.color-setting .color-presets,
.color-setting .range-row { display: none !important; }
.color-count-control { margin-top: 0; }
.color-setting { margin-bottom: 12px; }

/* 更多设置 */
.more-settings { margin: 0 0 12px; border-top: 1px solid var(--line); }
.more-settings > summary { display: flex; align-items: center; gap: 7px; padding: 9px 0; color: var(--ink); font-size: 13px; font-weight: 650; cursor: pointer; list-style: none; }
.more-settings > summary::-webkit-details-marker { display: none; }
.more-settings > summary small { color: var(--body); font-size: 12px; font-weight: 400; }
.more-settings > summary svg { width: 15px; height: 15px; margin-left: auto; fill: none; stroke: var(--body); stroke-width: 1.7; transition: transform .16s ease; }
.more-settings[open] > summary svg { transform: rotate(180deg); }
.more-settings .image-editor { padding: 2px 0 8px; border: 0; }
.more-settings .switch-row { margin: 0 0 6px; }
.more-settings .editor-row { margin-bottom: 8px; }

/* 生成按钮紧跟设置，结果在下方 */
.settings-panel .wizard-entry { order: initial; margin: 4px 0 10px; }
.settings-panel .wizard-entry .convert-button { min-height: 48px; }
.settings-panel #side-result { margin-top: 0; }
.settings-panel .side-foot { display: none !important; }

/* 去掉旧格式/重复按钮/调色板/画笔/绣框 */
.format-heading, .format-options, .format-help, #format-error, #convert-button, .time-estimate,
#advanced-toggle, #palette-preview, #image-brush, #hoop-setting, #hoop-fit-status { display: none !important; }

/* 画布工具栏：从画布内移出，置于画布下方 */
.canvas-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 8px 0 0; padding: 7px 9px; border: 1px solid #dbe6f3; border-radius: 10px;
  background: #f7fbff;
}
.canvas-toolbar:empty { display: none; }
.canvas-toolbar .pixi-zoom,
.canvas-toolbar .pixi-playback {
  position: static; transform: none; left: auto; right: auto; bottom: auto;
  margin: 0; box-shadow: none; background: transparent; border: 0; padding: 0;
}
.canvas-toolbar .pixi-playback { flex: 1 1 auto; min-width: 0; }
.canvas-toolbar .pixi-zoom { flex: none; border-left: 1px solid #dbe6f3; padding-left: 8px; }
.canvas-toolbar #canvas-toggle,
.canvas-toolbar #stitch-opacity {
  position: static; transform: none; left: auto; right: auto; top: auto; bottom: auto;
  margin: 0; border: 0; background: transparent; padding: 0; box-shadow: none;
}
.canvas-toolbar #stitch-opacity { flex: 0 0 auto; }
.canvas-toolbar #canvas-toggle { flex: none; height: 30px; padding: 0 9px; border: 1px solid #cddbeb; border-radius: 7px; background: #fff; }
.canvas-toolbar #stitch-note { display: none !important; }
@media (max-width: 900px) {
  .studio-grid.editor-grid { grid-template-columns: minmax(0, 1fr) 300px !important; }
}
@media (max-width: 760px) {
  .studio-grid.editor-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .canvas-toolbar { flex-wrap: nowrap; overflow-x: auto; }
  .canvas-toolbar .pixi-playback { flex: none; }
}

/* 结果线色只保留色块，不展示 hex / 线序文本 */
.thread-chart-list { gap: 5px 7px; }
.thread-chart-item { gap: 0; }
.thread-chart-swatch { width: 16px; height: 16px; border-radius: 4px; }
.thread-chart-hex, .thread-chart-index { display: none !important; }

/* 线色数：滑块 + 当前值，不显示数字输入/预设 */
.color-setting #color-range { display: block !important; margin-top: 9px; }
.color-setting .range-row { display: flex !important; }
.color-current { color: var(--body); font-size: 13px; }
.color-current b { color: var(--blue-dark); font-size: 18px; font-variant-numeric: tabular-nums; }

/* 宽高锁定开关 */
.aspect-lock { display: inline-flex; align-items: center; gap: 5px; color: var(--body); font-size: 12px; cursor: pointer; }
.aspect-lock input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.settings-params .size-actions { margin-left: auto; }

/* 保留锐角固定开启，不再暴露给用户 */
.more-settings .switch-row { display: none !important; }
