/* ============================================================
   WrapMyWear · POD 作战台
   设计语汇：暖纸底 + 墨色字 + 陶土色强调，克制的边框与阴影
   ============================================================ */

:root {
  --bg: #F3F1EC;
  --bg-deep: #EBE7DF;
  --panel: #FFFFFF;
  --panel-2: #FAF9F6;
  --line: #E5E1D8;
  --line-2: #D8D3C7;
  --ink: #1B1916;
  --ink-2: #55504A;
  --ink-3: #8B8578;
  --ink-4: #B3ACA0;
  --accent: #BE4A2C;
  --accent-deep: #9C3A20;
  --accent-soft: #FBEDE7;
  --ok: #2C7A5B;
  --ok-soft: #E8F3ED;
  --warn: #A96F14;
  --warn-soft: #FBF1DE;
  --bad: #A82C22;
  --bad-soft: #FAE9E7;
  --blue: #2B4A6F;
  --blue-soft: #E9EFF6;
  --shadow-s: 0 1px 2px rgba(27, 25, 22, .05);
  --shadow-m: 0 4px 14px rgba(27, 25, 22, .07);
  --shadow-l: 0 18px 48px rgba(27, 25, 22, .16);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --rail: 232px;
  --agent: 384px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }

.hidden { display: none !important; }

.num { font-variant-numeric: tabular-nums; }

/* ---------------- 通用控件 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: .16s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); box-shadow: var(--shadow-s); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #000; }

.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink-2); }
.btn.ghost:hover { background: var(--panel-2); color: var(--ink); }

.btn.quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--bg-deep); color: var(--ink); }

.btn.danger { color: var(--bad); border-color: #E8C9C5; background: var(--bad-soft); }
.btn.danger:hover { background: #F6DCD9; }

.btn.tiny { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }

.icon-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-3); font-size: 13px; cursor: pointer;
}
.icon-btn:hover { background: var(--bg-deep); color: var(--ink); }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; letter-spacing: .02em; }

.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel);
  outline: none;
  transition: .16s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238B8578' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

.inline { display: flex; gap: 8px; }

/* 行内代码。注意上面 .inline 是布局工具类（display:flex），
   <code class="inline"> 会被它带成整行块，这里用更高优先级改回行内。 */
code.inline {
  display: inline;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-deep);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  word-break: break-word;
}

/* 分段选择器（设置页切模型来源用） */
.seg {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
  color: var(--ink-2);
  transition: .16s;
}
.seg button b { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; }
.seg button em { display: block; font-style: normal; font-size: 11px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--panel); box-shadow: var(--shadow-s); color: var(--ink); }
.seg button.on b { color: var(--accent-deep); }
.inline > .input { flex: 1; }

.check {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  font-size: 13px; color: var(--ink-2);
}
.check:hover { background: var(--panel-2); }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

/* ---------------- 登录门 ---------------- */

.gate {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(420px, 500px) 1fr;
}
.gate-card {
  background: var(--panel);
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 1px 0 0 var(--line);
}
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 19px; letter-spacing: -.02em;
  flex: none;
}
.gate-title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.gate-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.gate-lead { color: var(--ink-2); font-size: 13.5px; line-height: 1.7; margin-bottom: 26px; }
.gate-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--ink-4); font-size: 11px; }
.gate-or::before, .gate-or::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.gate-msg { min-height: 18px; font-size: 12.5px; color: var(--bad); margin-top: 10px; }
.gate-msg.ok { color: var(--ok); }
.gate-foot { font-size: 11.5px; color: var(--ink-4); margin-top: 18px; line-height: 1.6; }

.gate-side {
  background:
    radial-gradient(900px 500px at 80% 12%, #EFE6DA 0%, transparent 62%),
    radial-gradient(700px 500px at 12% 92%, #E7E3DA 0%, transparent 60%),
    var(--bg-deep);
  display: flex; align-items: center; padding: 56px;
}
.gate-side-inner { max-width: 400px; margin-left: auto; }
.eyebrow {
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 18px;
}
.flow-list { list-style: none; margin: 0; padding: 0; counter-reset: f; }
.flow-list li {
  counter-increment: f;
  position: relative;
  padding: 0 0 22px 40px;
  border-left: 1px solid var(--line-2);
  margin-left: 11px;
}
.flow-list li:last-child { border-left-color: transparent; padding-bottom: 4px; }
.flow-list li::before {
  content: counter(f);
  position: absolute; left: -12px; top: -2px;
  width: 23px; height: 23px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.flow-list b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.flow-list span { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.agent-hint {
  margin-top: 26px; display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255,255,255,.7); border: 1px solid var(--line);
  padding: 12px 14px; border-radius: var(--r-m);
  font-size: 12.5px; color: var(--ink-2); backdrop-filter: blur(6px);
}
.agent-hint .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  margin-top: 6px; flex: none; box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------------- 应用框架 ---------------- */

.app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) 0;
  transition: grid-template-columns .28s cubic-bezier(.22,.8,.3,1);
}
.app.agent-open { grid-template-columns: var(--rail) minmax(0, 1fr) var(--agent); }

.rail {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  min-height: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 20px; }
.brand-text b { display: block; font-size: 13.5px; letter-spacing: -.01em; }
.brand-text span { font-size: 11px; color: var(--ink-3); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px;
  color: var(--ink-2); font-size: 13.5px;
  transition: .14s;
}
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.active { background: var(--ink); color: #fff; }
.nav a.active .ic { color: rgba(255,255,255,.72); }
.nav .ic {
  width: 18px; text-align: center; font-style: normal;
  font-size: 13px; color: var(--ink-3);
}
.nav a > span { flex: 1; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 10.5px; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.badge.warn { background: var(--warn); }

.rail-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex: none;
}
.user-meta { min-width: 0; }
.user-meta b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { display: block; font-size: 11px; color: var(--ink-4); }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 0; }

.topbar {
  height: 68px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--line);
  background: rgba(243,241,236,.86);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 620; letter-spacing: -.015em; }
.topbar-title p { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.pulse {
  width: 6px; height: 6px; border-radius: 50%; background: #7FD8A8;
  box-shadow: 0 0 0 0 rgba(127,216,168,.7);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(127,216,168,.55); }
  70% { box-shadow: 0 0 0 7px rgba(127,216,168,0); }
  100% { box-shadow: 0 0 0 0 rgba(127,216,168,0); }
}

.view { padding: 24px 28px 60px; overflow-y: auto; flex: 1; min-height: 0; }
.view > * + * { margin-top: 16px; }

/* ---------------- 卡片 / 栅格 ---------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-s);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; row-gap: 10px;
}
.card-head > div { min-width: 0; }
.card-head h3 { font-size: 13.5px; font-weight: 620; letter-spacing: -.01em; }
.card-head .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 14px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

/* KPI */
.kpi { padding: 16px 18px; }
.kpi .k-label { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi .k-val {
  font-size: 27px; font-weight: 620; letter-spacing: -.03em;
  margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.kpi .k-val small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.kpi .k-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.kpi .k-sub b { color: var(--ok); font-weight: 600; }
.kpi .k-sub b.down { color: var(--bad); }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 11.5px; color: var(--ink-3);
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--panel-2);
}
.tbl th:first-child { border-top-left-radius: 0; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl .t-title { font-weight: 550; }
.tbl .t-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.tbl .right { text-align: right; }
.tbl-wrap { overflow-x: auto; }

/* 状态 chip */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: var(--bg-deep); color: var(--ink-2);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--blue-soft); color: var(--blue); }
.chip.accent { background: var(--accent-soft); color: var(--accent-deep); }
.chip.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 11px; color: var(--ink-3);
}

/* 空态 */
.empty {
  padding: 44px 20px; text-align: center; color: var(--ink-3);
}
.empty .e-mark {
  width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 13px;
  background: var(--panel-2); border: 1px dashed var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--ink-4);
}
.empty b { display: block; color: var(--ink-2); font-size: 13.5px; font-weight: 550; margin-bottom: 4px; }
.empty span { font-size: 12.5px; }

/* ---------------- 选品雷达 ---------------- */

.form-stack { display: flex; flex-direction: column; gap: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }

.idea {
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--panel); overflow: hidden;
  display: flex; flex-direction: column;
  transition: .18s;
}
.idea:hover { box-shadow: var(--shadow-m); border-color: var(--line-2); transform: translateY(-1px); }

/* 设计图区：未出图是渐变概念块，出图后是白底设计稿 */
.idea-shot {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 232px;
  overflow: hidden;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}
.idea-shot.is-empty,
.idea-shot.is-busy {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 14px;
}
.idea-shot .concept {
  position: relative; z-index: 2; color: #fff; font-size: 16px; font-weight: 600;
  letter-spacing: -.01em; text-shadow: 0 1px 10px rgba(0,0,0,.4); line-height: 1.35;
  text-align: center; max-width: 90%;
}
.idea-shot .score-badge {
  position: absolute; top: 9px; right: 9px; z-index: 4;
  color: #fff; font-size: 11px; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.22);
  padding: 2px 7px; border-radius: 6px; backdrop-filter: blur(4px);
}
.idea-shot.has-img { background: #fff; }
.idea-shot.has-img .shot-link { display: block; width: 100%; height: 100%; }
/* 留一点内边距，图案不要顶到卡片边缘，像一张贴在纸上的设计稿 */
.idea-shot.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 12px; }

.shot-gen {
  position: relative; z-index: 3;
  border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.14);
  color: #fff; font-size: 12px; font-weight: 500;
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  backdrop-filter: blur(6px); transition: .15s;
}
.shot-gen:hover { background: rgba(255,255,255,.26); border-color: #fff; }

.shot-tools { position: absolute; right: 8px; bottom: 8px; z-index: 4; display: flex; gap: 5px; }
.shot-btn {
  border: 1px solid var(--line-2); background: rgba(255,255,255,.92);
  color: var(--ink-2); font-size: 11px; padding: 3px 8px; border-radius: 6px;
  cursor: pointer; transition: .15s; backdrop-filter: blur(4px);
}
.shot-btn:hover { color: var(--accent); border-color: var(--accent); }

.shot-hint { position: relative; z-index: 3; color: #fff; font-size: 12px; display: flex; align-items: center; gap: 7px; }
.dot-pulse {
  width: 6px; height: 6px; border-radius: 50%; background: #fff;
  animation: dotPulse 1s ease-in-out infinite;
}
@keyframes dotPulse { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

/* 搜索词：点了就复制，拿去平台搜 */
.kw-row { display: flex; flex-wrap: wrap; gap: 4px; }
.kw {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2);
  font-family: var(--mono); font-size: 10.5px; padding: 2px 7px; border-radius: 5px;
  cursor: pointer; transition: .15s;
}
.kw:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* 平台入口：一眼看出是跳出去看真实数据 */
.idea-links {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 9px; background: var(--bg-deep); border-radius: 8px;
}
.link-row { display: flex; gap: 7px; align-items: flex-start; }
/* 6 个中文字的宽度要留够，否则「看真实竞品」会被压成两行 */
.link-label { flex: 0 0 auto; width: 5.6em; white-space: nowrap; font-size: 10.5px; color: var(--ink-3); line-height: 20px; }
.link-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.link-chip {
  display: inline-flex; align-items: center; gap: 1px;
  font-size: 11px; line-height: 1; color: var(--ink-2); text-decoration: none;
  border: 1px solid var(--line-2); background: var(--panel);
  padding: 4px 7px; border-radius: 5px; transition: .15s;
}
.link-chip i { font-style: normal; opacity: .45; font-size: 9px; }
.link-chip:hover { color: var(--accent); border-color: var(--accent); background: var(--panel); }
.link-chip:hover i { opacity: .9; }

.idea-reason { font-size: 11.5px; color: var(--ink-3); line-height: 1.55; }
.idea-body { padding: 13px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.idea-title { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.idea-title small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.metrics { display: flex; flex-direction: column; gap: 6px; }
.metric { display: grid; grid-template-columns: 44px 1fr 30px; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); }
.metric .bar { height: 4px; border-radius: 3px; background: var(--bg-deep); overflow: hidden; }
.metric .bar i { display: block; height: 100%; border-radius: 3px; background: var(--ink-3); }
.metric .bar i.hi { background: var(--ok); }
.metric .bar i.mid { background: var(--warn); }
.metric .bar i.lo { background: var(--bad); }
.metric b { text-align: right; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.idea-foot { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.idea-price { display: flex; align-items: baseline; gap: 6px; }
.idea-price b { font-size: 16px; font-weight: 620; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.idea-price span { font-size: 11px; color: var(--ink-3); }

/* ---------------- 竞品主图（1688 直抓） ---------------- */
/* 抓回来的图要能和自己的设计图并排看，所以缩略图和对比框都按正方形走 */

.comp-form { display: flex; gap: 6px; align-items: center; }
.comp-form .input { flex: 1; min-width: 0; }
.comp-form .btn { flex: none; }

.comp-list { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }
.comp-item { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--panel-2); overflow: hidden; }

.comp-head { display: flex; gap: 6px; align-items: flex-start; padding: 10px 11px 8px; }
.comp-main { flex: 1; min-width: 0; }
.comp-title { font-size: 12.5px; font-weight: 550; line-height: 1.45; letter-spacing: -.01em; }
.comp-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px;
  margin-top: 3px; font-size: 11px; color: var(--ink-3);
}
.comp-meta span { font-size: 11px; }
.comp-price { font-size: 15px; font-weight: 620; color: var(--accent); font-variant-numeric: tabular-nums; }

.comp-thumbs { display: flex; gap: 6px; padding: 0 11px 11px; overflow-x: auto; }
.comp-thumb {
  width: 68px; height: 68px; flex: none; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: #fff; transition: .15s;
}
.comp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.comp-thumb:hover { border-color: var(--accent); }
.comp-thumb.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.comp-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 12px; padding: 10px; border-radius: var(--r-m);
  background: var(--bg-deep);
}
.cc-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cc-label { font-size: 11px; color: var(--ink-3); }
.cc-frame {
  aspect-ratio: 1 / 1; max-height: 250px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; overflow: hidden; display: grid; place-items: center;
}
.cc-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cc-empty { font-size: 11.5px; color: var(--ink-4); padding: 0 12px; text-align: center; line-height: 1.5; }

/* 用原图重构：输入条 + 结果。虚线框是刻意的——它不是一个独立卡片，
   是「对比」这一步的延伸动作，视觉上要弱于上面那两块对比图。 */
.redo {
  margin-top: 10px; padding: 10px; border-radius: var(--r-m);
  background: var(--bg-deep); border: 1px dashed var(--line);
}
.redo-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.redo-head b { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.redo-head .sub { font-size: 11px; color: var(--ink-3); line-height: 1.55; }
.redo-bar { display: flex; gap: 8px; align-items: center; }
.redo-bar .input { flex: 1; min-width: 0; }
.redo-bar .btn { flex: none; }
.redo-out {
  display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 12px;
  margin-top: 10px; align-items: center;
}
.redo-out .cc-frame { max-height: 196px; }
.redo-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.redo-tip { font-size: 11.5px; color: var(--ink-3); line-height: 1.55; }
/* prompt 通栏放在结果图下面：挤在 176px 的右列里会一行换三次，读不下去 */
.redo-prompt { margin-top: 8px; }
.redo-prompt summary { font-size: 11px; color: var(--ink-4); cursor: pointer; }
.redo-prompt pre {
  margin: 6px 0 0; padding: 8px 9px; border-radius: 7px;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 10.5px; line-height: 1.6; color: var(--ink-3);
  white-space: pre-wrap; word-break: break-word; max-height: 150px; overflow: auto;
}

/* 「测试出图」的预览：只测连通性证明不了能出图，得让人看见真图 */
.img-test-shot {
  margin-top: 10px; width: 180px; aspect-ratio: 1 / 1;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; overflow: hidden;
}
.img-test-shot img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* 生效中的模型名：@cf/xxx 这种长串在 390 宽度下必然要断，
   给它 where 断行 + 前面挂个固定标签，断出来才不会像乱码 */
.act-row { display: flex; gap: 8px; align-items: baseline; margin-top: 2px; }
.act-row > span { flex: none; color: var(--ink-4); font-size: 11px; }
.act-row > code { min-width: 0; overflow-wrap: anywhere; }

/* 抓失败（多半是被滑块拦了）：说明 + 一个能立刻打开原页的出口 */
.comp-fail {
  display: flex; gap: 8px; align-items: center; justify-content: space-between;
  margin-top: 8px; padding: 9px 10px; border-radius: 9px;
  background: var(--bad-soft); border: 1px solid rgba(168, 44, 34, .18);
  font-size: 11.5px; color: var(--ink-2); line-height: 1.5;
}
.comp-fail span { flex: 1; min-width: 0; }
.comp-fail .btn { flex: none; }

.loading-line {
  height: 3px; border-radius: 2px; background: var(--bg-deep); overflow: hidden; position: relative;
}
.loading-line::after {
  content: ""; position: absolute; inset: 0; width: 40%;
  background: var(--accent); border-radius: 2px;
  animation: sweep 1.2s ease-in-out infinite;
}
@keyframes sweep { 0% { left: -40%; } 100% { left: 100%; } }

/* ---------------- 产品图工坊 ---------------- */

.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 328px; gap: 16px; align-items: start; }
.canvas-stage {
  background:
    radial-gradient(600px 320px at 50% 42%, #FFFFFF 0%, #F1EDE5 78%);
  border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 22px; display: flex; align-items: center; justify-content: center;
  min-height: 520px;
}
.canvas-stage canvas {
  max-width: 100%; max-height: 520px; border-radius: 6px;
  box-shadow: 0 20px 46px rgba(27,25,22,.13);
  background: #fff;
}
.panel-stack { display: flex; flex-direction: column; gap: 14px; }
.sec-label {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 8px;
}
/* 上架四步状态条：链接 / 采集 / 认领 / 店铺 */
.flow-gate { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.flow-gate .chip { font-variant-numeric: tabular-nums; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
  transition: .14s; position: relative;
}
.swatch:hover { transform: scale(1.06); }
.swatch.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12), 0 0 0 2px var(--panel); }
.style-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.style-tab {
  padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel); font-size: 12.5px; color: var(--ink-2); cursor: pointer;
}
.style-tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.slider-row { display: grid; grid-template-columns: 46px 1fr 38px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); }
.slider-row input[type=range] { width: 100%; accent-color: var(--accent); }
.slider-row b { text-align: right; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.drop {
  border: 1px dashed var(--line-2); border-radius: var(--r-m);
  padding: 18px; text-align: center; cursor: pointer;
  background: var(--panel-2); transition: .16s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop b { display: block; font-size: 12.5px; font-weight: 550; margin-bottom: 2px; }
.drop span { font-size: 11.5px; color: var(--ink-3); }

/* ---------------- 上架中心 ---------------- */

.connector {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--r-m);
  border: 1px solid var(--line); background: var(--panel);
  font-size: 12.5px; color: var(--ink-2);
}
.connector .ok-dot, .connector .off-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
}
.connector .ok-dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.connector .off-dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }

.pick-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.pick-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.pick-item:last-child { border-bottom: 0; }
.pick-item:hover { background: var(--panel-2); }
.pick-item .p-main { flex: 1; min-width: 0; }
.pick-item .p-main b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item .p-main span { font-size: 11.5px; color: var(--ink-3); }

/* ---------------- Agent 面板 ---------------- */

.agent {
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
  width: var(--agent);
}
.app:not(.agent-open) .agent { display: none; }

.agent-head {
  height: 56px; flex: none; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.agent-head b { font-size: 13px; font-weight: 620; display: block; }
.agent-head span { font-size: 11px; color: var(--ink-4); }

.agent-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.msg { display: flex; gap: 9px; max-width: 100%; }
.msg .m-avatar {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600;
  background: var(--ink); color: #fff;
}
.msg.user { flex-direction: row-reverse; }
.msg.user .m-avatar { background: var(--accent-soft); color: var(--accent-deep); }
.m-body {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 12px;
  font-size: 13px; line-height: 1.62; color: var(--ink);
  max-width: 285px; white-space: pre-wrap; word-break: break-word;
}
.msg.user .m-body { background: var(--ink); color: #fff; border-color: var(--ink); }
.m-body .m-note { display: block; margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }

.plan {
  border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--panel); overflow: hidden; margin-top: 4px;
}
.plan-head {
  padding: 8px 11px; background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); display: flex; justify-content: space-between;
}
.plan ol { margin: 0; padding: 4px 0; list-style: none; }
.plan li {
  padding: 7px 12px 7px 30px; position: relative;
  font-size: 12.5px; line-height: 1.5; border-bottom: 1px solid rgba(0,0,0,.03);
}
.plan li:last-child { border-bottom: 0; }
.plan li::before {
  content: "→"; position: absolute; left: 12px; color: var(--ink-4); font-size: 11px;
}
.plan li .li-res { display: block; font-size: 11.5px; color: var(--ok); margin-top: 2px; }
.plan li .li-res.err { color: var(--bad); }
.plan-foot { padding: 9px 11px; border-top: 1px solid var(--line); display: flex; gap: 7px; justify-content: flex-end; }

.agent-chips { padding: 0 16px 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2);
  font-size: 11.5px; padding: 5px 9px; border-radius: 20px; cursor: pointer;
  transition: .14s;
}
.chip-btn:hover { border-color: var(--ink-3); color: var(--ink); background: var(--panel-2); }

.agent-input {
  flex: none; padding: 12px 14px 14px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; align-items: flex-end;
}
.agent-input textarea {
  flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 10px;
  padding: 9px 11px; font-size: 13px; line-height: 1.5; max-height: 120px;
  outline: none; background: var(--panel-2);
}
.agent-input textarea:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.agent-input .send {
  width: 34px; height: 34px; padding: 0; font-size: 15px; border-radius: 10px; flex: none;
}

.typing { display: inline-flex; gap: 3px; align-items: center; }
.typing i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ---------------- Toast / Modal ---------------- */

.toasts {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  background: var(--ink); color: #fff; padding: 10px 15px;
  border-radius: 10px; font-size: 12.5px; box-shadow: var(--shadow-l);
  animation: toast-in .22s ease; max-width: 340px;
}
.toast.err { background: var(--bad); }
.toast.ok { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

.modal-mask {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(27,25,22,.4); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 480px; max-width: 100%; max-height: 86vh; overflow: auto;
  background: var(--panel); border-radius: var(--r-l); box-shadow: var(--shadow-l);
  animation: pop .2s cubic-bezier(.22,.8,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head { padding: 18px 20px 12px; }
.modal-head h3 { font-size: 15px; font-weight: 620; }
.modal-head p { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.modal-body { padding: 0 20px 6px; }
.modal-foot {
  padding: 14px 20px 18px; display: flex; gap: 8px; justify-content: flex-end;
}

/* 图表 */
.chart { width: 100%; display: block; overflow: visible; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--ink); transition: .2s; }
.chart .bar:hover { fill: var(--accent); }
.chart .bar.accent { fill: var(--accent); }
.chart text { font-size: 9.5px; fill: var(--ink-4); font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; }
.legend div { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.legend i { width: 8px; height: 8px; border-radius: 2px; flex: none; }

.stat-line { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.stat-line:last-child { border-bottom: 0; }
.stat-line span { color: var(--ink-3); }
.stat-line b { font-variant-numeric: tabular-nums; font-weight: 550; }

/* 三步流程条：采集 → 认领 → 发布 */
.steps { display: flex; align-items: center; gap: 0; }
.step { display: flex; align-items: center; gap: 8px; flex: none; }
.step-no {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-4);
}
.step-body { display: flex; flex-direction: column; line-height: 1.25; }
.step-body b { font-size: 12px; font-weight: 560; color: var(--ink-3); }
.step-body span { font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.step.active .step-no { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.step.active .step-body b { color: var(--ink); }
.step.done .step-no { border-color: var(--ok); background: var(--ok); color: #fff; }
.step.done .step-body b { color: var(--ink); }
.step-line { flex: 1; height: 1px; background: var(--line); margin: 0 10px; min-width: 12px; }

.hint {
  font-size: 12px; color: var(--ink-3); line-height: 1.65;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 10px 12px; border-radius: 9px;
}
.hint code, code.inline {
  font-family: var(--mono); font-size: 11.5px;
  background: var(--bg-deep); padding: 1px 5px; border-radius: 4px;
}
.hint.ok { background: #EAF3EE; border-color: #CFE3D7; color: #245C45; }
.hint.warn { background: #FCF3E6; border-color: #F0DCC1; color: #7A5321; }
.muted { color: var(--ink-4); font-style: normal; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0; }
.code-box {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
  background: #1B1916; color: #E8E4DB; padding: 12px 14px; border-radius: 10px;
  overflow: auto; max-height: 240px; white-space: pre-wrap; word-break: break-all;
}

/* 移动端专用元素：桌面上不占位 */
.only-mobile { display: none; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1360px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .g-2-1, .g-1-2, .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .studio-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  :root { --rail: 76px; }
  .brand-text, .nav a > span, .user-meta, .nav .badge { display: none; }
  .nav a { justify-content: center; }
}

/* ---------------- 手机 / 小屏平板 ---------------- */

@media (max-width: 860px) {
  html, body { height: 100dvh; }
  body { overflow-x: hidden; overscroll-behavior-y: none; }

  .only-mobile { display: inline-flex; }

  /* 框架：主内容在上，导航沉到底部成为 Tab Bar */
  .app, .app.agent-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "main" "rail";
  }
  .main { grid-area: main; }
  .rail { grid-area: rail; }

  .rail {
    flex-direction: row;
    align-items: stretch;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 -1px 10px rgba(27, 25, 22, .05);
  }
  .brand, .rail-foot { display: none; }

  .nav { flex-direction: row; align-items: stretch; gap: 0; }
  .nav a {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 6px 2px 5px;
    border-radius: 11px;
    font-size: 10px;
    line-height: 1.1;
    position: relative;
  }
  .nav a > span {
    display: block;
    flex: none;
    max-width: 100%;
    font-size: 10px;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav a .ic { width: auto; font-size: 18px; line-height: 1; }
  .nav a.active { background: var(--accent-soft); color: var(--accent-deep); }
  .nav a.active .ic { color: var(--accent); }
  .nav .badge {
    display: inline-flex;
    position: absolute;
    top: 3px;
    left: 50%;
    margin-left: 3px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    font-size: 9.5px;
    border: 1.5px solid var(--panel);
  }

  /* 顶栏 */
  .topbar {
    height: auto;
    min-height: 54px;
    padding: calc(env(safe-area-inset-top) + 8px) 14px 8px;
    gap: 10px;
  }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title p {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-actions { gap: 6px; flex: none; }
  #seed-btn { display: none; }

  .view { padding: 12px 12px 20px; }
  .view > * + * { margin-top: 12px; }

  /* 控件：字号必须 >=16px，否则 iOS Safari 聚焦时会把整页放大 */
  input, select, textarea, .input, .select, .textarea, .agent-input textarea { font-size: 16px; }
  .input, .select { height: 44px; }
  .textarea { padding: 12px; }
  .btn { height: 42px; padding: 0 16px; font-size: 14px; border-radius: 11px; }
  .btn.tiny { height: 34px; padding: 0 11px; font-size: 12.5px; }
  .btn.sm { height: 38px; font-size: 13.5px; }
  .icon-btn { width: 34px; height: 34px; font-size: 15px; }
  .check { padding: 11px 10px; }
  .check input { width: 18px; height: 18px; }

  /* 栅格：KPI 保留两列，其余单列 */
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .g2, .g3, .g-2-1, .g-1-2, .studio-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .ideas { grid-template-columns: minmax(0, 1fr); }

  .card-head { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .card-body.tight { padding: 10px 12px; }
  .card-foot { padding: 10px 14px; }
  .kpi { padding: 13px 14px; }
  .kpi .k-val { font-size: 22px; }
  .kpi .k-label, .kpi .k-sub { font-size: 11px; }

  /* 表格：横向滚动 + 首列吸附 */
  .card { min-width: 0; }
  .view { overflow-x: hidden; }
  .tbl-wrap {
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .tbl-wrap > .tbl { min-width: 540px; }
  .tbl { font-size: 12.5px; }
  .tbl th, .tbl td { padding: 10px; }
  .tbl-wrap > .tbl thead th:first-child,
  .tbl-wrap > .tbl tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
  }
  .tbl-wrap > .tbl thead th:first-child { background: var(--panel-2); }
  .tbl-wrap > .tbl tbody td:first-child { background: var(--panel); }
  .tbl-wrap > .tbl tbody tr:hover td:first-child { background: var(--panel-2); }

  /* 产品图工坊 */
  .canvas-stage { min-height: 0; padding: 14px; }
  .canvas-stage canvas { max-height: 46dvh; }
  .panel-stack { gap: 12px; }
  .swatch { width: 34px; height: 34px; }
  .style-tab { padding: 9px 13px; }

  /* 三步进度条可横向滚动 */
  .steps { overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }

  /* 竞品主图：手机上弹窗是底部抽屉，缩略图小一点才排得下 4 张 */
  .comp-thumb { width: 58px; height: 58px; }
  .comp-compare { gap: 8px; padding: 8px; }
  .comp-head { padding: 9px 10px 7px; }
  .comp-thumbs { padding: 0 10px 10px; }

  /* 重构结果：手机上一栏放不下 196px 图 + 说明，改成上下叠。
     图定死 200x200，不给它撑满整宽 —— 撑满会吃掉半屏，后面说明要滚下去才看得到 */
  .redo-out { grid-template-columns: 1fr; gap: 8px; justify-items: start; }
  .redo-out .cc-frame { width: 200px; height: 200px; max-height: 200px; }
  .redo { padding: 9px; }

  /* Agent：全屏抽屉 */
  .agent {
    position: fixed;
    inset: 0;
    z-index: 130;
    width: 100%;
    border-left: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: none;
  }
  .agent-head { height: auto; min-height: 54px; padding: 0 16px; }
  .agent-log { padding: 14px; }
  .msg .m-avatar { width: 26px; height: 26px; }
  .m-body { max-width: 78%; font-size: 14px; }
  .agent-chips { padding: 0 14px 8px; }
  .chip-btn { padding: 8px 12px; font-size: 12.5px; }
  .agent-input { padding: 10px 12px 12px; }
  .agent-input textarea { padding: 11px 12px; max-height: 96px; }
  .agent-input .send { width: 42px; height: 42px; font-size: 16px; }

  /* Toast 贴底，避开 Tab Bar */
  .toasts {
    left: 12px;
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    align-items: stretch;
  }
  .toast { max-width: none; padding: 12px 15px; font-size: 13px; }
  /* Agent 全屏时底部 Tab 被盖住，Toast 跟着贴底 */
  body:has(.app.agent-open) .toasts { bottom: calc(12px + env(safe-area-inset-bottom)); }
  /* 弹窗打开时 Toast 改到顶部，避免压住底部按钮 */
  body:has(.modal-mask) .toasts { top: calc(env(safe-area-inset-top) + 10px); bottom: auto; }

  /* Modal：底部弹出层 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal {
    width: 100% !important;
    max-width: 100%;
    max-height: 86dvh;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-up .24s cubic-bezier(.22, .8, .3, 1);
  }
  @keyframes sheet-up { from { transform: translateY(28px); opacity: .5; } }
  .modal-head { padding: 16px 18px 10px; }
  .modal-body { padding: 0 18px 6px; }
  .modal-foot { padding: 12px 18px 16px; }
  .modal-foot .btn { flex: 1; }

  /* 登录门 */
  .gate {
    display: block;
    min-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .gate-side { display: none; }
  .gate-card {
    min-height: 100dvh;
    justify-content: center;
    padding: calc(env(safe-area-inset-top) + 36px) 20px calc(env(safe-area-inset-bottom) + 28px);
    box-shadow: none;
  }
  .gate-lead { font-size: 13px; margin-bottom: 22px; }
  .code-box { font-size: 11px; }
}

/* 超小屏（iPhone SE 及以下 / 折叠屏外屏） */
@media (max-width: 359px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .nav a > span { font-size: 9.5px; }
  .topbar-title p { display: none; }
  .view { padding: 10px 10px 18px; }
  .seg { grid-template-columns: minmax(0, 1fr); }
}
