:root {
  --canvas: #f3f6f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #17211d;
  --ink-2: #34423c;
  --muted: #728079;
  --line: #dfe7e3;
  --line-strong: #ccd8d2;
  --brand: #087f5b;
  --brand-dark: #066246;
  --brand-soft: #eaf7f1;
  --blue: #2563eb;
  --blue-soft: #eef4ff;
  --amber: #b76808;
  --amber-soft: #fff8e8;
  --red: #c83b3b;
  --red-soft: #fff1f1;
  --shadow-sm: 0 1px 2px rgba(20, 40, 31, .04), 0 5px 18px rgba(20, 40, 31, .04);
  --shadow-lg: 0 20px 60px rgba(20, 40, 31, .10);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%, rgba(8, 127, 91, .08), transparent 28rem),
    var(--canvas);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { appearance: none; }

.hidden { display: none !important; }
.break-all { word-break: break-all; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 68px;
  border-bottom: 1px solid rgba(204, 216, 210, .82);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: min(1480px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 22px rgba(8, 127, 91, .22);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-copy { min-width: 0; }
.brand-title { font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.brand-subtitle { margin-top: 1px; color: var(--muted); font-size: 11px; }

.topbar-statuses { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.status-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  color: var(--ink-2);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #9aa7a1; }
.status-chip.is-ready { color: var(--brand-dark); background: var(--brand-soft); border-color: #cae9dc; }
.status-chip.is-ready .status-dot { background: #0da678; box-shadow: 0 0 0 3px rgba(13, 166, 120, .12); }
.status-chip.is-error { color: var(--red); background: var(--red-soft); border-color: #f2cece; }
.status-chip.is-error .status-dot { background: var(--red); }
.status-chip.is-working { color: var(--blue); background: var(--blue-soft); border-color: #d8e4ff; }
.status-chip.is-working .status-dot { background: var(--blue); animation: pulse 1.3s ease infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.app-shell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin-bottom: 18px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--brand); }
.command-hero h1 {
  margin: 0;
  max-width: 820px;
  color: #12201a;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.13;
  letter-spacing: -.04em;
}
.command-hero p { max-width: 760px; margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.hero-actions { display: flex; gap: 10px; }

.section-nav {
  position: sticky;
  top: 76px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  margin: 0 0 18px;
  padding: 7px 10px 7px 14px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(204, 216, 210, .94);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(20, 40, 31, .06);
  backdrop-filter: blur(16px);
}
.section-nav-label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.section-nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(8, 127, 91, .11); }
.section-nav-links { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.section-nav-links::-webkit-scrollbar { display: none; }
.section-nav-link { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 7px 9px; color: var(--muted); border-radius: 8px; font-size: 11px; font-weight: 700; text-decoration: none; transition: color .18s ease, background .18s ease, transform .18s ease; }
.section-nav-link span { color: #9aa7a1; font-size: 9px; font-weight: 800; }
.section-nav-link:hover { color: var(--brand-dark); background: var(--brand-soft); transform: translateY(-1px); }
.section-nav-link.is-active { color: var(--brand-dark); background: var(--brand-soft); }
.section-nav-link.is-active span { color: var(--brand); }

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.pipeline-step {
  position: relative;
  min-height: 88px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 15px;
  overflow: hidden;
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.pipeline-step::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 3px;
  background: var(--brand);
  transition: right .25s ease;
}
.pipeline-step.is-active { background: var(--surface); border-color: #add9ca; box-shadow: var(--shadow-sm); }
.pipeline-step.is-active::after, .pipeline-step.is-complete::after { right: 0; }
.pipeline-step.is-complete { background: var(--brand-soft); }
.pipeline-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 750;
}
.pipeline-step.is-active .pipeline-number,
.pipeline-step.is-complete .pipeline-number { color: #fff; border-color: var(--brand); background: var(--brand); }
.pipeline-title { color: var(--ink); font-size: 13px; font-weight: 750; }
.pipeline-note { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(390px, .72fr);
  gap: 22px;
  align-items: start;
}
.editor-stack, .side-stack { display: grid; gap: 16px; min-width: 0; }
.side-stack { position: sticky; top: 136px; }

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 40, 31, .03), 0 12px 34px rgba(20, 40, 31, .055);
  scroll-margin-top: 138px;
}
.panel-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid #edf1ef;
}
.panel-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.panel-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--brand);
  background: var(--brand-soft);
}
.panel-icon svg { width: 19px; height: 19px; }
.panel-title { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 750; }
.panel-subtitle { margin-top: 3px; color: var(--muted); font-size: 12px; }
.panel-body { padding: 20px; }
.panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.source-warning { margin-top: 8px; padding: 9px 11px; color: #8a5a08; background: #fff8e8; border: 1px solid #ead7a9; border-radius: 9px; line-height: 1.55; }
.source-method {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}
.method-label { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--ink-2); font-size: 12px; font-weight: 750; }
.method-tag { padding: 3px 7px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 6px; font-size: 10px; }
.url-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }

.drop-zone {
  min-height: 156px;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  border: 1.5px dashed #b9cec4;
  border-radius: 13px;
  background: #fff;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.drop-zone:hover, .drop-zone.border-blue-500 { border-color: var(--brand); background: #fbfffd; transform: translateY(-1px); }
.drop-zone.border-emerald-400 { border-color: #0da678; }
.upload-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-soft);
}
.upload-icon svg { width: 22px; height: 22px; }
.drop-title { color: var(--ink-2); font-size: 13px; font-weight: 700; }
.drop-note { margin-top: 5px; color: var(--muted); font-size: 11px; }
#pdf-name { margin: 9px 0 0; color: var(--brand); font-size: 12px; font-weight: 700; word-break: break-all; }

.input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input::placeholder { color: #9ba7a1; }
.input:focus { border-color: #59a98e; box-shadow: 0 0 0 3px rgba(8, 127, 91, .10); }
textarea.input { min-height: 112px; resize: vertical; line-height: 1.7; }
select.input { cursor: pointer; }

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 15px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 7px 16px rgba(8, 127, 91, .16); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: 0 9px 20px rgba(8, 127, 91, .21); }
.btn-soft { color: var(--ink-2); background: #fff; border-color: var(--line-strong); }
.btn-soft:hover:not(:disabled) { border-color: #aebdb6; background: var(--surface-soft); }
.btn-success { color: #fff; background: var(--brand); }
.btn-danger { color: var(--red); background: var(--red-soft); border-color: #f0cccc; }
.btn-danger-solid { color: #fff; background: #c23b3b; }
.btn-wide { min-width: 200px; }
.btn-small { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.btn-icon { width: 42px; padding: 0; }

.progress-wrap { margin-top: 12px; text-align: left; }
.progress-copy { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.progress-track { height: 6px; margin-top: 7px; overflow: hidden; background: #e5ece8; border-radius: 999px; }
.progress-bar { width: 0; height: 100%; background: var(--brand); border-radius: inherit; transition: width .2s ease; }
.progress-stage { margin-top: 6px; color: #95a19b; font-size: 10px; }

.meta-box, .alert-box, .info-box {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-2);
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.65;
}
.alert-box { color: var(--red); border-color: #f0cccc; background: var(--red-soft); }
.alert-title { margin-bottom: 3px; font-weight: 750; }
.info-box { color: #5d4a1b; border-color: #f0dfb8; background: var(--amber-soft); }

.ai-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid #cfe9df;
  border-radius: 14px;
  background: linear-gradient(115deg, #f4fcf8, #fff);
}
.ai-command-title { margin-bottom: 4px; font-size: 14px; font-weight: 750; }
.ai-command-copy { color: var(--muted); font-size: 12px; line-height: 1.65; }
.ai-actions { display: flex; gap: 8px; align-items: center; }
#ai-provider-status { margin-top: 10px; color: var(--muted); font-size: 11px; }
#ai-provider-status.is-ready, #ai-provider-status.text-emerald-700 { color: var(--brand); }
#ai-provider-status.is-error, #ai-provider-status.text-rose-700 { color: var(--red); }
.ai-progress-wrap {
  grid-column: 1 / -1;
  margin-top: 2px;
  padding: 12px 13px 11px;
  border: 1px solid #bfe2d3;
  border-radius: 11px;
  background: linear-gradient(105deg, #f0fbf6, #fbfefd);
}
.ai-progress-wrap.is-complete { border-color: #a8dcc5; background: linear-gradient(105deg, #edf9f2, #fff); }
.ai-progress-wrap.is-complete .ai-progress-bar { background: linear-gradient(90deg, #3d9f78, #087f5b); }
.ai-progress-wrap.is-error { border-color: #efcaca; background: #fff8f8; }
.ai-progress-wrap.is-error .ai-progress-pulse { background: var(--red); animation: none; }
.ai-progress-wrap.is-error .ai-progress-label, .ai-progress-wrap.is-error .ai-progress-stage { color: var(--red); }
.ai-progress-head, .ai-progress-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-progress-label { display: inline-flex; min-width: 0; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12px; font-weight: 750; }
.ai-progress-pulse { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 999px; background: var(--brand); box-shadow: 0 0 0 0 rgba(8,127,91,.25); animation: ai-pulse 1.5s ease-out infinite; }
@keyframes ai-pulse { 70% { box-shadow: 0 0 0 7px rgba(8,127,91,0); } 100% { box-shadow: 0 0 0 0 rgba(8,127,91,0); } }
.ai-progress-meta { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.ai-progress-meta strong { min-width: 34px; color: var(--brand); text-align: right; font-size: 12px; }
.ai-progress-track { height: 8px; margin-top: 9px; overflow: hidden; background: #dfeee7; border-radius: 999px; }
.ai-progress-bar { position: relative; width: 0; height: 100%; overflow: hidden; border-radius: inherit; background: linear-gradient(90deg, #55ae8c, var(--brand)); transition: width .45s ease; }
.ai-progress-bar::after { position: absolute; inset: 0; content: ""; background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,.42) 45%, transparent 70%); transform: translateX(-100%); animation: ai-shimmer 1.8s ease-in-out infinite; }
@keyframes ai-shimmer { to { transform: translateX(100%); } }
.ai-progress-foot { margin-top: 6px; color: #7c9188; font-size: 10px; }
@media (max-width: 520px) {
  .ai-progress-head, .ai-progress-foot { align-items: flex-start; flex-direction: column; gap: 4px; }
  .ai-progress-meta { width: 100%; justify-content: space-between; }
}

.media-uploader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.file-input { min-width: 0; padding: 8px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
.images-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.img-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.img-card.selected { border-color: #49a888; box-shadow: 0 0 0 2px rgba(8, 127, 91, .10); }
.img-card > .relative { position: relative; }
.img-card img { display: block; width: 100%; height: 150px; object-fit: cover; cursor: pointer; background: #eef2f0; }
.img-card .absolute { position: absolute; }
.img-card .top-3 { top: 10px; }
.img-card .left-3 { left: 10px; }
.img-card .right-3 { right: 10px; }
.img-card .p-3 { padding: 12px; }
.img-card .space-y-3 > * + * { margin-top: 10px; }
.img-card .flex { display: flex; }
.img-card .items-center { align-items: center; }
.img-card .justify-between { justify-content: space-between; }
.img-card .gap-2 { gap: 8px; }
.img-card .flex-wrap { flex-wrap: wrap; }
.img-card .min-w-0 { min-width: 0; }
.img-card .text-sm { font-size: 12px; }
.img-card .text-xs { font-size: 11px; }
.img-card .font-semibold { font-weight: 700; }
.img-card .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-card .mt-1 { margin-top: 3px; }
.img-card .rounded-full { border-radius: 999px; }
.img-card .bg-slate-900\/75 { color: #fff; background: rgba(23, 33, 29, .78); padding: 3px 7px; font-size: 10px; }
.img-card .text-white { color: #fff; }
.chip { display: inline-flex; align-items: center; padding: 4px 7px; color: var(--ink-2); background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 999px; font-size: 10px; font-weight: 700; }
.img-card .\!bg-emerald-100 { color: var(--brand) !important; background: var(--brand-soft) !important; border-color: #c7e7db !important; }
.img-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.btn-mini { min-height: 30px; padding: 6px 8px; cursor: pointer; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; font-weight: 700; }
.btn-mini:hover { border-color: #aebdb6; }
.btn-mini-danger { color: var(--red); background: var(--red-soft); border-color: #efd0d0; }
.field-block { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.field-block label { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 11px; }
.field-block .input { min-height: 36px; padding: 7px 9px; border-radius: 8px; font-size: 11px; }
.field-block textarea.input { min-height: 90px; }
.field-block.space-y-3 > * + * { margin-top: 8px; }

.editor-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
.editor-tools::before { content: "编辑区"; display: none; color: var(--brand-dark); font-size: 11px; font-weight: 800; }
.autosave-label { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12px; }
.draft-state { color: var(--muted); font-size: 11px; }
.editor-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { display: block; margin-bottom: 7px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.field-hint { float: right; color: #9ba7a1; font-size: 10px; font-weight: 500; }

.more-fields { margin-top: 15px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.more-fields summary { padding: 13px 14px; cursor: pointer; color: var(--ink-2); background: var(--surface-soft); font-size: 12px; font-weight: 700; list-style: none; }
.more-fields summary::-webkit-details-marker { display: none; }
.more-fields summary::after { content: "+"; float: right; color: var(--muted); font-size: 17px; line-height: 14px; }
.more-fields[open] summary::after { content: "−"; }
.more-fields-body { padding: 15px; }
.build-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 14px; color: var(--ink-2); background: var(--brand-soft); border: 1px solid #cee8de; border-radius: 12px; font-size: 12px; }
.build-bar > span { display: flex; align-items: center; gap: 8px; line-height: 1.55; }
.build-bar > span::before { content: "✓"; display: inline-grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; color: #fff; background: var(--brand); border-radius: 50%; font-size: 11px; font-weight: 800; }

.draft-list { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.draft-row { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.draft-row.draft-row-active { border-color: #8ccab4; background: var(--brand-soft); }
.draft-row-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.draft-row-copy { min-width: 0; }
.draft-row-title { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--ink); font-size: 12px; font-weight: 700; }
.draft-row-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-row-meta { margin-top: 4px; color: var(--muted); font-size: 10px; word-break: break-all; }
.draft-row-actions { display: flex; gap: 6px; flex: 0 0 auto; }

.preview-panel .panel-body { padding: 16px; }
.preview-toolbar { display: flex; align-items: center; gap: 7px; }
.device-caption { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.device-caption::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #16a36f; }
.preview-stage {
  min-height: 612px;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 14px;
  background:
    linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,.55)),
    repeating-linear-gradient(45deg, #edf2ef 0, #edf2ef 1px, transparent 1px, transparent 10px);
  border: 1px solid var(--line);
}
.preview-loading { text-align: center; color: var(--muted); font-size: 12px; }
.loader { width: 34px; height: 34px; margin: 0 auto 10px; border: 3px solid #d8e4de; border-top-color: var(--brand); border-radius: 50%; }
.empty-panel { width: 100%; padding: 42px 18px; text-align: center; color: var(--muted); border: 1px dashed #c9d5cf; border-radius: 12px; background: rgba(255,255,255,.72); }
.empty-illustration { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 12px; color: #92a099; background: #eef3f0; border-radius: 16px; }
.empty-illustration svg { width: 26px; height: 26px; }
.empty-title { color: var(--ink-2); font-size: 13px; font-weight: 700; }
.empty-note { margin-top: 5px; font-size: 11px; }

.phone-frame {
  width: min(100%, 390px);
  height: min(720px, calc(100vh - 220px));
  min-height: 560px;
  overflow: hidden;
  background: #fff;
  border: 9px solid #1c2622;
  border-radius: 31px;
  box-shadow: 0 22px 55px rgba(17, 35, 27, .20);
}
.phone-bar { position: relative; height: 45px; display: flex; align-items: flex-end; justify-content: center; padding: 0 14px 10px; color: #59665f; background: #f6f7f6; border-bottom: 1px solid #e6ebe8; font-size: 10px; }
.phone-speaker { position: absolute; top: 8px; left: 50%; width: 78px; height: 5px; margin-left: -39px; border-radius: 999px; background: #26312c; }
.phone-scroll { height: calc(100% - 45px); padding: 18px 17px 30px; overflow-y: auto; overflow-x: hidden; }
.wx-article { min-width: 0; max-width: 100%; overflow: visible; word-break: break-word; overflow-wrap: anywhere; }
.wx-article h1 { font-size: 21px; line-height: 1.38; }
.wx-article h2, .wx-article h3 { margin: 23px 0 10px; color: #213c31; font-size: 17px; line-height: 1.45; }
.wx-article h3 { padding-left: 9px; border-left: 3px solid var(--brand); }
.wx-article p { margin: 8px 0; color: inherit; font-size: inherit; line-height: inherit; }
.wx-article ol, .wx-article ul {
  margin: 10px 0 16px;
  margin-left: 0;
  padding-left: 30px !important;
  padding-inline-start: 30px !important;
  -webkit-padding-start: 30px !important;
  list-style-position: outside !important;
  overflow: visible !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
.wx-article li {
  margin: 7px 0;
  padding-left: 2px;
  color: #333;
  font-size: 14px;
  line-height: 1.72;
  overflow: visible;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.wx-article li::marker { color: var(--brand); font-weight: 700; }
.wx-article img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center;
  margin: 12px auto;
  border-radius: 6px;
  cursor: zoom-in;
}
.image-lightbox { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px; background: rgba(10, 18, 14, .88); }
.image-lightbox-body { width: 100%; height: 100%; display: grid; place-items: center; overflow: auto; }
.image-lightbox-image { display: block; max-width: 96vw; max-height: 94vh; width: auto; height: auto; object-fit: contain; box-shadow: 0 18px 60px rgba(0,0,0,.35); }
.image-lightbox-close { position: absolute; top: 18px; right: 18px; z-index: 1; color: #173b2d; }

.publish-panel { padding: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.publish-panel::before { content: "发布前检查"; display: block; margin-bottom: 11px; color: var(--brand-dark); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.publish-grid { display: grid; gap: 11px; }
.publish-two { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.publish-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-box { margin-top: 12px; padding: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; font-size: 11px; line-height: 1.6; }
.result-box.is-success { color: var(--brand-dark); background: var(--brand-soft); border-color: #c8e5da; }
.result-box.is-error { color: var(--red); background: var(--red-soft); border-color: #f0cccc; }
.result-box pre { max-height: 200px; padding: 9px; overflow: auto; white-space: pre-wrap; color: var(--ink-2); background: rgba(255,255,255,.8); border: 1px solid currentColor; border-radius: 7px; opacity: .85; }

.toast-stack { position: fixed; top: 82px; right: 20px; z-index: 90; width: min(390px, calc(100vw - 40px)); display: grid; gap: 8px; }
.toast { padding: 12px 14px; color: var(--ink-2); background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 12px; line-height: 1.55; }
.toast-success { color: var(--brand-dark); background: #f0fbf6; border-color: #bfe4d5; }
.toast-error { color: var(--red); background: var(--red-soft); border-color: #f0cccc; }
.toast-warn { color: var(--amber); background: var(--amber-soft); border-color: #ead7a9; }

.auth-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 0%, rgba(8, 127, 91, .18), transparent 32rem), rgba(20, 32, 27, .72); backdrop-filter: blur(16px); }
.auth-card { width: min(440px, 100%); padding: 30px; background: rgba(255, 255, 255, .98); border: 1px solid rgba(255,255,255,.78); border-radius: 22px; box-shadow: 0 28px 90px rgba(5, 22, 15, .28); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: var(--brand); border-radius: 13px; box-shadow: 0 10px 24px rgba(8, 127, 91, .24); }
.auth-brand-mark svg { width: 23px; height: 23px; }
.auth-kicker { margin-bottom: 3px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.auth-card h2 { margin: 0; color: var(--ink); font-size: 22px; letter-spacing: -.03em; }
.auth-card p { margin: 16px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.auth-fields { display: grid; gap: 9px; }
.auth-label { color: var(--ink-2); font-size: 12px; font-weight: 750; }
.auth-fields .btn { min-height: 44px; }
.auth-message { margin-top: 11px; padding: 9px 11px; color: var(--red); background: var(--red-soft); border: 1px solid #f0cccc; border-radius: 9px; font-size: 12px; line-height: 1.5; }
.auth-footnote { display: flex; align-items: flex-start; gap: 7px; margin-top: 18px; color: #8a9891; font-size: 11px; line-height: 1.5; }
.auth-lock-dot { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 4px; border-radius: 50%; background: #0da678; box-shadow: 0 0 0 3px rgba(13,166,120,.12); }
.auth-lock-btn { flex: 0 0 auto; min-height: 32px; padding: 6px 11px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; font-size: 12px; font-weight: 700; cursor: pointer; transition: color .18s ease, border-color .18s ease, background .18s ease; }
.auth-lock-btn:hover { color: var(--brand-dark); background: var(--brand-soft); border-color: #add9ca; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 390px; }
  .images-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .topbar { position: static; height: auto; }
  .topbar-inner { min-height: 68px; padding: 10px 0; align-items: flex-start; }
  .brand-subtitle { display: none; }
  .app-shell { padding-top: 22px; }
  .section-nav { top: 12px; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .workspace { grid-template-columns: 1fr; }
  .side-stack { position: static; grid-template-columns: 1fr; }
  .preview-stage { min-height: 520px; }
  .phone-frame { height: 620px; min-height: 0; }
}

@media (max-width: 720px) {
  .topbar-inner, .app-shell { width: min(100% - 24px, 1480px); }
  .topbar { position: sticky; top: 0; }
  .topbar-inner { min-height: 60px; align-items: center; }
  .topbar-statuses { max-width: none; flex-wrap: nowrap; overflow: visible; gap: 6px; }
  .topbar-statuses .status-chip { width: auto; min-width: 35px; min-height: 28px; height: 28px; padding: 0 7px; justify-content: center; font-size: 10px; }
  .topbar-statuses .status-chip span:last-child { display: none; }
  .topbar-statuses #top-ai-status::after { content: "AI"; }
  .topbar-statuses #top-wechat-status::after { content: "微信"; }
  .topbar-statuses #top-draft-status { display: none; }
  .auth-lock-btn { min-height: 28px; padding: 4px 8px; font-size: 10px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .command-hero { grid-template-columns: 1fr; gap: 16px; }
  .hero-actions .btn { width: 100%; }
  .section-nav { position: sticky; top: 68px; align-items: center; flex-direction: row; gap: 7px; margin-bottom: 14px; padding: 7px 8px; }
  .section-nav-label { padding: 0 3px; }
  .section-nav-links { justify-content: flex-start; width: auto; flex: 1 1 auto; }
  .section-nav-link { padding: 7px 8px; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pipeline-step { min-height: 68px; grid-template-columns: 34px minmax(0, 1fr); gap: 9px; padding: 11px; }
  .pipeline-number { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
  .pipeline-title { font-size: 12px; }
  .pipeline-note { font-size: 10px; }
  .source-grid, .fields-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .url-row { grid-template-columns: 1fr; }
  .ai-command { grid-template-columns: 1fr; }
  .ai-actions { flex-direction: column; }
  .ai-actions .btn { width: 100%; }
  .editor-tools { align-items: flex-start; flex-direction: column; }
  .editor-actions { width: 100%; }
  .editor-actions .btn { flex: 1; }
  .build-bar { align-items: stretch; flex-direction: column; }
  .build-bar .btn { width: 100%; }
  .images-grid { grid-template-columns: 1fr; }
  .media-uploader { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .panel-actions { width: 100%; justify-content: flex-start; }
  .preview-stage { min-height: 500px; padding: 10px; }
  .phone-frame { width: min(100%, 390px); height: 610px; border-width: 7px; border-radius: 25px; }
  .publish-two, .publish-actions { grid-template-columns: 1fr; }
  .draft-row-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .topbar-inner { width: calc(100% - 20px); }
  .section-nav-label { width: 10px; overflow: hidden; font-size: 0; }
  .section-nav-dot { width: 6px; height: 6px; }
  .brand-title { font-size: 14px; }
  .command-hero h1 { font-size: 28px; }
  .panel-body, .panel-head { padding: 14px; }
  .source-method { padding: 12px; }
  .command-hero h1 { font-size: 27px; }
  .command-hero p { font-size: 13px; line-height: 1.7; }
  .pipeline-step { min-height: 64px; padding: 10px; }
  .panel { border-radius: 15px; }
  .panel-title { font-size: 15px; }
  .panel-subtitle { font-size: 11px; }
  .build-bar { padding: 12px; }
}
