/* ==========================================================================
   实况图工坊 · 样式表

   移动优先，三档断点：
     ≤ 767px   手机    —— 底部标签栏，单列
     768–1023  平板    —— 底部标签栏，单列（更宽）
     ≥ 1024px  桌面    —— 左侧导航栏，单列居中，左右留大片空白

   设计语言：白底 + 大留白，参考同类出图工具（即梦 / 可灵）的做法 ——
     · 页面就是一片近白底，不放描边、不放卡片墙。整页只有一个白色面，
       分组靠"留白 + 一道极淡的分隔"来分，不靠框。
     · 视觉焦点只有一个：描述输入框。它最大、最亮、最靠中间。
     · 参考图统一成一个横向槽位条（缩略图并排、单行横滑、不换行），
       没有图的槽位是灰色占位块 —— 跟有图的槽位一样大小，一眼看出还差什么。
     · 画面设置压成"标签在左、选项在右"的三行，紧贴输入框下方。
     · 提交是全页最重的一个元素：高 56、通栏、品牌渐变。
     · 所有"选中"一律是实心色块；所有"未选中"一律是浅灰描边。不用第三种状态。
     · 字号层级靠大小和灰阶拉开，不靠加粗、不加装饰色。
   ========================================================================== */

:root {
  /* 品牌 */
  --brand: #2563EB;
  --brand-600: #1D4ED8;
  --brand-700: #1E40AF;
  --brand-soft: #EFF5FF;
  --brand-line: #DCE8FF;

  /* 中性：整页只有四档灰，够用了 */
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #98A2B3;
  --line: #EAECF0;
  --line-strong: #D0D5DD;
  --bg: #FAFAFC;
  --surface: #FFFFFF;
  --surface-2: #F5F6FA;

  /* 语义色 */
  --ok: #12B76A;
  --ok-soft: #E7F8F0;
  --warn: #B54708;
  --warn-soft: #FFFAEB;
  --danger: #D92D20;
  --danger-soft: #FEF3F2;

  /* 形状：圆角只留三档，别到处不一样 */
  --r-xl: 28px;
  --r-lg: 20px;
  --r: 14px;
  --r-sm: 10px;
  --pill: 999px;

  /* 阴影：很轻。白底上阴影一重就脏 */
  --sh-1: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.04);
  --sh-2: 0 2px 6px rgba(16, 24, 40, 0.05), 0 16px 36px rgba(16, 24, 40, 0.07);
  --sh-3: 0 24px 64px rgba(16, 24, 40, 0.16);
  --sh-brand: 0 8px 22px rgba(37, 99, 235, 0.26);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --rail-w: 248px;
  --pad: 20px;
  --rhythm: 34px;      /* 段与段之间那口气 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 顶上一点点品牌色晕染。只为了让白底别死板，不能看出是"一张图" */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 78% -12%, rgba(37, 99, 235, 0.055), transparent 66%),
    radial-gradient(680px 380px at -8% -6%, rgba(139, 92, 246, 0.04), transparent 64%);
}

img, video { max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
a { color: var(--brand); text-decoration: none; }

::selection { background: var(--brand-soft); color: var(--brand-700); }

@media (min-width: 1024px) {
  * { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 2px solid var(--bg); }
  *::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
  *::-webkit-scrollbar-track { background: transparent; }
}

/* ==========================================================================
   骨架
   ========================================================================== */

.app { min-height: 100vh; min-height: 100dvh; }

.main { min-width: 0; }

.content {
  padding: 0 var(--pad) 140px;
  max-width: 760px;
  margin: 0 auto;
}

.page { display: none; animation: pageIn 0.28s ease both; }
.page.active { display: block; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 顶栏：大标题 + 一行说明，就这两样 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(250, 250, 252, 0.94) 60%, rgba(250, 250, 252, 0));
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  padding: calc(env(safe-area-inset-top, 0) + 26px) var(--pad) 22px;
  max-width: 760px;
  margin: 0 auto;
}
.topbar h1 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.2;
}
.topbar .sub {
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 5px;
  letter-spacing: 0.005em;
}

/* ---------- 导航 ---------- */

.nav {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid rgba(16, 24, 40, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-items { display: flex; flex: 1; }

.nav button.tab {
  flex: 1;
  border: 0;
  background: none;
  padding: 10px 2px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  position: relative;
  transition: color 0.16s;
}
.nav button.tab .dot {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 650;
  color: inherit;
  transition: background 0.16s, transform 0.16s, box-shadow 0.16s;
}
.nav button.tab.on { color: var(--brand); font-weight: 600; }
.nav button.tab.on .dot {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-600) 100%);
  color: #fff;
  box-shadow: var(--sh-brand);
}
.nav button.tab:active .dot { transform: scale(0.9); }
.nav .badge {
  position: absolute;
  top: 4px;
  left: 50%;
  margin-left: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 17px;
  text-align: center;
}

.nav-brand,
.nav-foot { display: none; }

@media (min-width: 1024px) {
  .nav {
    top: 0;
    bottom: 0;
    right: auto;
    width: var(--rail-w);
    flex-direction: column;
    align-items: stretch;
    padding: 26px 16px 20px;
    border-top: 0;
    border-right: 1px solid rgba(16, 24, 40, 0.06);
    background: rgba(255, 255, 255, 0.7);
  }
  .nav-items { flex-direction: column; gap: 3px; flex: none; }

  .nav button.tab {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 14px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--r);
    color: var(--ink-2);
    transition: background 0.15s, color 0.15s;
  }
  .nav button.tab .dot { width: 28px; height: 28px; border-radius: 9px; font-size: 13px; }
  .nav button.tab:hover { background: var(--surface-2); color: var(--ink); }
  .nav button.tab.on {
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-600) 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--sh-brand);
  }
  .nav button.tab.on .dot { background: rgba(255, 255, 255, 0.2); color: #fff; box-shadow: none; }
  .nav button.tab.on:hover { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-600) 100%); color: #fff; }
  .nav .badge { position: static; margin: 0 0 0 auto; }
  .nav button.tab.on .badge { background: #fff; color: var(--brand-700); }

  .nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 14px 26px;
  }
  .nav-brand .logo {
    width: 40px; height: 40px; border-radius: 13px; flex: none;
    background: linear-gradient(140deg, var(--brand) 0%, #5B8DEF 62%, #8B5CF6 140%);
    color: #fff; font-size: 17px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--sh-brand);
    letter-spacing: -0.02em;
  }
  .nav-brand .txt { min-width: 0; }
  .nav-brand .t1 { font-size: 16px; font-weight: 700; letter-spacing: -0.025em; }
  .nav-brand .t2 { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

  .nav-foot { display: block; margin-top: auto; padding: 0 6px; }
  .nav-foot .ver {
    font-size: 11.5px; color: var(--ink-3);
    padding: 13px 7px 0; border-top: 1px solid var(--line); margin-top: 13px;
  }
  .nav-foot .logout {
    width: 100%; border: 0; background: none; cursor: pointer;
    font-size: 14px; color: var(--ink-2); text-align: left;
    padding: 10px 14px; border-radius: var(--r-sm); transition: all 0.15s;
  }
  .nav-foot .logout:hover { background: var(--danger-soft); color: var(--danger); }

  .main { margin-left: var(--rail-w); }
  :root { --pad: 40px; --rhythm: 44px; }
  .content { max-width: 880px; padding-bottom: 96px; }
  .topbar { max-width: 880px; padding-top: 48px; padding-bottom: 30px; }
  .topbar h1 { font-size: 34px; }
  .topbar .sub { font-size: 14.5px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  :root { --pad: 32px; --rhythm: 40px; }
  .content { max-width: 800px; padding-bottom: 132px; }
  .topbar { max-width: 800px; }
  .topbar h1 { font-size: 30px; }
}

/* ==========================================================================
   段：页面就是这样一段一段摞起来的，段与段之间只有留白
   ========================================================================== */

.sec { margin-top: var(--rhythm); }
.sec:first-child { margin-top: 0; }

/* 段标题故意做小做灰 —— 内容才是主角，标题只要让人认得出"这是哪一段" */
.sec-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  line-height: 1.5;
}
.sec-title .hint {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0;
  margin-left: auto;
  text-align: right;
}
/* 步骤号：一个很淡的小圆点 + 数字。不抢戏，但切模式重排时看得出来是第几步 */
.sec-title .n {
  flex: none;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

/* ---------- 卡片 / 浅色块 ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh-1);
  margin-bottom: 16px;
}
.card.tight { padding: 18px; }

/* 段里的"子块"（场景描述、底图旧衣、费用预估…）：浅灰底、不投影。
   白底上再来一层白卡，两层的边会糊在一起；浅灰反而一眼看得出是"里面的一块"。 */
.soft {
  background: var(--surface-2);
  border-radius: var(--r);
  padding: 18px;
}

.hide { display: none !important; }

@media (min-width: 1024px) {
  .card { padding: 26px; border-radius: var(--r-xl); }
  .card.tight { padding: 20px; }
  .soft { padding: 20px; border-radius: var(--r-lg); }
}

/* ---------- 小工具 ---------- */

.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.muted { color: var(--ink-2); font-size: 14.5px; }
.tiny { font-size: 13px; color: var(--ink-3); line-height: 1.7; }
.strong { font-weight: 600; }
.nowrap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { color: var(--ink-3); font-size: 12.5px; font-weight: 400; }

.tagstate {
  font-style: normal;
  display: inline-block;
  font-size: 11.5px;
  line-height: 1.55;
  padding: 2px 9px;
  border-radius: var(--pill);
  background: var(--brand-soft);
  color: var(--brand-700);
  margin-left: 6px;
  vertical-align: 1px;
  font-weight: 500;
}
.tagstate.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- 按钮 ---------- */

.btn {
  border: 0;
  border-radius: var(--r);
  font-size: 15.5px;
  font-weight: 560;
  padding: 12px 20px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.18s, background 0.18s, opacity 0.18s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { background: var(--line); }
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-600) 100%);
  color: #fff;
  box-shadow: var(--sh-brand);
}
.btn.primary:hover { box-shadow: 0 12px 30px rgba(37, 99, 235, 0.32); }
.btn.ghost {
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { display: flex; width: 100%; }
.btn.lg { font-size: 17px; font-weight: 600; padding: 16px 26px; border-radius: var(--r-lg); }
.btn.sm { font-size: 13.5px; padding: 8px 15px; border-radius: var(--r-sm); font-weight: 500; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none !important; box-shadow: none; }
.btn.quiet { background: none; color: var(--ink-2); padding: 8px 12px; }
.btn.quiet:hover { background: var(--surface-2); }

/* 提交那一颗是全页最重的东西：高 56、通栏、底下留一大口气 */
#submitStill {
  margin-top: 8px;
  height: 56px;
  width: 100%;
  font-size: 17px;
  font-weight: 600;
  border-radius: var(--r-lg);
  letter-spacing: 0.01em;
}
@media (min-width: 1024px) {
  #submitStill { height: 60px; font-size: 17.5px; }
}

/* ---------- 选项胶囊 ---------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding: 2px 2px 4px;
  margin: 0 -2px;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--line-strong);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  padding: 9px 16px;
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.16s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-600) 100%);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 5px 14px rgba(37, 99, 235, 0.24);
}
.chip.switch { min-width: 80px; text-align: center; }
.chip.switch::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  margin-right: 7px;
  vertical-align: 1px;
  transition: background 0.16s;
}
.chip.switch.on {
  background: linear-gradient(160deg, #17B26A 0%, #0E9F6E 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 5px 14px rgba(18, 183, 106, 0.24);
}
.chip.switch.on::before { background: #fff; }

/* 动作那种一整排（9 个起）必须换行铺开 —— 横滑会把一半选项藏在屏幕外 */
.chips.wrap { flex-wrap: wrap; overflow-x: visible; }

/* ---------- 参考图槽位条 ----------
   提示词 / 配图 / 衣服，几处用的是同一套：单行、横滑、绝不换行。
   桌面上一换行就会变成"两排缩略图墙"，把页面撑得很高很碎 ——
   同类工具（即梦 / 可灵）都是横滑一条。 */

.picker {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding: 2px 0 6px;
  margin: 0 -2px;
  -webkit-overflow-scrolling: touch;
}
.picker::-webkit-scrollbar { display: none; }

/* 开关开着时底图是现场出的，这一条现成图这次不参与 —— 压下去，
   让它一眼看出"不是它"，而不是像没选中那样含糊 */
.picker.dim { opacity: .4; }
.picker.dim .pick { cursor: default; }

/* 这条提示词一张图都没有时的占位。做得矮一点，别撑出一个空的大槽位条。
   ★ 边框必须用 --line-strong，不能用 --line：--line 是 #EAECF0，铺在 --bg / --surface-2
   上几乎看不见，整块就成了一大片没有边界的空白（用户 2026-09-20 的原话"看着太旷了"）。
   再补一个白底 + 一个小图图标，让它读起来是"这里该放一张图"，而不是一段飘着的灰字。 */
.pick-empty {
  flex: 1 1 auto;
  min-width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  height: 58px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 13.5px;
}
/* 一个小"图片"图标（圆角方框 + 一条对角线），纯 CSS，不引资源 */
.pick-empty::before {
  content: '';
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: linear-gradient(to top right,
    transparent calc(50% - 0.8px), var(--line-strong) calc(50% - 0.8px) calc(50% + 0.8px),
    transparent calc(50% + 0.8px));
}

.picker .pick {
  flex: none;
  width: 108px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  text-align: center;
  position: relative;
}
.picker .pick img,
.picker .pick .ph {
  width: 108px;
  height: 135px;
  border-radius: var(--r);
  display: block;
  border: 2.5px solid transparent;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.16s;
}
.picker .pick img { object-fit: cover; background: var(--surface-2); }
.picker .pick:hover img,
.picker .pick:hover .ph { transform: translateY(-2px); box-shadow: var(--sh-2); }
.picker .pick.on img,
.picker .pick.on .ph { border-color: var(--brand); box-shadow: var(--sh-brand); }

/* 还没有参考图：一块灰底 + 一个细线图标。跟有图时一样大，所以一眼看出"这张还差图" */
.picker .pick .ph {
  background: var(--surface-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='none' stroke='%2398A2B3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E")
    center / 26px no-repeat;
}
/* 选中的那张右上角盖一枚实心勾 —— 缩略图花的时候，光圈看不出来选了谁 */
.picker .pick.on::after {
  content: '✓';
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.4);
  pointer-events: none;
}
/* "+ 新写一个"那格：也是同一个尺寸的灰块，虚线边 + 一个加号 */
.picker .pick .ph.new {
  border: 1.5px dashed var(--line-strong);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='none' stroke='%2398A2B3' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}

/* 槽位左上角的小角标：这张图"能不能当底图换衣"，或者这条下面攒了几张图。
   固定在左上角是**特意**的 —— 右上角被选中那枚实心勾占着，两个角互不打架。 */
.picker .pick .cnt {
  position: absolute;
  top: 8px; left: 8px;
  padding: 0 7px;
  height: 20px;
  line-height: 20px;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
}

/* 库里还没出图的那条提示词：一块灰底占位，跟有图的一样大 */
.thumb.ph {
  background: var(--surface-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 24 24' fill='none' stroke='%2398A2B3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E")
    center / 26px no-repeat;
  cursor: pointer;
}
.picker .pick span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}
.picker .pick.on span { color: var(--brand-700); font-weight: 600; }

@media (min-width: 768px) {
  .picker { gap: 14px; }
  .picker .pick { width: 124px; }
  .picker .pick img,
  .picker .pick .ph { width: 124px; height: 156px; }
  .picker .pick span { font-size: 13px; }
}

/* ---------- 衣服槽位（跟参考图条同一套，最后多一个虚线"添加"格） ---------- */

.garment {
  flex: none;
  width: 108px;
  position: relative;
}
.gthumb { position: relative; }
.gthumb img {
  width: 108px;
  height: 135px;
  object-fit: cover;
  border-radius: var(--r);
  background: var(--surface-2);
  display: block;
  border: 2.5px solid transparent;
}
/* 「第 N 件」压在左下角：描述里要写「图二」的时候，得先知道哪张是图二 */
.gthumb .gno {
  position: absolute;
  left: 7px;
  bottom: 7px;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.55;
  padding: 1px 8px;
  border-radius: var(--pill);
  background: rgba(16, 24, 40, 0.62);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  letter-spacing: 0;
  white-space: nowrap;
}
.garment .gname {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}
.garment .x {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.garment .x:hover { background: var(--danger); }

/* 「剪」：把这张衣服图抠成单品存进衣橱。会调一次模型，所以必须是一次明确的点击，
   不能藏在"点一下缩略图"里 —— 那种设计手一滑就扣钱。 */
.garment .cut {
  position: absolute;
  top: -7px;
  left: -7px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
}
.garment .cut:hover { background: var(--brand); color: #fff; }

@media (min-width: 768px) {
  .garment { width: 124px; }
  .gthumb img { width: 124px; height: 156px; }
  .garment .gname { font-size: 13px; }
}

/* 虚线添加格：跟缩略图一样大，摆在最右边 */
.addtile {
  flex: none;
  width: 108px;
  height: 135px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink-3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.16s;
  padding: 12px;
  text-align: center;
  line-height: 1.4;
}
.addtile::before {
  content: '';
  width: 24px; height: 24px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / 24px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / 24px no-repeat;
}
.addtile:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
@media (min-width: 768px) {
  .addtile { width: 124px; height: 156px; font-size: 13px; }
}

/* ---------- 表单 ---------- */

.field { margin-bottom: 18px; }
.field > label {
  display: block;
  font-size: 13.5px;
  font-weight: 560;
  color: var(--ink-2);
  margin-bottom: 8px;
  letter-spacing: 0.005em;
}
.input,
textarea.input,
select.input {
  width: 100%;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r);
  padding: 13px 15px;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%2398A2B3' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  padding-right: 38px;
}
textarea.input { resize: vertical; min-height: 90px; line-height: 1.68; }

/* 描述框是全页的主角：更大、更亮、留白更足 */
#extraPrompt {
  min-height: 138px;
  font-size: 16.5px;
  line-height: 1.72;
  padding: 17px 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
}
@media (min-width: 1024px) {
  #extraPrompt { min-height: 152px; font-size: 17px; padding: 19px 20px; }
}

/* ---------- 画面设置：标签在左、选项在右，几行齐平 ---------- */

.params { display: block; }
.params .p {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}
.params .p + .p { border-top: 1px solid var(--line); }
.params .pl {
  flex: none;
  width: 82px;
  font-size: 13.5px;
  font-weight: 560;
  color: var(--ink-2);
  letter-spacing: 0.005em;
}
.params .chips { flex: 1; }
.params .tiny { margin-top: 12px; }
@media (min-width: 1024px) {
  .params .pl { width: 96px; }
}

/* 设置页那些"两列并排"的表单（生成页已经不用了，别再往上套） */
@media (min-width: 768px) {
  .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
  .field-grid .span2 { grid-column: 1 / -1; }
}

/* ---------- 提示词预览 ---------- */

.promptbox {
  margin-top: 14px;
  border-radius: var(--r);
  background: var(--surface-2);
  padding: 16px 18px;
}
.promptbox .lab {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 10px;
  letter-spacing: 0.03em;
}
.promptbox .say { font-size: 14.5px; line-height: 1.76; color: var(--ink); }
.promptbox pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.78;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}
.promptbox .foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ---------- 折叠的高级设置 ---------- */

details.adv {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 2px;
}
details.adv > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 2px 6px;
  font-size: 14.5px;
  font-weight: 550;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 9px;
  user-select: none;
}
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::after {
  content: '';
  margin-left: auto;
  width: 8px; height: 8px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s;
}
details.adv[open] > summary::after { transform: rotate(225deg) translate(-2px, -2px); }
details.adv[open] > summary { color: var(--ink); }

/* ---------- 标签 ---------- */

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 550;
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--brand-soft);
  color: var(--brand-700);
  margin-right: 5px;
}
.pill.gray { background: var(--surface-2); color: var(--ink-2); }
.pill.ok { background: var(--ok-soft); color: #087443; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- 提示条 ---------- */

.banner {
  border-radius: var(--r);
  padding: 15px 17px;
  font-size: 14px;
  line-height: 1.68;
  background: var(--warn-soft);
  color: #7A4405;
  margin-bottom: 16px;
  box-shadow: inset 0 0 0 1px rgba(181, 71, 8, 0.14);
}
.banner.ok { background: var(--ok-soft); color: #087443; box-shadow: inset 0 0 0 1px rgba(18, 183, 106, 0.16); }
.banner.danger { background: var(--danger-soft); color: #912018; box-shadow: inset 0 0 0 1px rgba(217, 45, 32, 0.14); }

details.notice {
  background: var(--warn-soft);
  border-radius: var(--r);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(181, 71, 8, 0.14);
}
details.notice > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 560;
  color: #7A4405;
  user-select: none;
}
details.notice > summary::-webkit-details-marker { display: none; }
.notice-dot {
  flex: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--warn);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.notice-hint { margin-left: auto; font-weight: 400; font-size: 12.5px; opacity: 0.75; }
details.notice[open] .notice-hint { visibility: hidden; }
details.notice ul { margin: 0; padding: 0 16px 4px 44px; }
details.notice li { font-size: 13.4px; line-height: 1.72; color: #7A4405; margin-bottom: 8px; }
.notice-foot {
  padding: 12px 16px 14px;
  font-size: 12.5px;
  color: #8A5A1C;
  border-top: 1px solid rgba(181, 71, 8, 0.13);
  margin-top: 4px;
}

/* ---------- 空态 ---------- */

.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.95;
  background: var(--surface);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.empty::before {
  content: '';
  display: block;
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  border-radius: 15px;
  background: var(--surface-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2398A2B3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E")
    center / 24px no-repeat;
}

/* ---------- 网格 ---------- */

.grid { display: grid; gap: 12px; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g4 { grid-template-columns: repeat(4, 1fr); }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 400px) {
  .grid.g4 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .grid { gap: 16px; }
  .grid.g3 { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
  .grid.g4 { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
}

/* ---------- 缩略图 ---------- */

.thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--r);
  background: var(--surface-2);
  display: block;
  transition: transform 0.22s, box-shadow 0.22s;
}
.thumb.wide { aspect-ratio: 4 / 3; }
.thumb-wrap { position: relative; cursor: pointer; }
.thumb-wrap:hover .thumb { transform: translateY(-2px); box-shadow: var(--sh-2); }
.thumb-wrap .tick {
  position: absolute;
  top: 8px; right: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(16, 24, 40, 0.42);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s;
}
.thumb-wrap.on .tick { background: var(--brand); }
.thumb-wrap.on .thumb { outline: 3px solid var(--brand); outline-offset: -3px; }
.thumb-wrap .cap {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 7px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
video.thumb { object-fit: cover; }

/* ---------- 任务卡 ---------- */

.job {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-1);
  margin-bottom: 14px;
  transition: box-shadow 0.2s;
}
@media (min-width: 1024px) {
  .job { padding: 22px; border-radius: var(--r-xl); }
  .job:hover { box-shadow: var(--sh-2); }
}
.job .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.job .name { font-weight: 650; font-size: 17px; letter-spacing: -0.02em; }
.job .stage { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.bar {
  height: 6px;
  border-radius: 6px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 14px;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--brand), #6BA0FF);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.bar.ok i { background: linear-gradient(90deg, #12B76A, #34D399); }
.bar.err i { background: linear-gradient(90deg, var(--danger), #F87171); }
.bar i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 1.6s linear infinite;
}
.bar.ok i::after, .bar.err i::after { display: none; }
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
.job .err {
  font-size: 13.5px;
  color: var(--danger);
  margin-top: 12px;
  line-height: 1.68;
  background: var(--danger-soft);
  padding: 12px 15px;
  border-radius: var(--r-sm);
}
.job .prev {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  flex-wrap: nowrap;
}
.job .prev::-webkit-scrollbar { display: none; }
.job .prev img, .job .prev video {
  width: 104px;
  height: 132px;
  object-fit: cover;
  border-radius: var(--r);
  background: var(--surface-2);
  flex: none;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.16s;
}
.job .prev img:hover, .job .prev video:hover { transform: translateY(-2px); }
.job .prev .sel img, .job .prev .sel video { border-color: var(--brand); }
.job .acts { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- 键值表 ---------- */

.kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-2); flex: none; }
.kv .v { font-weight: 560; text-align: right; word-break: break-all; }

.kv.tappable {
  cursor: pointer;
  margin: 0 -14px;
  padding-left: 14px;
  padding-right: 14px;
  border-radius: var(--r-sm);
  transition: background 0.14s;
}
.kv.tappable:hover { background: var(--surface-2); }
.kv .chev { color: var(--ink-3); margin-left: 3px; font-size: 14px; flex: none; }
.keymask { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.keylist { margin-top: 2px; }
.keylist .kv { font-size: 13.5px; }

/* ---------- 文案框 ---------- */

.copybox {
  background: var(--surface-2);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: 12px;
}
.copybox .lab {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}
.copybox .txt { font-size: 15.5px; line-height: 1.84; white-space: pre-wrap; word-break: break-word; }

/* ---------- 吐司 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(16px) scale(0.97);
  background: rgba(16, 24, 40, 0.94);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 14.5px;
  padding: 14px 22px;
  border-radius: var(--r);
  max-width: min(84vw, 460px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.24s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  line-height: 1.58;
  box-shadow: var(--sh-3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
@media (min-width: 1024px) {
  .toast { bottom: 40px; left: calc(50% + var(--rail-w) / 2); }
}

/* ---------- 弹层 ---------- */

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.44);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sheet-mask.show { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  background: var(--surface);
  width: 100%;
  max-width: 720px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom, 0));
  max-height: 88vh;
  overflow-y: auto;
  animation: sheetUp 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  overscroll-behavior: contain;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: none; }
}
.sheet h3 { font-size: 21px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.025em; }
.sheet .sheet-sub { font-size: 13.5px; color: var(--ink-3); margin-bottom: 22px; line-height: 1.66; }
.sheet::after { content: ''; display: block; height: 2px; }

@media (min-width: 768px) {
  .sheet-mask { align-items: center; padding: 36px; }
  .sheet {
    border-radius: var(--r-xl);
    max-height: min(82vh, 860px);
    padding: 32px 32px 28px;
    box-shadow: var(--sh-3);
  }
  @keyframes sheetUp {
    from { transform: translateY(14px) scale(0.98); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

/* ---------- 加载圈 ---------- */

.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sp 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ==========================================================================
   登录页
   ========================================================================== */

.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(37, 99, 235, 0.16), transparent 62%),
    radial-gradient(900px 540px at 92% 6%, rgba(139, 92, 246, 0.13), transparent 58%),
    linear-gradient(170deg, #FCFCFE 0%, #F1F4FA 100%);
}
.gate-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--r-xl);
  padding: 38px 32px 34px;
  box-shadow: 0 26px 64px rgba(16, 24, 40, 0.13), 0 2px 8px rgba(16, 24, 40, 0.05);
  animation: gateIn 0.45s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes gateIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.gate-logo {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: linear-gradient(140deg, var(--brand) 0%, #5B8DEF 55%, #8B5CF6 130%);
  color: #fff;
  font-size: 23px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-brand);
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}
.gate-card h1 { font-size: 27px; font-weight: 700; letter-spacing: -0.032em; }
.gate-card .lead { font-size: 14.5px; color: var(--ink-2); margin-top: 9px; line-height: 1.72; }
.gate-card form { margin-top: 28px; }
.gate-card .input { font-size: 16.5px; padding: 15px 17px; }
.gate-card .btn { width: 100%; margin-top: 16px; height: 54px; font-size: 16.5px; border-radius: var(--r); }
.gate-err {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.64;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: var(--r-sm);
  padding: 12px 15px;
  display: none;
}
.gate-err.show { display: block; animation: shake 0.36s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-6px); }
  55% { transform: translateX(5px); }
  80% { transform: translateX(-3px); }
}
.gate-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.8;
}
.gate-eye { position: relative; }
.gate-eye .input { padding-right: 54px; }
.gate-eye button {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 550;
  padding: 8px 11px;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.gate-eye button:hover { background: var(--surface-2); color: var(--ink-2); }

/* ==========================================================================
   动效偏好 / 打印
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .nav, .topbar, .toast, .sheet-mask { display: none !important; }
  .main { margin-left: 0; }
  .card, .job { box-shadow: none; border: 1px solid #ccc; }
}
