/* GeekPix · 沿用极客资源库设计语言 */
:root {
  --gold: #FFB90F;
  --gold-hover: #F0AB00;
  --gold-soft: #fdf6e3;
  --gold-deep: #a1730a;
  --bg: #f7f8fa;
  --card: #ffffff;
  --fg: #1f2937;
  --fg-strong: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #eef0f3;
  --border: #e5e7eb;
  --ink: #1f2937;
  --info: #409EFF;
  --success: #107E49;
  --success-soft: #e1f5ee;
  --danger: #D2342F;
  --danger-soft: #fdecec;
  --stage-bg: #f0f1f3;
  --checker: #fafafa;
  --checker-2: #eef0f2;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, .04);
  --shadow-pop: 0 10px 40px rgba(0, 0, 0, .12);
  --r-lg: 16px;
  --r-md: 10px;
  --r-sm: 8px;
  --font: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[data-theme='dark'] {
  --gold: #FFB90F;
  --gold-soft: rgba(255, 185, 15, .12);
  --gold-deep: #FFC94D;
  --bg: #1a1a1a;
  --card: #242424;
  --fg: #f3f4f6;
  --fg-strong: #ffffff;
  --muted: #9ca3af;
  --faint: #6b7280;
  --line: #2d2d2d;
  --border: #374151;
  --ink: #f3f4f6;
  --success-soft: rgba(34, 197, 94, .16);
  --danger-soft: rgba(239, 68, 68, .14);
  --danger: #ef4444;
  --stage-bg: #1e1e1e;
  --checker: #202020;
  --checker-2: #2a2a2a;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, .3);
  --shadow-pop: 0 10px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

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

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }

.hidden { display: none !important; }

/* ===== 顶部栏 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; cursor: pointer; }

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px rgba(255, 185, 15, .2);
  flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; border-radius: 9px; display: block; }

.brand-name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
  letter-spacing: -.01em;
}

.brand-sub {
  font-size: 13px;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.quota-chip {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.quota-chip b { color: var(--gold); font-weight: 500; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  border: none;
  background: var(--bg);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .2s;
}
.icon-btn:hover { background: var(--gold-soft); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-sun { display: none; }
html[data-theme='dark'] .icon-moon { display: none; }
html[data-theme='dark'] .icon-sun { display: block; }

/* ===== 容器 ===== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

/* ===== 上传区 ===== */
.dropzone {
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  border: 1.5px dashed var(--border);
  background: var(--card);
  transition: border-color .2s, background-color .2s;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.dz-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dz-icon svg { width: 26px; height: 26px; }

.dz-title { margin: 0 0 8px; font-size: 16px; font-weight: 500; color: var(--fg-strong); }
.dz-link { color: var(--gold); font-weight: 500; }
.dz-hint { margin: 0; font-size: 12.5px; color: var(--faint); }

/* ===== 工作区 ===== */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.ws-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.tabs { display: flex; gap: 8px; }
.tab {
  border: none;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  padding: 6px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: .15s;
}
.tab:hover { background: var(--gold-soft); }
.tab.is-on { background: var(--gold-soft); color: var(--gold-deep); font-weight: 500; }

.size-info { font-size: 12.5px; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.size-info .hl { color: var(--gold); font-weight: 500; }
.size-info .arrow { width: 14px; height: 14px; color: var(--gold); }

.stage {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  overflow: hidden;
}

.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.canvas-wrap {
  position: relative;
  max-width: 100%;
  max-height: 62vh;
  line-height: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  background-color: var(--checker);
  background-image: linear-gradient(45deg, var(--checker-2) 25%, transparent 25%),
                    linear-gradient(-45deg, var(--checker-2) 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, var(--checker-2) 75%),
                    linear-gradient(-45deg, transparent 75%, var(--checker-2) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.canvas-wrap canvas { display: block; max-width: 100%; height: auto; }

.orig-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0);
}

.canvas-wrap.view-result .orig-layer { clip-path: inset(0 100% 0 0); }
.canvas-wrap.view-result .divider { display: none; }
.canvas-wrap.view-origin .orig-layer { clip-path: inset(0 0 0 0); }
.canvas-wrap.view-origin .divider { display: none; }

.divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  width: 2px;
  margin-left: -1px;
  background: var(--gold);
  cursor: ew-resize;
  touch-action: none;
}
.divider::after {
  content: '';
  position: absolute;
  inset: 0 -10px;
}

.divider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--gold);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.divider-handle svg { width: 14px; height: 14px; }

.stage-loading {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  border-radius: var(--r-lg);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, .3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.stage-note { margin: 0; font-size: 12px; color: var(--faint); text-align: center; }

/* ===== 侧栏 ===== */
.ws-side { display: flex; flex-direction: column; gap: 14px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

.panel-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-strong);
}

.panel-sub { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 6px; }

.head-actions { display: flex; align-items: center; gap: 10px; }
#addBtn { border-color: var(--gold); color: var(--gold-deep); font-weight: 500; }
#addBtn:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

.step-list, .step-strip { list-style: none; margin: 0; padding: 0; }
.step-strip .step-item {
  flex: 0 0 auto; margin: 0; padding: 6px 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 12.5px; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--card); font-size: 12.5px; color: var(--fg); cursor: pointer;
  transition: .15s;
}
.step-item:hover { border-color: var(--gold); }
.step-item.is-active { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-deep); font-weight: 500; }
.step-idx { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; background: var(--border); color: var(--muted); font-size: 11px; display: grid; place-items: center; }
.step-item.is-active .step-idx { background: var(--gold); color: #fff; }
.step-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-dim { color: var(--muted); font-size: 11px; }
.step-del { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.step-del:hover { color: var(--danger); }
.step-del[disabled] { visibility: hidden; }

/* ===== 步骤说明与分支 ===== */
.step-text { flex: 1; min-width: 0; }
.step-desc { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-branch {
  margin: -2px 0 2px 28px;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-left: 2px solid var(--gold);
  border-radius: var(--r-sm);
  background: var(--card);
  font-size: 12px; color: var(--muted);
  cursor: pointer; transition: .15s;
  display: flex; align-items: center; gap: 6px;
}
.step-branch:hover { border-color: var(--gold); color: var(--gold-deep); }
.step-branch .step-dim { margin-left: auto; }
.step-branch .branch-tag { font-size: 10.5px; border: 1px solid var(--gold); color: var(--gold-deep); border-radius: 4px; padding: 0 5px; flex-shrink: 0; }

/* ===== 应用按钮提示 ===== */
.apply-hint { margin: 8px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); text-align: center; }

/* ===== AI 模型切换盒 ===== */
.ai-model-box {
  margin-top: 10px; padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
}
.ai-model-row { display: flex; align-items: center; gap: 8px; }
.ai-model-row > span { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.ai-model-row select {
  flex: 1; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--card); color: var(--fg);
  font-family: inherit; font-size: 12.5px;
  padding: 7px 9px; outline: none;
}
.ai-model-row select:focus { border-color: var(--gold); }
.ai-model-custom {
  width: 100%; box-sizing: border-box; margin-top: 8px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--card); color: var(--fg);
  font-family: inherit; font-size: 12.5px;
  padding: 7px 9px; outline: none;
}
.ai-model-custom:focus { border-color: var(--gold); }
.ai-model-hint { margin: 8px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }

.chip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }

.chip {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 2px;
  cursor: pointer;
  transition: .15s;
}
.chip:hover { border-color: var(--gold); color: var(--gold-deep); }
.chip.is-on {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-deep);
  font-weight: 500;
}

.custom-ratio { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.custom-ratio input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none;
}
.custom-ratio input:focus { border-color: var(--gold); }
.custom-ratio .colon { color: var(--muted); }

.engine-card {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 13px;
  cursor: pointer;
  background: var(--card);
  transition: .15s;
  margin-bottom: 8px;
}
.engine-card:last-of-type { margin-bottom: 0; }
.engine-card:hover { border-color: var(--gold); }
.engine-card.is-on { border-color: var(--gold); background: var(--gold-soft); }
.engine-card.is-disabled { opacity: .55; cursor: not-allowed; }

.engine-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.engine-name { font-size: 13px; font-weight: 500; color: var(--fg-strong); }
.engine-desc { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }

.tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.tag-free { background: var(--success-soft); color: var(--success); }
html[data-theme='dark'] .tag-free { color: #4ade80; }
.tag-ai { background: var(--gold-soft); color: var(--gold-deep); }

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.switch-row input { accent-color: var(--gold); margin-top: 3px; }

.seg { display: flex; gap: 7px; margin-bottom: 12px; }
.seg-btn {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 0;
  cursor: pointer;
  transition: .15s;
}
.seg-btn.is-on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-deep); font-weight: 500; }

.quality-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.quality-label b { color: var(--fg-strong); font-weight: 500; }

input[type='range'] {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--gold);
  cursor: pointer;
}
input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--card);
  cursor: pointer;
}

/* ===== 按钮 ===== */
.btn {
  width: 100%;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 0;
  cursor: pointer;
  transition: .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 主按钮：独立图标 + 文字，图标按比例放大、拉开间距，避免文字挤压 */
.btn-primary { background: var(--gold); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary:hover:not(:disabled) { background: var(--gold-hover); }

.btn-ico { font-size: 17px; line-height: 1; transform: translateY(.5px); }
.btn-txt { font-size: 14px; font-weight: 500; letter-spacing: .3px; white-space: nowrap; }

.btn-generate { background: linear-gradient(135deg, #7c5cff, #b06bff); }
.btn-generate:hover:not(:disabled) { background: linear-gradient(135deg, #6f4ff0, #a35cf0); }

.engine-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
/* 关键：.btn 全局 width:100% 在 flex 行内会被解析为 flex-basis——幽灵按钮占满一行、
   主按钮（basis 0）无剩余空间可分，被挤成竖条。flex 行内必须显式 width:auto */
.engine-actions .btn { width: auto; }
.engine-actions .btn-primary { flex: 1 1 0; min-width: 0; }
.engine-actions .btn-ghost { flex: 0 0 auto; padding: 10px 16px; white-space: nowrap; }

.btn-ghost {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 400;
  padding: 10px 0;
}
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-deep); }

.btn-text {
  background: transparent;
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 400;
  padding: 6px 0;
}
.btn-text:hover { color: var(--danger); }

.notice {
  font-size: 12.5px;
  line-height: 1.6;
  border-radius: var(--r-md);
  padding: 10px 12px;
  background: var(--gold-soft);
  color: var(--gold-deep);
}

/* ===== 功能模式切换 ===== */
.mode-bar {
  display: flex;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 6px;
}

.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: .15s;
}
.mode-btn svg { width: 17px; height: 17px; }
.mode-btn:hover { background: var(--bg); color: var(--fg-strong); }
.mode-btn.is-on { background: var(--gold-soft); color: var(--gold-deep); font-weight: 500; }

/* ===== 裁剪 ===== */
.crop-wrap {
  position: relative;
  line-height: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  max-width: 100%;
}
.crop-wrap canvas { display: block; max-width: 100%; height: auto; }

.crop-box {
  position: absolute;
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5);
  cursor: move;
  touch-action: none;
}

.crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(to right, transparent 33.2%, rgba(255, 255, 255, .75) 33.2%, rgba(255, 255, 255, .75) 33.5%, transparent 33.5%, transparent 66.4%, rgba(255, 255, 255, .75) 66.4%, rgba(255, 255, 255, .75) 66.7%, transparent 66.7%),
    linear-gradient(to bottom, transparent 33.2%, rgba(255, 255, 255, .75) 33.2%, rgba(255, 255, 255, .75) 33.5%, transparent 33.5%, transparent 66.4%, rgba(255, 255, 255, .75) 66.4%, rgba(255, 255, 255, .75) 66.7%, transparent 66.7%);
}

.ch { position: absolute; background: var(--gold); touch-action: none; }
.ch-nw, .ch-ne, .ch-sw, .ch-se { width: 12px; height: 12px; border-radius: 2px; }
.ch-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.ch-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.ch-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.ch-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.ch-n, .ch-s { left: 50%; width: 22px; height: 4px; margin-left: -11px; border-radius: 2px; cursor: ns-resize; }
.ch-n { top: -2px; }
.ch-s { bottom: -2px; }
.ch-e, .ch-w { top: 50%; height: 22px; width: 4px; margin-top: -11px; border-radius: 2px; cursor: ew-resize; }
.ch-e { right: -2px; }
.ch-w { left: -2px; }

.crop-size {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 11px;
  line-height: 1.6;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}

/* ===== 去水印 ===== */
.inpaint-wrap {
  position: relative;
  line-height: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  max-width: 100%;
}
.inpaint-wrap canvas { display: block; max-width: 100%; height: auto; }
.inpaint-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* ===== 表单行 ===== */
.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.field-row label {
  font-size: 12px;
  color: var(--muted);
  width: 14px;
  flex-shrink: 0;
}
.field-row input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  outline: none;
}
.field-row input:focus { border-color: var(--gold); }

/* ===== 队列 ===== */
.queue-bar {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
}
.queue-head b { color: var(--gold); font-weight: 500; }

.btn-mini {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.btn-mini:hover { border-color: var(--danger); color: var(--danger); }

/* ===== API Key ===== */
.key-btn { border-color: var(--gold); color: var(--gold-deep); font-weight: 500; }
.key-btn:hover { border-color: var(--gold); background: var(--gold); color: #fff; }
.key-btn.is-on { background: var(--gold); border-color: var(--gold); color: #fff; }

.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(17, 24, 39, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  width: 100%; max-width: 430px;
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: 0 16px 48px rgba(17, 24, 39, .22);
  padding: 22px 22px 18px;
}
.modal-title { margin: 0 0 10px; font-size: 16px; color: var(--fg-strong); }
.modal-hint { margin: 0 0 14px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.modal-hint b { color: var(--fg); }
.modal-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg); color: var(--fg);
  font-family: inherit; font-size: 13.5px;
  padding: 10px 12px; outline: none;
}
.modal-input:focus { border-color: var(--gold); }
.modal-field { display: block; margin-bottom: 12px; }
.modal-field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.modal-field select,
.modal-field input[type="text"],
.modal-field input[type="password"] {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg); color: var(--fg);
  font-family: inherit; font-size: 13.5px;
  padding: 9px 11px; outline: none;
}
.modal-field select:focus,
.modal-field input:focus { border-color: var(--gold); }
.modal-advanced { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 4px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }
.modal-actions .btn { flex: 1; }
.modal-status { margin: 12px 0 0; font-size: 12px; color: var(--gold-deep); min-height: 18px; }

/* ===== 扩图风格 ===== */
.style-hint { margin: 10px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }

.queue-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }

.queue-item {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--bg);
  cursor: pointer;
  padding: 0;
}
.queue-item.is-on { border-color: var(--gold); }
.queue-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.queue-item .q-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: .15s;
}
.queue-item:hover .q-del { opacity: 1; }

/* ===== 提示 ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 20px);
  background: var(--fg-strong);
  color: var(--card);
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 60;
  max-width: 88vw;
  text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ===== 页脚 ===== */
.site-footer { border-top: 1px solid var(--line); background: var(--card); margin-top: 12px; }
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--faint);
}
.dot { opacity: .5; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .ws-side { order: 2; }
  .ws-main { order: 1; }
  .canvas-wrap { max-height: 52vh; }
}

@media (max-width: 767px) {
  .container { padding: 16px; gap: 16px; }
  .header-inner { padding: 10px 16px; }
  .brand-sub { display: none; }
  .dropzone { padding: 40px 16px; }
  .stage { padding: 12px; }
  .btn { padding: 13px 0; }
  .canvas-wrap { max-height: 46vh; }
  .divider-handle { width: 34px; height: 34px; }
  .queue-item { width: 62px; height: 62px; }
}

@media (max-width: 420px) {
  .chip-grid { grid-template-columns: repeat(3, 1fr); }
  .quota-chip { display: none; }
  .size-info { font-size: 11.5px; }
}

/* ===== 本地扩图高级微调 ===== */
.tune-box { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.tune-summary { cursor: pointer; font-size: 12.5px; color: var(--muted); user-select: none; }
.tune-summary:hover { color: var(--fg-strong); }
.tune-body { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.tune-row input[type="range"] { width: 100%; }
.tune-reset { margin-top: 10px; }

/* ===== AI 生图 ===== */
.gen-ref { margin-top: 10px; }
.gen-ref-head { display: flex; gap: 8px; flex-wrap: wrap; }
.gen-ref-thumb { display: block; width: 100%; max-height: 140px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-sm); margin-top: 8px; background: var(--bg); }
.gen-prompt { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 13px; font-family: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); resize: vertical; outline: none; }
.gen-prompt:focus { border-color: var(--gold); }
.gen-preview { display: block; width: 100%; max-height: 260px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); margin-bottom: 10px; }
.gen-gallery { margin-bottom: 10px; }
.gen-gallery .queue-item { width: 72px; height: 72px; }

/* ===== 首页功能卡片 ===== */
.home-view { display: flex; flex-direction: column; gap: 20px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.feature-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 20px; text-align: left; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); font: inherit; color: var(--fg);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.fc-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,185,15,.14); color: var(--gold); display: flex; align-items: center; justify-content: center; }
.fc-icon svg { width: 22px; height: 22px; }
.fc-title { margin: 0; font-size: 16px; font-weight: 600; }
.fc-desc { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.fc-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.fc-gen .fc-tag { color: var(--gold); border-color: var(--gold); }

/* ===== AI 生图页 ===== */
.gen-view { display: flex; flex-direction: column; gap: 14px; }
.gen-head { display: flex; align-items: center; justify-content: space-between; }
.gen-page-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; font-weight: 600; }
.gen-page-title svg { width: 20px; height: 20px; color: var(--gold); }
.gen-layout { display: grid; grid-template-columns: 380px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .gen-layout { grid-template-columns: 1fr; } }
.gen-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== AI 提取文字页 ===== */
.ocr-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; padding: 26px 16px; cursor: pointer;
  border: 1.5px dashed var(--border); border-radius: var(--r-sm);
  background: var(--card); transition: border-color .15s ease, background .15s ease;
}
.ocr-drop:hover, .ocr-drop.is-over { border-color: var(--gold); background: rgba(255,185,15,.06); }
.ocr-drop svg { width: 30px; height: 30px; color: var(--gold); }
.ocr-drop-title { margin: 0; font-size: 13px; font-weight: 600; }
.ocr-drop .apply-hint { margin: 0; }
.ocr-preview-wrap {
  display: flex; justify-content: center; padding: 10px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg);
}
.ocr-preview { max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 6px; }
/* AI 高清放大结果：更大展示区 + 点击查看大图（object-fit:contain 永不拉伸变形） */
.up-preview { max-width: 100%; max-height: 520px; object-fit: contain; border-radius: 6px; cursor: zoom-in; }
.ocr-result {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 220px;
  padding: 10px 12px; font-size: 13.5px; line-height: 1.7; font-family: inherit;
  color: var(--fg); background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); outline: none;
}
.ocr-result:focus { border-color: var(--gold); }

/* ===== 编辑页空状态 ===== */
.stage-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
}
.stage-empty .dz-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,185,15,.14); color: var(--gold); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.stage-empty .dz-icon svg { width: 24px; height: 24px; }

/* ===== 生图模型下拉 / 预览放大 / 灯箱 ===== */
.gen-model-select { width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); outline: none; }
.gen-model-select:focus { border-color: var(--gold); }
.gen-preview { max-height: 60vh; cursor: zoom-in; transition: max-height .2s ease; }
.lightbox { position: fixed; inset: 0; z-index: 999; background: rgba(10,10,12,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox.hidden { display: none; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: 8px; box-shadow: 0 12px 48px rgba(0,0,0,.5); }
.lightbox-hint { margin-top: 12px; font-size: 12px; color: rgba(255,255,255,.55); }

/* ===== 处理步骤横向胶囊 ===== */
.step-strip {
  display: flex; gap: 8px; align-items: center;
  overflow-x: auto; padding: 4px 2px;
  scrollbar-width: thin;
}
.step-strip .step-row, .step-strip .step-branch {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 0 0 auto; margin: 0;
  padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.step-strip .step-row.is-active { border-color: var(--gold); background: rgba(255,185,15,.10); }
.step-strip .step-branch { opacity: .72; border-style: dashed; }
.step-strip .step-dim, .step-strip .step-label { color: inherit; }
.step-strip .branch-tag { font-size: 11px; color: var(--gold); }
.step-strip .step-del {
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 0 2px;
}

/* ===== 修改记录标题 ===== */
.mod-records { margin-top: 10px; }
.mod-records-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.mod-records-title { font-size: 15px; font-weight: 600; color: var(--fg); }
.mod-records-hint { font-size: 12px; color: var(--muted); }

/* ===== 引擎折叠卡片 ===== */
.engine-card { cursor: pointer; }
.engine-card.is-open { border-color: var(--gold); }
.engine-head { display: flex; align-items: center; gap: 8px; }
.engine-caret { color: var(--muted); font-size: 17px; width: 18px; line-height: 1; transform-origin: center; }
.engine-card.is-open .engine-caret { color: var(--gold); }
.engine-card .engine-desc { margin: 10px 0 0; }
.engine-card.is-open .engine-desc { margin-top: 12px; }

/* ===== 首页 v2：Hero + 功能卡片重构 + Footer ===== */
.hero { padding: 40px 8px 10px; text-align: center; }
.hero-eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: 4px; color: var(--gold); }
.hero-title { margin: 0 0 14px; font-size: 36px; line-height: 1.25; font-weight: 700; color: var(--fg-strong); letter-spacing: .5px; }
.hero-sub { margin: 0 auto 20px; max-width: 660px; font-size: 14.5px; line-height: 1.75; color: var(--muted); }
.hero-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-badge {
  font-size: 12.5px; color: var(--muted);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px;
}
.hero-badge:first-child { color: var(--gold-deep); border-color: var(--gold); background: var(--gold-soft); font-weight: 500; }

/* 功能卡片 v2：图标+状态徽章顶行、悬停箭头、可扩展 */
.feature-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.feature-card { padding: 18px; border-radius: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; }
.fc-top { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.fc-icon { width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto; }
.fc-icon svg { width: 22px; height: 22px; }
.fc-title { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.fc-title::after { content: '→'; color: var(--gold); font-weight: 500; opacity: 0; transform: translateX(-5px); transition: .18s; }
.feature-card:hover .fc-title::after { opacity: 1; transform: none; }
.feature-card:hover { border-color: var(--gold); box-shadow: 0 10px 28px rgba(0,0,0,.08); }
.fc-tag { flex: 0 0 auto; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.fc-tag.tag-hot { color: var(--gold-deep); border-color: var(--gold); background: var(--gold-soft); }
.fc-tag.tag-ai { color: #7c5cff; border-color: rgba(124,92,255,.45); background: rgba(124,92,255,.08); }
.fc-tag.tag-soon { color: var(--faint); border-style: dashed; }
.feature-card.fc-soon { cursor: default; opacity: .75; }
.feature-card.fc-soon:hover { transform: none; border-color: var(--line); box-shadow: none; }
.feature-card.fc-soon:hover .fc-title::after { opacity: 0; transform: translateX(-5px); }

/* Footer v2：品牌 / 公众号二维码 / 联系方式 */
.site-footer { margin-top: 30px; }
.footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 30px 24px 24px;
  display: grid; grid-template-columns: 1.25fr 1fr .9fr; gap: 36px;
  font-size: 12.5px; color: var(--muted);
}
.ft-brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ft-brand-row strong { font-size: 15px; color: var(--fg-strong); }
.ft-desc { margin: 0 0 10px; line-height: 1.7; }
.ft-note { opacity: .7; font-size: 11.5px; }
.ft-link { color: var(--gold); text-decoration: none; }
.ft-link:hover { text-decoration: underline; }
.ft-title { margin: 0 0 14px; font-size: 13.5px; font-weight: 600; color: var(--fg-strong); }
.ft-qr-row { display: flex; gap: 16px; }
.ft-qr { margin: 0; text-align: center; }
.ft-qr img {
  display: block; width: 116px; height: 116px; object-fit: contain;
  background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 4px;
}
.ft-qr figcaption { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.ft-wechat {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 13px; color: var(--fg-strong);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; cursor: pointer; transition: .15s; margin-bottom: 8px;
}
.ft-wechat:hover { border-color: var(--gold); color: var(--gold-deep); }
.ft-wechat svg { width: 17px; height: 17px; color: var(--gold); }
.ft-copy-tag { font-size: 10.5px; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }

.footer-bar {
  border-top: 1px solid var(--line);
  max-width: 1240px; margin: 0 auto; padding: 14px 24px;
  display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap;
  font-size: 12px; color: var(--faint);
}
.footer-bar a { color: var(--faint); text-decoration: none; }
.footer-bar a:hover { color: var(--gold); }

@media (max-width: 900px) {
  .hero { padding-top: 28px; }
  .hero-title { font-size: 26px; }
  .footer-inner { grid-template-columns: 1fr; gap: 26px; text-align: center; }
  .ft-brand-row { justify-content: center; }
  .ft-qr-row { justify-content: center; }
}

/* ===== Hero v3：双栏（文案+CTA / 比例卡片视觉锚点）===== */
.hero { position: relative; overflow: hidden; padding: 30px 0 10px; }
.hero::before {
  content: ''; position: absolute; top: -60px; left: -40px; width: 520px; height: 320px;
  background: radial-gradient(closest-side, var(--gold-soft), transparent 72%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: center;
}
.hero-eyebrow {
  display: inline-block; font-size: 11.5px; font-weight: 600; letter-spacing: 3px;
  color: var(--gold-deep); background: var(--gold-soft);
  border: 1px solid var(--gold); border-radius: 999px; padding: 5px 14px;
}
.hero-title { margin: 18px 0 14px; font-size: 38px; line-height: 1.3; font-weight: 700; color: var(--fg-strong); letter-spacing: .5px; }
.hero-hl { color: var(--gold); }
.hero-sub { margin: 0 0 26px; max-width: 520px; font-size: 14.5px; line-height: 1.8; color: var(--muted); }
.hero-cta { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.hero-cta .btn { width: auto; padding: 12px 26px; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; font-size: 13px; color: var(--muted); }
.hero-points li::before { content: '✓'; color: var(--gold); font-weight: 700; margin-right: 8px; }

/* 右侧视觉锚点：原图 ↔ AI 扩图 可拖动对比（一眼看懂 AI 干了什么） */
.hero-visual { position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hv-compare {
  position: relative; width: 100%; max-width: 480px; aspect-ratio: 1730 / 736;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 20px 46px rgba(0,0,0,.16);
  --split: 50%; touch-action: pan-y; user-select: none;
}
.hv-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hv-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.hv-divider {
  position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.18); transform: translateX(-1px);
}
.hv-divider span {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--fg-strong);
  box-shadow: 0 3px 12px rgba(0,0,0,.28);
  display: flex; align-items: center; justify-content: center;
}
.hv-divider svg { width: 17px; height: 17px; }
.hv-label {
  position: absolute; top: 12px; z-index: 3;
  font-size: 11.5px; letter-spacing: .5px; color: #fff;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(17, 24, 39, .58); backdrop-filter: blur(3px);
}
.hv-label-l { left: 12px; }
.hv-label-r { right: 12px; }
.hv-tip { margin: 0; font-size: 11.5px; color: var(--faint); }
.hv-try {
  position: absolute; left: 5%; bottom: 4%; z-index: 4;
  font-size: 12px; color: #fff; background: linear-gradient(135deg, var(--gold), #f2a93b);
  border-radius: 999px; padding: 6px 14px; box-shadow: 0 8px 20px rgba(0,0,0,.14);
}

/* ===== 上传区 v2：更高、更靠上、格式提示 ===== */
.dz-lg {
  min-height: 300px; padding: 44px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.dz-lg .dz-icon { width: 66px; height: 66px; border-radius: 18px; }
.dz-lg .dz-icon svg { width: 30px; height: 30px; }
.dz-lg .dz-title { font-size: 19px; }
.dz-lg .dz-hint { max-width: 560px; text-align: center; }
.dz-formats { display: flex; gap: 8px; margin-top: 4px; }
.dz-formats span { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; }

/* ===== 页脚博客链接 ===== */
.ft-blog { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.ft-blog:hover .ft-link-label { text-decoration: underline; }
.ft-link-label { color: var(--gold); font-weight: 500; font-size: 13.5px; }
.ft-link-url { font-size: 11.5px; color: var(--faint); }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 8px; text-align: center; }
  .hero-visual { margin: 14px auto 0; max-width: 520px; } /* 对比组件移动端保留：这是最能说明价值的表达 */
  .hero-title { font-size: 27px; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-points { grid-template-columns: 1fr; justify-items: center; max-width: 260px; margin: 0 auto; }
  .dz-lg { min-height: 230px; padding: 30px 16px; }
}

/* Hero v3 修正：覆盖旧版 text-align:center，统一左对齐排版 */
.hero-copy { text-align: left; }
.hero-copy .hero-eyebrow { display: inline-block; }
.hero-points { max-width: 430px; }
/* 比例卡片内部加一条「图片示意」渐变，避免过空 */

/* ===== z11：顶部导航 ===== */
.top-nav { display: flex; align-items: center; gap: 4px; margin: 0 10px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  font-size: 13.5px; color: var(--muted); padding: 8px 13px; border-radius: 999px;
  transition: color .15s ease, background .15s ease;
}
.nav-btn:hover { color: var(--fg); background: var(--bg); }
.nav-btn.is-on { color: var(--gold-deep); background: var(--gold-soft); font-weight: 600; }

/* ===== z11：新功能徽章 ===== */
.tag-new { background: #f2eaff; color: #7c3aed; border-color: #d8c7ff; }

/* ===== z11：AI 抠图结果（棋盘格 = 透明区域） ===== */
.matt-preview {
  max-width: 100%; max-height: 480px; object-fit: contain; border-radius: 6px; cursor: zoom-in;
  background-image: linear-gradient(45deg, #e6e8ec 25%, transparent 25%, transparent 75%, #e6e8ec 75%),
                    linear-gradient(45deg, #e6e8ec 25%, transparent 25%, transparent 75%, #e6e8ec 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px;
}

/* ===== z11：调整与滤镜 ===== */
.atab-body { margin-top: 12px; }
.adjust-input {
  width: 100%; box-sizing: border-box; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
  color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); outline: none;
}
.adjust-input:focus { border-color: var(--gold); }
.adjust-row2 { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.adjust-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.adjust-mini input[type="color"] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); cursor: pointer; }
.adjust-wrap { display: flex; justify-content: center; align-items: center; width: 100%; }
.adjust-stack { position: relative; max-width: 100%; line-height: 0; border-radius: var(--r-sm); overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.10); }
.adjust-stack canvas { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; }
.adjust-overlay { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#adjustOverlay { cursor: crosshair; }
.btn-mini.is-on { color: var(--gold-deep); background: var(--gold-soft); border-color: var(--gold); }
.seg-wrap { flex-wrap: wrap; }

/* ===== z14：全站移动端适配 ===== */
@media (max-width: 900px) {
  .key-btn { padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
}

@media (max-width: 767px) {
  /* 头部：两行结构 —— 第一行品牌 + 操作，第二行导航横向滚动 */
  .header-inner { flex-wrap: wrap; padding: 10px 14px; row-gap: 2px; }
  .brand { flex: 1 1 auto; }
  .brand-logo { width: 30px; height: 30px; }
  .brand-logo svg { width: 16px; height: 16px; }
  .brand-name { font-size: 17px; }
  .header-actions { margin-left: 0; gap: 8px; flex: 0 0 auto; }
  .quota-chip { display: none; }
  .top-nav {
    order: 3; width: 100%; margin: 4px 0 0;
    justify-content: flex-start;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .nav-btn { flex: 0 0 auto; padding: 7px 11px; font-size: 12.5px; }

  /* 编辑页模式栏：单行不折行，横向滚动 */
  .mode-bar { overflow-x: auto; scrollbar-width: none; }
  .mode-bar::-webkit-scrollbar { display: none; }
  .mode-btn { flex: 0 0 auto; white-space: nowrap; font-size: 12.5px; padding: 9px 10px; gap: 5px; }
  .mode-btn svg { width: 15px; height: 15px; }

  /* 主按钮区：主按钮整行，次要按钮换行放下 */
  .engine-actions { flex-wrap: wrap; }
  .engine-actions .btn-ghost { flex: 1 1 100%; }

  /* 开关组可换行，避免挤压 */
  .seg { flex-wrap: wrap; }
  .seg .seg-btn { white-space: nowrap; }

  /* 弹窗限高可滚，防止小屏内容溢出屏幕 */
  .modal-card { max-height: 86vh; overflow-y: auto; }

  /* 调整预览限制高度，留出操作空间 */
  .adjust-stack canvas { max-height: 46vh; }

  /* 结果对比区提示文字更紧凑 */
  .stage-note { font-size: 11.5px; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 15.5px; }
  .brand { gap: 7px; }
  .key-btn { padding: 7px 8px; font-size: 11.5px; }
  .icon-btn { width: 30px; height: 30px; }
  .nav-btn { padding: 6px 9px; font-size: 12px; }
  .mode-btn { font-size: 12px; padding: 8px 7px; gap: 4px; }
  .btn-mini { font-size: 11.5px; padding: 5px 9px; }
  .fc-title { font-size: 15px; }
  .gen-page-title { font-size: 15.5px; }
}

/* 微调滑块行小屏 4px 溢出修正 */
.tune-row { max-width: 100%; min-width: 0; }
.quality-label { flex-wrap: wrap; }
.tune-body { overflow-x: clip; }

/* ===== z17：视觉精致化（保留金色主色，统一排版与组件质感） ===== */
.home-view { gap: 26px; }
.hero { padding: 46px 8px 12px; }
.hero-eyebrow {
  padding: 5px 13px; border-radius: 999px; border: 1px solid rgba(255,185,15,.35);
  letter-spacing: 2.5px; font-size: 11px;
}
.hero-title { font-size: 38px; line-height: 1.22; letter-spacing: .2px; }
.hero-sub { font-size: 15px; line-height: 1.8; color: var(--muted); }
.hero-cta { gap: 12px; }
.hero-points { gap: 12px 24px; font-size: 13.5px; }
.hero-points li { display: flex; align-items: center; }
.hero-points li::before {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; margin-right: 9px; border-radius: 50%;
  background: var(--gold-soft); color: var(--gold-deep); font-size: 10px; font-weight: 700;
}

/* 上传区：更精致的卡片质感与 hover 反馈 */
.dropzone {
  border-radius: var(--r-lg);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--gold); background: var(--gold-soft);
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

/* 功能卡片：统一内距、图标底色、箭头反馈 */
.feature-grid { gap: 16px; }
.feature-card { padding: 22px 22px 20px; border-radius: var(--r-lg); position: relative; }
.feature-card .fc-icon { width: 42px; height: 42px; border-radius: 12px; }
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.10); }
.feature-card .fc-title { font-size: 16.5px; letter-spacing: .2px; }
.section-title { font-size: 19px; font-weight: 700; color: var(--fg-strong); margin: 0 0 4px; }

/* 按钮与胶囊：统一圆角与按压反馈 */
.btn { border-radius: 999px; font-weight: 600; letter-spacing: .3px; transition: transform .12s ease, box-shadow .18s ease, background .18s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 6px 18px rgba(255,185,15,.28); }
.btn-mini { border-radius: 999px; }
.chip { border-radius: 999px; }

/* 顶部导航：选中胶囊更精致 */
.nav-btn.is-on { box-shadow: inset 0 0 0 1px rgba(255,185,15,.35); }

/* 面板与分区标题层级 */
.panel-title { letter-spacing: .3px; }

/* ===== z18：功能落地页（使用步骤 / FAQ / 相关工具）与首页转化版块 ===== */
.seo-block {
  margin-top: 22px; padding: 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.seo-title { margin: 0 0 16px; font-size: 18px; font-weight: 700; color: var(--fg-strong); letter-spacing: .2px; }
.seo-sub { margin: 24px 0 10px; font-size: 14.5px; font-weight: 600; color: var(--fg-strong); }

.step-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: step; }
.step-cards li {
  display: flex; gap: 12px; padding: 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md);
}
.step-no {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold); color: #fff; font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-cards b { display: block; font-size: 14px; color: var(--fg-strong); margin-bottom: 5px; }
.step-cards p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }

.faq-item { border-top: 1px solid var(--line); }
.faq-item:first-of-type { border-top: 0; }
.faq-item summary {
  cursor: pointer; padding: 12px 2px; font-size: 13.5px; font-weight: 500; color: var(--fg-strong);
  list-style: none; position: relative; padding-right: 26px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 17px; color: var(--gold); font-weight: 400; transition: transform .2s ease;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin: 0 0 14px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }

.tool-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.tool-links > span { font-size: 12.5px; color: var(--faint); margin-right: 2px; }
.tool-link {
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
  font-family: inherit; font-size: 12.5px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.tool-link:hover { border-color: var(--gold); color: var(--gold-deep); background: var(--gold-soft); }

/* 首页：为什么选 / 适用场景 / 说明 */
.block-head { margin-bottom: 16px; }
.block-title { margin: 0 0 6px; font-size: 21px; font-weight: 700; color: var(--fg-strong); letter-spacing: .2px; }
.block-sub { margin: 0; font-size: 13.5px; color: var(--muted); }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.why-card {
  padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); transition: transform .15s ease, border-color .15s ease;
}
.why-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.why-ico {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 12px;
  background: var(--gold-soft); display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.why-card b { display: block; font-size: 15px; color: var(--fg-strong); margin-bottom: 7px; }
.why-card p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }

.use-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.use-item { padding: 15px 17px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); }
.use-item b { display: block; font-size: 13.5px; color: var(--fg-strong); margin-bottom: 5px; }
.use-item p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }

.note-block { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.note-item {
  display: flex; gap: 12px; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-card);
}
.note-ico { font-size: 18px; line-height: 1.2; }
.note-item b { display: block; font-size: 13.5px; color: var(--fg-strong); margin-bottom: 5px; }
.note-item p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }

@media (max-width: 767px) {
  .step-cards { grid-template-columns: 1fr; }
  .seo-block { padding: 18px; }
  .block-title { font-size: 19px; }
}

/* ===== z20：首页说明区视觉化重做（图标卖点 + 真实效果图场景） ===== */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.why-card {
  position: relative; padding: 22px 20px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.why-card::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 96px; height: 96px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,185,15,.16), transparent 70%);
  pointer-events: none;
}
.why-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 12px 28px rgba(0,0,0,.10); }
.why-ico {
  width: 40px; height: 40px; border-radius: 12px; margin-bottom: 14px;
  background: var(--gold-soft); color: var(--gold-deep);
  display: flex; align-items: center; justify-content: center;
}
.why-ico svg { width: 21px; height: 21px; }
.why-card b { display: block; font-size: 15px; color: var(--fg-strong); margin-bottom: 7px; letter-spacing: .2px; }
.why-card p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.why-num {
  display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--gold-deep);
  background: var(--gold-soft); border-radius: 999px; padding: 3px 10px;
}
.why-foot {
  margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--faint); text-align: center;
}

/* 场景卡：真实效果图 + 一句说明 */
.scene-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.scene-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.scene-card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 14px 32px rgba(0,0,0,.12); }
.scene-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg); }
.scene-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.scene-card:hover .scene-img img { transform: scale(1.05); }
.scene-tag {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  font-size: 11px; color: #fff; padding: 3px 10px; border-radius: 999px;
  background: rgba(17,24,39,.62); backdrop-filter: blur(3px);
}
.scene-body { padding: 14px 16px 16px; }
.scene-body b { display: block; font-size: 14.5px; color: var(--fg-strong); margin-bottom: 6px; }
.scene-body p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }

@media (max-width: 1024px) {
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .scene-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .why-grid, .scene-grid { grid-template-columns: 1fr; }
  .why-foot { text-align: left; line-height: 1.7; }
}

/* ===== z23：AI 页面预览区引导型空状态（替代"裂图"观感） ===== */
.preview-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 32px 22px;
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  text-align: center;
}
.pe-icon {
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 8px;
  background: var(--gold-soft); color: var(--gold-deep);
  display: flex; align-items: center; justify-content: center;
}
.pe-icon svg { width: 24px; height: 24px; }
.pe-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--fg-strong); }
.pe-sub { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); max-width: 420px; }
.pe-samples { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.pe-samples > span { font-size: 12px; color: var(--faint); }
.pe-sample {
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
  font-family: inherit; font-size: 12px; padding: 6px 13px; border-radius: 999px; cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.pe-sample:hover { border-color: var(--gold); color: var(--gold-deep); background: var(--gold-soft); }
.gen-preview-wrap { position: relative; }

@media (max-width: 767px) {
  .preview-empty { padding: 24px 16px; }
  .pe-samples > span { width: 100%; }
}

/* ===== z24：添加水印模式（多水印 + 平铺） ===== */
.watermark-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 8px;
}
#wmCanvas {
  max-width: 100%; max-height: 56vh; width: auto; height: auto;
  border-radius: var(--r-md); background: var(--bg);
  box-shadow: var(--shadow-card); cursor: move; touch-action: none; display: block;
}
.main-actions .engine-actions { margin-top: 0; }
.main-actions .apply-hint { margin-top: 10px; }

.wm-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.wm-empty-tip { margin: 0; font-size: 12.5px; color: var(--faint); padding: 10px 2px; }
.wm-item {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
  font-family: inherit; font-size: 12.5px; text-align: left;
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.wm-item:hover { border-color: var(--gold); }
.wm-item.is-on { border-color: var(--gold); background: var(--gold-soft); }
.wm-item-ico {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px;
  background: var(--gold-soft); color: var(--gold-deep);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.wm-item-txt { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-item-tag { flex: 0 0 auto; font-size: 10.5px; color: var(--gold-deep); border: 1px solid var(--gold); border-radius: 999px; padding: 1px 7px; }
.wm-list-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }

.wm-editor { border-top: 1px solid var(--line); padding-top: 14px; }
.wm-group { margin-top: 14px; }
.wm-group-title { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.wm-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.wm-field { display: block; font-size: 12.5px; color: var(--muted); }
.wm-field span { display: block; margin-bottom: 6px; }
.wm-field input[type="text"] {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px;
  color: var(--fg); background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 11px; outline: none;
}
.wm-field input[type="text"]:focus { border-color: var(--gold); }
.wm-switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg); cursor: pointer; }
.wm-switch input { accent-color: var(--gold); width: 16px; height: 16px; }
.wm-tile-opts { padding-left: 2px; }

@media (max-width: 767px) {
  #wmCanvas { max-height: 40vh; }
}

/* 水印面板小屏溢出修正 */
.wm-editor, .wm-group, .wm-field { min-width: 0; max-width: 100%; }
.wm-chips { min-width: 0; }
.adjust-mini { flex-wrap: wrap; }
@media (max-width: 767px) {
  .wm-editor, .wm-group { overflow-x: clip; }
}

/* ===== z25：生图 loading 只遮结果区 + Hero 对比图放大 ===== */
.gen-result-panel { position: relative; }
.gen-result-panel .stage-loading { border-radius: var(--r-md); z-index: 5; }
.hero-inner { grid-template-columns: 1fr 1fr; gap: 40px; }
.hv-compare { max-width: 560px; }
@media (max-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr; }
}

/* ===== z31：顶部导航「AI 去水印」+ 溢出自动折叠进「更多 ▾」 ===== */
.nav-more { position: relative; display: flex; align-items: center; }
.nav-more-btn { font-weight: 600; }
.nav-more.has-on .nav-more-btn { color: var(--gold-deep); background: var(--gold-soft); }
.nav-drop {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 150px; padding: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop, 0 10px 30px rgba(0,0,0,.14));
  display: flex; flex-direction: column; gap: 2px; z-index: 60;
}
.nav-drop .nav-btn { display: block; width: 100%; text-align: left; }
.nav-drop .nav-btn.is-on { background: var(--gold-soft); color: var(--gold-deep); }

@media (max-width: 767px) {
  .nav-drop { display: none; }
}
