/* 电商套图工作台 —— 三栏布局，独立于落地页样式 */
:root {
  --st-nav: 212px;
  --st-panel: 344px;
  --st-line: #e8ecf3;
  --st-soft: #f7f9fc;
}

body.st-body { margin: 0; background: #fff; overflow: hidden; }
.studio { display: flex; height: calc(100vh - 57px); min-height: 520px; }
html.embed .studio { height: 100vh; }

/* ---------- 左侧 ---------- */
.st-nav {
  width: var(--st-nav); flex: none; background: #fbfcfe; border-right: 1px solid var(--st-line);
  display: flex; flex-direction: column; padding: 14px 10px; overflow-y: auto;
}
.st-brand { font-size: 13px; font-weight: 800; letter-spacing: .2px; padding: 4px 10px 14px; color: var(--ink); }
.st-brand span { color: var(--brand); }
.st-group { margin-bottom: 14px; }
.st-gt { font-size: 11px; color: #94a3b8; padding: 6px 10px; letter-spacing: .5px; }
.st-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 8px 10px;
  border: 0; border-radius: 9px; background: transparent; font-size: 13px; color: #334155;
  cursor: pointer; font-family: inherit; margin-bottom: 2px; transition: background .12s, color .12s;
}
.st-item span.i { font-size: 15px; width: 18px; text-align: center; flex: none; }
.st-item:hover { background: #eef2f9; }
.st-item.on { background: #e8f0fe; color: var(--brand); font-weight: 700; }
.st-item.dim { color: #b6c0cf; cursor: default; }
.st-item.dim:hover { background: transparent; }
.st-foot { margin-top: auto; padding: 10px; }
.st-foot a { font-size: 12px; color: var(--muted); text-decoration: none; }
.st-foot a:hover { color: var(--brand); }

/* ---------- 中间 ---------- */
.st-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.st-bar {
  height: 52px; flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 18px; border-bottom: 1px solid var(--st-line);
}
.st-crumb { font-size: 14px; font-weight: 700; }
.st-crumb small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; margin-top: -2px; }
.st-bar .grow { flex: 1; }
.st-hint { font-size: 11px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; padding: 3px 8px; border-radius: 999px; }
.st-bar .btn { padding: 6px 12px; font-size: 13px; }
.st-bar .btn:disabled { opacity: .45; cursor: not-allowed; }

.st-body { flex: 1; overflow-y: auto; padding: 18px; }

/* 空态 */
.st-empty { border: 1px dashed #dbe3ef; border-radius: 14px; padding: 44px 24px; text-align: center; color: var(--muted); }
.st-empty h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.st-empty p { margin: 0 0 16px; font-size: 13px; }
/* 空态占满中间区并垂直居中，避免上半屏一小块、下半屏一片白 */
.st-body { display: flex; flex-direction: column; }
.st-body > .st-empty { flex: 1; border: 0; padding: 24px; }
.st-body > .st-empty:not([hidden]) { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.st-empty .st-mock { display: flex; gap: 8px; margin: 22px 0 0; opacity: .9; }
.st-empty .st-mock i {
  display: block; width: 58px; height: 74px; border-radius: 8px; border: 1px solid var(--st-line);
  background: linear-gradient(160deg, #f8fafc 0%, #eef2f7 100%);
}
.st-empty .st-mock i:nth-child(2) { height: 88px; background: linear-gradient(160deg, #f5f8ff 0%, #e6eefc 100%); }
.st-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 460px; margin: 0 auto; }
.st-steps div { background: var(--st-soft); border: 1px solid var(--st-line); border-radius: 10px; padding: 10px 8px; font-size: 12px; }
.st-steps b { display: block; color: var(--brand); font-size: 15px; margin-bottom: 2px; }

/* 结果网格 */
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; }
.st-card { border: 1px solid var(--st-line); border-radius: 12px; overflow: hidden; background: #fff; position: relative; }
.st-card .thumb { width: 100%; display: block; background: #f1f5f9; }
.st-card .meta { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12px; }
.st-card .meta .n { font-weight: 600; }
.st-card .meta .r { color: var(--muted); }
.st-card .meta .sp { flex: 1; }
.st-card .meta a, .st-card .meta button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px;
  padding: 2px 4px; text-decoration: none; font-family: inherit;
}
.st-card .meta a:hover, .st-card .meta button:hover { color: var(--brand); }
.st-card.skel .thumb { background: linear-gradient(100deg, #f1f5f9 30%, #e8eef7 50%, #f1f5f9 70%); background-size: 220% 100%; animation: sh 1.3s infinite; }
@keyframes sh { from { background-position: 120% 0; } to { background-position: -20% 0; } }

/* 文案区 */
.st-copy { margin-top: 20px; border: 1px solid var(--st-line); border-radius: 12px; padding: 16px; background: #fff; }
.st-copy h3 { margin: 0 0 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.st-copy h3 .tag { font-size: 11px; font-weight: 500; color: var(--brand); background: #eff6ff; padding: 2px 7px; border-radius: 6px; }
.st-copy label { display: block; font-size: 11px; color: var(--muted); margin: 10px 0 4px; }
.st-copy input, .st-copy textarea {
  width: 100%; border: 1px solid var(--st-line); border-radius: 9px; padding: 9px 11px;
  font-size: 13px; font-family: inherit; color: var(--ink); background: #fff; line-height: 1.6;
}
.st-copy textarea { resize: vertical; }
.st-copy input:focus, .st-copy textarea:focus { outline: 0; border-color: var(--brand); }
.st-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.st-tags span { font-size: 12px; background: var(--st-soft); border: 1px solid var(--st-line); border-radius: 999px; padding: 2px 9px; color: #475569; }
.st-copy .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.st-copy .actions .btn { padding: 6px 12px; font-size: 12px; }

/* ---------- 右侧参数面板 ---------- */
.st-panel { width: var(--st-panel); flex: none; background: #fbfcfe; border-left: 1px solid var(--st-line); overflow: hidden; display: flex; flex-direction: column; }
.pn-scroll { flex: 1; overflow-y: auto; padding: 16px 16px 20px; overscroll-behavior: contain; }
.pn-sec { margin-bottom: 16px; }
.pn-lb { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.pn-lb .muted { font-weight: 400; color: #94a3b8; font-size: 11px; }
.pn-ai { border: 0; background: #eff6ff; color: var(--brand); font-size: 11px; padding: 3px 8px; border-radius: 6px; cursor: pointer; font-family: inherit; font-weight: 600; }
.pn-ai:hover { background: #dbeafe; }
.pn-sec input[type=text], .pn-sec textarea, .pn-sec select {
  width: 100%; border: 1px solid var(--st-line); border-radius: 9px; padding: 9px 11px;
  font-size: 13px; font-family: inherit; color: var(--ink); background: #fff;
}
.pn-sec textarea { min-height: 74px; resize: vertical; line-height: 1.6; }
.pn-sec select:focus, .pn-sec input:focus, .pn-sec textarea:focus { outline: 0; border-color: var(--brand); }

.pn-drop {
  border: 1px dashed #cfd9e8; border-radius: 10px; background: #fff; text-align: center;
  padding: 18px 10px; cursor: pointer; color: var(--muted); font-size: 12px; transition: border-color .15s, background .15s;
  position: relative; overflow: hidden;
}
.pn-drop:hover, .pn-drop.over { border-color: var(--brand); background: #f8fbff; }
.pn-drop b { display: block; color: var(--ink); font-size: 13px; margin-bottom: 2px; }
.pn-drop img { max-width: 100%; max-height: 130px; border-radius: 8px; display: block; margin: 0 auto; }

.pn-mods { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pn-mod {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--st-line); background: #fff;
  border-radius: 8px; padding: 7px 9px; font-size: 12px; cursor: pointer; color: #475569; user-select: none;
}
.pn-mod input { accent-color: var(--brand); margin: 0; }
.pn-mod.on { border-color: var(--brand); background: #f5f9ff; color: var(--brand); font-weight: 600; }

.pn-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pn-chip {
  border: 1px solid var(--st-line); background: #fff; border-radius: 8px; padding: 6px 11px;
  font-size: 12px; cursor: pointer; color: #475569; font-family: inherit;
}
.pn-chip.on { border-color: var(--brand); background: #eff6ff; color: var(--brand); font-weight: 700; }

.pn-go { flex: none; margin: 0 16px 16px; justify-content: center; padding: 11px; font-size: 14px; }
.pn-go:disabled { opacity: .55; cursor: not-allowed; }
.pn-go[hidden], .btn[hidden] { display: none !important; }
.pn-note { font-size: 11px; color: #94a3b8; line-height: 1.5; margin: 6px 0 0; }

/* ---------- 发布弹窗 ---------- */
.st-modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 120; display: none; align-items: center; justify-content: center; padding: 20px; }
.st-modal.show { display: flex; }
.st-modal .box { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(15,23,42,.28); }
.st-modal .hd { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--st-line); }
.st-modal .hd h3 { margin: 0; font-size: 16px; }
.st-modal .hd .x { margin-left: auto; border: 0; background: transparent; font-size: 18px; color: var(--muted); cursor: pointer; line-height: 1; }
.st-modal .bd { padding: 14px 18px; overflow-y: auto; }
.st-modal .ft { padding: 12px 18px; border-top: 1px solid var(--st-line); display: flex; gap: 8px; flex-wrap: wrap; }
.st-modal .ft .btn { padding: 7px 13px; font-size: 13px; }

.pub-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.pub-row:last-child { border-bottom: 0; }
.pub-row .ic { width: 26px; text-align: center; font-size: 17px; flex: none; }
.pub-row .nm { font-size: 13px; font-weight: 600; }
.pub-row .sub { font-size: 11px; color: var(--muted); }
.pub-row .grow { flex: 1; min-width: 0; }
.pub-row .st { font-size: 11px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pub-row .st.on { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.pub-row .st.off { background: #f8fafc; color: #94a3b8; border: 1px solid #e2e8f0; }
.pub-row .go { border: 1px solid var(--st-line); background: #fff; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.pub-row .go:hover { border-color: var(--brand); color: var(--brand); }
.pub-preview { margin-bottom: 12px; }
.pub-preview label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.pub-preview textarea { width: 100%; min-height: 92px; border: 1px solid var(--st-line); border-radius: 9px; padding: 9px 11px; font-size: 12px; font-family: inherit; line-height: 1.6; resize: vertical; }
.pub-preview .cnt { font-size: 11px; color: #94a3b8; text-align: right; margin-top: 2px; }
.pub-tip { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 11px; padding: 8px 11px; border-radius: 8px; line-height: 1.5; margin-bottom: 12px; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1040px) {
  :root { --st-panel: 300px; --st-nav: 176px; }
}
@media (max-width: 900px) {
  body.st-body { overflow: auto; }
  .studio { flex-direction: column; height: auto; min-height: 0; }
  html.embed .studio { height: auto; }
  .st-nav {
    width: 100%; flex-direction: row; align-items: center; gap: 4px; overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--st-line); padding: 8px 10px;
  }
  .st-brand { display: none; }
  .st-group { display: flex; gap: 4px; margin: 0; }
  .st-gt { display: none; }
  .st-item { width: auto; white-space: nowrap; padding: 6px 11px; font-size: 12px; }
  .st-soon { display: none; }
  .st-foot { display: none; }
  .st-panel { width: 100%; order: 1; border-left: 0; border-bottom: 1px solid var(--st-line); max-height: none; }
  .pn-scroll { padding: 12px 14px 4px; max-height: none; }
  .pn-go { margin: 10px 14px 14px; }
  .st-stage { order: 2; }
  .st-body { padding: 14px; }
  .st-bar { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .st-bar .grow { flex: 1 1 auto; order: 3; width: 100%; }
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .pn-mods { grid-template-columns: 1fr 1fr; }
}
