:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #635bff;
  --primary-2: #1d4ed8;
  --cyan: #06b6d4;
  --green: #16a34a;
  --orange: #f97316;
  --red: #ef4444;
  --shadow: 0 24px 60px rgba(15, 23, 42, .10);
  --radius: 22px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: radial-gradient(circle at 20% 0%, rgba(99, 91, 255, .14), transparent 30%),
              radial-gradient(circle at 85% 18%, rgba(6, 182, 212, .12), transparent 25%),
              var(--bg);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button {
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 14px;
  background: var(--panel-2);
  color: var(--ink);
  transition: .18s ease;
}
button:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(15, 23, 42, .10); }
button:active { transform: translateY(0); box-shadow: none; }
button.primary,
.primary {
  background: linear-gradient(135deg, var(--primary), #24b4ff);
  color: white;
  font-weight: 750;
}
button.ghost { background: white; border: 1px solid var(--line); color: var(--muted); }
button.danger { background: rgba(239, 68, 68, .10); color: #b91c1c; }
button.dark { background: #0f172a; color: white; }
button.small { padding: 7px 10px; font-size: 12px; border-radius: 10px; }
button.icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
button.active { background: #111827; color: white; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
}
textarea { resize: vertical; min-height: 120px; }
label { color: var(--muted); font-size: 13px; font-weight: 650; }

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  background: rgba(255, 255, 255, .76);
  border-right: 1px solid rgba(226, 232, 240, .8);
  backdrop-filter: blur(18px);
}
.brand { display: flex; gap: 12px; align-items: center; padding: 8px 10px 20px; }
.brand-mark {
  width: 44px; height: 44px;
  display: block;
  object-fit: cover;
  padding: 2px;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(99, 91, 255, .26);
}
.brand strong { display: block; font-size: 18px; }
.brand em { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-style: normal; }
.main-nav { display: grid; gap: 8px; }
.main-nav a {
  padding: 13px 14px;
  border-radius: 15px;
  color: #475569;
  font-size: 14px;
  font-weight: 750;
}
.main-nav a:hover,
.main-nav a.active {
  color: white;
  background: linear-gradient(135deg, #111827, #334155);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
}
.sidebar-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, white, #f8fafc);
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 800;
}
.pill.green { background: rgba(22, 163, 74, .10); color: #15803d; }
.pill.orange { background: rgba(249, 115, 22, .12); color: #c2410c; }
.pill.gray { background: #f1f5f9; color: #475569; }
.pill.cyan { background: rgba(6, 182, 212, .12); color: #0e7490; }

.shell { padding: 24px; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -.03em; }
h3 { margin: 0 0 8px; font-size: 17px; }
p { margin: 0; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.view { min-height: calc(100vh - 120px); }

.hero {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border-radius: 30px;
  background: linear-gradient(135deg, #101827, #273549 56%, #635bff);
  color: white;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute; inset: auto -90px -160px auto;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) .8fr; gap: 20px; align-items: center; position: relative; z-index: 1; }
.hero h2 { font-size: 42px; line-height: 1.12; margin-bottom: 16px; }
.hero p { color: rgba(255,255,255,.78); line-height: 1.8; max-width: 780px; }
.hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.hero-actions .ghost { background: rgba(255,255,255,.10); color: white; border-color: rgba(255,255,255,.2); }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.metric {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(12px);
}
.metric strong { display: block; font-size: 26px; margin-bottom: 5px; }
.metric span { color: rgba(255,255,255,.72); font-size: 12px; }

.section { margin-top: 18px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  padding: 20px;
  border: 1px solid rgba(226, 232, 240, .92);
  border-radius: var(--radius);
  background: rgba(255,255,255,.86);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .06);
}
.card.hover:hover { transform: translateY(-3px); transition: .18s ease; box-shadow: var(--shadow); }
.card-title { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.card-icon { font-size: 28px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: #f1f5f9; }
.card p, .muted { color: var(--muted); line-height: 1.75; }
.feature-list { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.feature-list li { color: #334155; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.feature-list li::before { content: "✓"; color: var(--green); font-weight: 900; }

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.module-head p { color: var(--muted); line-height: 1.7; max-width: 840px; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }

.design-layout {
  display: grid;
  grid-template-columns: 72px minmax(600px, 1fr) 310px;
  gap: 14px;
  min-height: calc(100vh - 140px);
}
.tool-rail,
.inspector,
.canvas-stage,
.workspace-top {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.90);
  border-radius: 22px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .06);
}
.tool-rail { padding: 12px; display: flex; flex-direction: column; gap: 9px; align-items: center; }

/* === #agent（梦图排版助手）表单布局 === */
/* 单栏居中卡片布局：agent 页面只有输入表单，不再嵌套画布工作区（画布编辑在 #design 独立完成）。 */
.agent-layout {
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 140px);
  padding: 24px 0;
}
.agent-input {
  width: 100%;
  max-width: 1280px;
  max-height: none;
  overflow: visible;
  padding: 20px;
  border: 1px solid rgba(226, 232, 240, .92);
  border-radius: 22px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .06);
}
.agent-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 28px;
}
.agent-form-col {
  min-width: 0;
}
@media (min-width: 1100px) {
  .agent-form-grid { grid-template-columns: 1fr 1fr; }
}

.agent-intro-block h3 { margin-bottom: 4px; }
.agent-hint-note { font-size: 12px; color: var(--muted); }
.agent-hint-note a { color: var(--primary-2); text-decoration: underline; }

.seg-group-lg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg-lg {
  padding: 14px 10px;
  font-size: 14px;
  font-weight: 650;
  border-radius: 14px;
  background: #f8fafc;
  border: 2px solid var(--line);
  color: var(--ink);
}
.seg-lg.active { border-color: var(--primary); background: #eef2ff; color: var(--primary-2); }

.radio-group { display: grid; gap: 10px; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 14px;
}
.radio-option input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); }
.radio-option small { display: block; color: var(--muted); font-weight: 400; }

.checkbox-group { display: grid; gap: 10px; }
.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}
.checkbox-option input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.checkbox-option small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }

.dashed-btn {
  width: 100%;
  padding: 10px;
  border: 1px dashed #94a3b8;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
}
.dashed-btn:hover { border-color: var(--primary); color: var(--primary-2); }

.brand-color-list { display: grid; gap: 8px; }
.brand-color-row { display: flex; align-items: center; gap: 8px; }
.brand-color-input { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; }

.text-link { color: var(--primary-2); font-size: 13px; text-decoration: underline; cursor: pointer; }

.paste-upload-zone {
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 16px;
  padding: 22px 16px;
  text-align: center;
  cursor: text;
}
.paste-upload-zone:focus { outline: 2px solid rgba(99, 91, 255, .35); }
.paste-upload-icon { font-size: 26px; margin-bottom: 6px; }
.paste-upload-zone p { margin: 4px 0 0; font-size: 12px; }

.agent-health-line { font-size: 12px; margin: 6px 0 0; }

.agent-actions { display: flex; flex-direction: column; gap: 10px; }
.agent-start-btn { width: 100%; padding: 14px; font-size: 15px; }
.agent-beautify-btn { width: 100%; }

.agent-float-actions {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.agent-float-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 20px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 30px rgba(99, 91, 255, .35);
}

.agent-intro-modal .intro-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.intro-compare-card { padding: 14px; border-radius: 14px; }
.intro-compare-card.good { background: rgba(22, 163, 74, .08); border: 1px solid rgba(22, 163, 74, .25); }
.intro-compare-card.bad { background: rgba(239, 68, 68, .08); border: 1px solid rgba(239, 68, 68, .25); }
.intro-compare-card strong { display: block; margin-bottom: 6px; }
.agent-intro-tip { font-size: 13px; color: var(--muted); }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.workspace {
  display: grid;
  grid-template-rows: auto minmax(520px, 1fr);
  gap: 12px;
  min-width: 0;
}
.workspace-top { padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.workspace-top .left, .workspace-top .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.canvas-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: #f8fafc;
  background-image: linear-gradient(#e8eef7 1px, transparent 1px), linear-gradient(90deg, #e8eef7 1px, transparent 1px);
  background-size: 28px 28px;
}
.canvas-shell {
  background: white;
  border-radius: 2px;
  box-shadow: 0 25px 80px rgba(15, 23, 42, .20);
}
.canvas-hint {
  position: absolute;
  left: 18px;
  bottom: 18px;
  color: #475569;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  backdrop-filter: blur(10px);
}
.inspector { padding: 16px; overflow: auto; max-height: calc(100vh - 140px); }
.panel-block { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-block:last-child { border-bottom: 0; margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-row { display: grid; gap: 7px; margin-bottom: 10px; }
.layer-list { display: grid; gap: 8px; }
.layer-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 12px;
  font-size: 13px;
}
.layer-item.active { background: #eef2ff; border-color: rgba(99, 91, 255, .35); }
.layer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.layer-actions { display: flex; gap: 4px; }
.layer-actions button { width: 26px; height: 26px; padding: 0; font-size: 12px; border-radius: 8px; }

.ai-panel { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 16px; }
.prompt-card textarea { min-height: 190px; }
.option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.option {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f8fafc;
  cursor: pointer;
}
.option.active { border-color: rgba(99, 91, 255, .45); background: #eef2ff; }
.result-preview {
  min-height: 410px;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
}
.generated-card {
  width: min(92%, 620px);
  aspect-ratio: 16/9;
  border-radius: 28px;
  padding: 34px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.35), transparent 20%), linear-gradient(135deg, #635bff, #06b6d4 55%, #16a34a);
  box-shadow: 0 30px 70px rgba(99, 91, 255, .25);
}
.generated-card h3 { font-size: 34px; margin: 0 0 8px; }
.generated-card p { color: rgba(255,255,255,.82); }

.tool-card { display: flex; flex-direction: column; min-height: 230px; }
.tool-card .actions-row { margin-top: auto; }
.upload-zone {
  min-height: 150px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 18px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 20px;
}
.task-log { display: grid; gap: 8px; max-height: 280px; overflow: auto; }
.task-item { padding: 10px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); font-size: 13px; color: #334155; }

.template-card { overflow: hidden; padding: 0; }
.template-thumb {
  height: 176px;
  display: flex;
  align-items: flex-end;
  padding: 18px;
  color: white;
  background: linear-gradient(135deg, #111827, #635bff);
  position: relative;
}
.template-thumb::before {
  content: "";
  position: absolute; width: 120px; height: 120px; border-radius: 50%; right: -24px; top: -32px; background: rgba(255,255,255,.16);
}
.template-thumb strong { position: relative; z-index: 1; font-size: 22px; }
.template-body { padding: 16px; }
.template-body .actions-row { margin-top: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters button.active { background: var(--primary); color: white; }

.account-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; }
.balance {
  padding: 24px;
  border-radius: 24px;
  color: white;
  background: linear-gradient(135deg, #111827, #635bff);
}
.balance strong { font-size: 44px; display: block; margin: 12px 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.status-dot { width: 9px; height: 9px; display: inline-block; border-radius: 99px; background: var(--green); margin-right: 7px; }
.status-dot.orange { background: var(--orange); }
.status-dot.gray { background: #94a3b8; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, .45);
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal {
  width: min(760px, 100%);
  max-height: 84vh;
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  background: white;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
}
/* 弹窗/agent 输入卡片背景是白色，但站点全局是深色主题变量，这里局部覆盖成深色文字避免白底白字 */
.modal,
.agent-input {
  --ink: #0f172a;
  --muted: rgba(15, 23, 42, .62);
  --line: rgba(15, 23, 42, .14);
  color: var(--ink);
}
.modal button.ghost,
.agent-input button.ghost {
  background: rgba(15, 23, 42, .05);
  border-color: rgba(15, 23, 42, .14);
  color: var(--muted);
}
/* h1/h2/h3 全局是硬编码近白色（非变量），弹窗/agent 卡片标题需要单独覆盖，否则白底白字 */
.modal h1,
.modal h2,
.modal h3,
.agent-input h1,
.agent-input h2,
.agent-input h3 {
  color: var(--ink);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.roadmap { display: grid; gap: 10px; }
.roadmap-item { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 16px;
  color: white;
  background: rgba(15, 23, 42, .94);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .22);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

.hidden { display: none !important; }
.mt { margin-top: 16px; }

@media (max-width: 1180px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .design-layout { grid-template-columns: 62px minmax(0, 1fr); }
  .inspector { grid-column: 1 / -1; max-height: none; }
  .ai-panel, .account-grid, .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { padding: 14px; }
  .topbar, .module-head { align-items: stretch; flex-direction: column; }
  .main-nav { grid-template-columns: 1fr; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .hero { padding: 24px; }
  .hero h2 { font-size: 30px; }
  .design-layout { grid-template-columns: 1fr; }
  .agent-layout { padding: 12px 0; }
  .tool-rail { flex-direction: row; overflow: auto; }
  .option-grid { grid-template-columns: 1fr; }
}

/* === 梦图风格动效增强层：深色玻璃、环境光、鼠标追光、入场动画 === */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(36px) scale(.96); filter: blur(12px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes orbFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(42px, -54px, 0) scale(1.12); }
  66% { transform: translate3d(-28px, 34px, 0) scale(.92); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes gridDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-56px, -56px, 0); }
}
@keyframes shimmer {
  0% { transform: translateX(-130%) skewX(-18deg); opacity: 0; }
  20% { opacity: .65; }
  55%, 100% { transform: translateX(160%) skewX(-18deg); opacity: 0; }
}
@keyframes floatPreview {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-14px) rotate(1deg); }
}
@keyframes pulseRing {
  0% { transform: scale(.9); opacity: .75; }
  100% { transform: scale(1.45); opacity: 0; }
}
@keyframes marqueeX {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

:root {
  --bg: #06070a;
  --panel: rgba(18, 20, 28, .78);
  --panel-2: rgba(255, 255, 255, .06);
  --ink: #f5f7fb;
  --muted: rgba(245, 247, 251, .62);
  --line: rgba(255, 255, 255, .10);
  --primary: #7aa2ff;
  --primary-2: #8fb1ff;
  --cyan: #22d3ee;
  --green: #34d399;
  --shadow: 0 28px 90px rgba(0, 0, 0, .42);
  color-scheme: dark;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% -10%, rgba(122, 162, 255, .22), transparent 31%),
    radial-gradient(circle at 86% 12%, rgba(34, 211, 238, .12), transparent 20%),
    radial-gradient(circle at 48% 105%, rgba(124, 58, 237, .14), transparent 28%),
    linear-gradient(180deg, #0a0b10 0%, #07080c 34%, #06070a 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 72%);
  animation: gridDrift 16s linear infinite;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.08), transparent 22%);
  mix-blend-mode: screen;
}

#app {
  position: relative;
  z-index: 2;
}
.fx-bg, .particle-canvas, .mouse-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.fx-bg { z-index: 0; overflow: hidden; }
.particle-canvas { z-index: 1; opacity: .56; }
.mouse-glow {
  z-index: 1;
  width: 520px;
  height: 520px;
  inset: auto;
  left: var(--mx, 50%);
  top: var(--my, 50%);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(122, 162, 255, .16), rgba(34, 211, 238, .07) 34%, transparent 66%);
  filter: blur(8px);
  opacity: .72;
  transition: opacity .24s ease;
}
.ambient-orb {
  position: absolute;
  display: block;
  border-radius: 999px;
  filter: blur(90px);
  opacity: .42;
  animation: orbFloat 13s ease-in-out infinite;
}
.orb-one { width: 360px; height: 360px; top: 72px; left: -120px; background: rgba(122, 162, 255, .34); }
.orb-two { width: 320px; height: 320px; top: 360px; right: -130px; background: rgba(34, 211, 238, .22); animation-delay: -4s; }
.orb-three { width: 280px; height: 280px; bottom: -90px; left: 42%; background: rgba(168, 85, 247, .22); animation-delay: -8s; }
.grid-glow {
  position: absolute;
  width: 70vw;
  height: 70vw;
  left: 18%;
  top: -34%;
  border-radius: 50%;
  background: conic-gradient(from 90deg, transparent, rgba(122,162,255,.12), transparent, rgba(34,211,238,.10), transparent);
  filter: blur(50px);
  opacity: .42;
  animation: gradientShift 18s ease infinite;
}

.sidebar {
  background: rgba(8, 10, 14, .66);
  border-right-color: rgba(255,255,255,.08);
  backdrop-filter: blur(26px) saturate(130%);
  box-shadow: 10px 0 60px rgba(0,0,0,.18);
}
.brand-mark {
  background: #fff;
  box-shadow: 0 16px 34px rgba(122, 162, 255, .28);
}
.brand strong, h1, h2, h3 { color: #f5f7fb; }
.brand em, .eyebrow, .muted, .card p, .module-head p { color: rgba(245, 247, 251, .62); }
.main-nav a { color: rgba(245, 247, 251, .66); border: 1px solid transparent; }
.main-nav a:hover,
.main-nav a.active {
  color: #07111f;
  background: linear-gradient(180deg, #ffffff 0%, #dce7ff 100%);
  border-color: rgba(255,255,255,.36);
  box-shadow: 0 18px 36px rgba(122, 162, 255, .18);
}
.sidebar-card,
.card,
.tool-rail,
.inspector,
.workspace-top,
.canvas-stage {
  position: relative;
  background: rgba(18, 20, 28, .72);
  border-color: rgba(255,255,255,.10);
  backdrop-filter: blur(22px) saturate(130%);
  box-shadow: 0 26px 70px rgba(0,0,0,.30);
}
.card,
.hero,
.workspace-top,
.tool-rail,
.inspector,
.balance,
.template-card,
.sidebar-card {
  overflow: hidden;
}
.card::before,
.hero::before,
.workspace-top::before,
.tool-rail::before,
.inspector::before,
.balance::before,
.sidebar-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.13), transparent 28%);
  opacity: 0;
  transition: opacity .22s ease;
}
.card:hover::before,
.hero:hover::before,
.workspace-top:hover::before,
.tool-rail:hover::before,
.inspector:hover::before,
.balance:hover::before,
.sidebar-card:hover::before { opacity: 1; }
.card.hover:hover {
  transform: translateY(-7px) scale(1.01);
  box-shadow: 0 34px 90px rgba(0,0,0,.42), 0 0 0 1px rgba(122,162,255,.18) inset;
}

button,
input,
select,
textarea {
  background: rgba(255,255,255,.07);
  color: #f5f7fb;
  border-color: rgba(255,255,255,.10);
}
button.ghost {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: rgba(245,247,251,.72);
}
button.primary,
.primary {
  position: relative;
  overflow: hidden;
  color: #07111f;
  background: linear-gradient(100deg, #ffffff 0%, #dce7ff 45%, #9bdcff 100%);
  box-shadow: 0 16px 30px rgba(122,162,255,.20);
}
button.primary::after,
.primary::after {
  content: "";
  position: absolute;
  top: -30%; bottom: -30%;
  width: 38%;
  left: -48%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.78), transparent);
  animation: shimmer 3.6s ease-in-out infinite;
}
button.dark { background: rgba(255,255,255,.88); color: #07111f; }
button.active { background: linear-gradient(180deg, #ffffff, #dce7ff); color: #07111f; }
input:focus,
select:focus,
textarea:focus { box-shadow: 0 0 0 3px rgba(122,162,255,.18); border-color: rgba(122,162,255,.45); }
label { color: rgba(245,247,251,.66); }

/* 弹窗/agent 卡片内的 .muted / label 文字会被上面全局深色主题的硬编码近白色规则覆盖，这里放在其后以更高源码顺序覆盖回深色 */
.modal .muted,
.modal .card p,
.modal .module-head p,
.modal label,
.agent-input .muted,
.agent-input .card p,
.agent-input .module-head p,
.agent-input label {
  color: var(--muted);
}

.hero {
  min-height: 430px;
  background:
    radial-gradient(circle at var(--mx, 62%) var(--my, 35%), rgba(255,255,255,.18), transparent 23%),
    linear-gradient(135deg, rgba(18,20,28,.88), rgba(28,35,54,.80) 46%, rgba(122,162,255,.36));
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(24px) saturate(130%);
}
.hero h2 {
  background: linear-gradient(100deg, #ffffff, #dce7ff 45%, #7dd3fc 80%, #ffffff);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 8s ease infinite;
}
.hero .metric {
  position: relative;
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.12);
  transition: .24s ease;
}
.hero .metric:hover { transform: translateY(-6px); background: rgba(255,255,255,.12); }
.hero .metric strong { color: #fff; }
.hero .metric::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  right: 14px; top: 14px;
  border-radius: 50%;
  background: #7aa2ff;
  box-shadow: 0 0 0 0 rgba(122,162,255,.36);
  animation: pulseRing 1.9s ease-out infinite;
}
.hero-product-preview {
  position: relative;
  min-height: 320px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(20px);
  box-shadow: 0 34px 90px rgba(0,0,0,.34);
  animation: floatPreview 6s ease-in-out infinite;
  transform-style: preserve-3d;
  overflow: hidden;
}
.hero-product-preview::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(120deg, rgba(255,255,255,.22), transparent 24%, rgba(122,162,255,.22) 56%, transparent 78%);
}
.hero-product-preview .preview-toolbar {
  position: absolute;
  left: 18px; right: 18px; top: 18px;
  height: 42px;
  border-radius: 999px;
  background: rgba(8,10,14,.56);
  border: 1px solid rgba(255,255,255,.10);
}
.hero-product-preview .preview-card {
  position: absolute;
  left: 34px; right: 34px; top: 82px; bottom: 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(220,231,255,.86));
  transform: translateZ(48px);
  overflow: hidden;
}
.hero-product-preview .preview-card::before {
  content: "AI VECTOR";
  position: absolute;
  left: 28px; top: 30px;
  color: #07111f;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -.04em;
}
.hero-product-preview .preview-card::after {
  content: "";
  position: absolute;
  right: 32px; bottom: 30px;
  width: 158px; height: 158px;
  border-radius: 42px;
  background: linear-gradient(135deg, #7aa2ff, #22d3ee);
  box-shadow: -120px -56px 0 -26px #111827, -210px 60px 0 -42px #7c3aed;
}

.feature-list li { color: rgba(245,247,251,.78); }
.card-icon { background: rgba(255,255,255,.07); box-shadow: 0 16px 36px rgba(0,0,0,.18); }
.pill.gray { background: rgba(255,255,255,.08); color: rgba(245,247,251,.72); }
.pill.green { background: rgba(52,211,153,.13); color: #86efac; }
.pill.orange { background: rgba(251,146,60,.13); color: #fdba74; }
.pill.cyan { background: rgba(34,211,238,.13); color: #67e8f9; }

.canvas-stage {
  background-color: rgba(15,23,42,.62);
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
}
.canvas-shell { background: #fff; }
.canvas-hint { background: rgba(8,10,14,.72); color: rgba(245,247,251,.68); border-color: rgba(255,255,255,.10); }
.layer-item,
.option,
.upload-zone,
.task-item {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.10);
  color: rgba(245,247,251,.78);
}
.layer-item.active,
.option.active {
  background: rgba(122,162,255,.16);
  border-color: rgba(122,162,255,.42);
}
.seg-lg,
.radio-option,
.paste-upload-zone,
.dashed-btn {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.10);
  color: rgba(245,247,251,.78);
}
.seg-lg.active {
  background: rgba(122,162,255,.16);
  border-color: rgba(122,162,255,.42);
  color: #dbe6ff;
}
.intro-compare-card.good { background: rgba(52,211,153,.10); border-color: rgba(52,211,153,.32); }
.intro-compare-card.bad { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.32); }
.brand-color-row .ghost { background: rgba(255,255,255,.06); }

.result-preview {
  border-color: rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 50% 0%, rgba(122,162,255,.18), transparent 42%),
    rgba(255,255,255,.045);
}
.generated-card {
  animation: heroReveal .7s cubic-bezier(.16, 1, .3, 1) both, floatPreview 6s ease-in-out infinite .8s;
}
.template-thumb { background-size: 180% 180% !important; animation: gradientShift 8s ease infinite; }
.balance { background: linear-gradient(135deg, rgba(18,20,28,.88), rgba(122,162,255,.30)); border: 1px solid rgba(255,255,255,.12); }
.table th, .table td { border-color: rgba(255,255,255,.10); }

.reveal-in {
  opacity: 0;
  animation: heroReveal .9s cubic-bezier(.16, 1, .3, 1) forwards;
}
.reveal-delay-1 { animation-delay: .06s; }
.reveal-delay-2 { animation-delay: .12s; }
.reveal-delay-3 { animation-delay: .18s; }
.reveal-delay-4 { animation-delay: .24s; }
.reveal-delay-5 { animation-delay: .30s; }

.marquee-strip {
  margin-top: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.09);
  background: rgba(255,255,255,.045);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.marquee-inner {
  display: flex;
  width: max-content;
  gap: 10px;
  padding: 12px 0;
  animation: marqueeX 22s linear infinite;
}
.marquee-inner span {
  display: inline-flex;
  padding: 8px 13px;
  border-radius: 999px;
  color: rgba(245,247,251,.72);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .particle-canvas, .mouse-glow, .fx-bg { display: none; }
}

/* === 性能优化 + 文字淡入缩放动效 === */
@keyframes textFadeScaleIn {
  0% { opacity: 0; transform: translateY(24px) scale(.92); filter: blur(10px); }
  62% { opacity: 1; transform: translateY(-2px) scale(1.018); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes textSoftBreath {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .86; transform: scale(.985); }
}
@keyframes textGlowSweep {
  0% { background-position: 0% 50%; }
  45% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.text-anim {
  opacity: 0;
  transform-origin: 50% 60%;
  animation: textFadeScaleIn .86s cubic-bezier(.16, 1, .3, 1) forwards;
  animation-delay: var(--text-delay, 0ms);
  will-change: opacity, transform;
}
.text-anim-soft {
  animation: textFadeScaleIn .9s cubic-bezier(.16, 1, .3, 1) forwards,
             textSoftBreath 5.8s ease-in-out 1.2s infinite;
}
.hero h2.text-anim,
.module-head h2.text-anim,
.topbar h1.text-anim {
  background: linear-gradient(100deg, #ffffff 0%, #dce7ff 32%, #7dd3fc 58%, #ffffff 82%);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textFadeScaleIn .9s cubic-bezier(.16, 1, .3, 1) forwards,
             textGlowSweep 6.8s ease-in-out 1s infinite;
}
.hero-actions .text-anim,
.actions-row .text-anim,
.top-actions .text-anim {
  display: inline-flex;
}

/* 把重动效降级，手机优先流畅 */
.card,
.hero,
.workspace-top,
.tool-rail,
.inspector,
.balance,
.sidebar-card {
  will-change: transform, opacity;
}
.particle-canvas {
  opacity: .30;
}
.mouse-glow {
  opacity: .42;
}
.ambient-orb {
  filter: blur(64px);
  opacity: .30;
}
.card:hover::before,
.hero:hover::before,
.workspace-top:hover::before,
.tool-rail:hover::before,
.inspector:hover::before,
.balance:hover::before,
.sidebar-card:hover::before {
  opacity: .62;
}

@media (hover: none), (pointer: coarse) {
  .mouse-glow { display: none; }
  .card:hover::before,
  .hero:hover::before,
  .workspace-top:hover::before,
  .tool-rail:hover::before,
  .inspector:hover::before,
  .balance:hover::before,
  .sidebar-card:hover::before { opacity: 0; }
}

@media (max-width: 760px) {
  .particle-canvas { display: none; }
  .ambient-orb { filter: blur(38px); opacity: .20; animation-duration: 20s; }
  .grid-glow { display: none; }
  body::before { animation: none; opacity: .38; }
  .sidebar,
  .card,
  .tool-rail,
  .inspector,
  .workspace-top,
  .canvas-stage,
  .modal,
  .sidebar-card {
    backdrop-filter: blur(8px) saturate(112%);
  }
  .card.hover:hover { transform: none; }
  .hero-product-preview { animation-duration: 9s; }
  .marquee-inner { animation-duration: 34s; }
  .text-anim,
  .hero h2.text-anim,
  .module-head h2.text-anim,
  .topbar h1.text-anim {
    animation-duration: .68s, 7s;
  }
}

/* 模板库真实 SVG 预览 */
.template-thumb.svg-thumb {
  position: relative;
  height: 220px;
  padding: 0;
  background: rgba(255,255,255,.045) !important;
  overflow: hidden;
}
.template-thumb.svg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
  transition: transform .35s ease, filter .35s ease;
}
.template-card:hover .template-thumb.svg-thumb img {
  transform: scale(1.065);
  filter: saturate(1.08) contrast(1.04);
}
.template-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8,10,14,.72);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 800;
}
a.template-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
}

/* Paper.js 替换钢笔后的工具状态 */
button.disabled,
button:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
button.disabled::after,
button:disabled::after {
  display: none;
}

.workflow-intro .workflow-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.workflow-embed-card {
  height: calc(100vh - 190px);
  min-height: 680px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px;
  overflow: hidden;
  background: rgba(2,6,23,.55);
  box-shadow: 0 28px 80px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.06);
}
.workflow-embed-card iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #06111f;
}
@media (max-width: 860px) {
  .workflow-embed-card { height: 78vh; min-height: 560px; border-radius: 20px; }
}

/* === 2026-07-03 节点工作流入口改造：醒目大按钮 + 全屏进入 === */
.workflow-enter-btn {
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.workflow-enter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(99,102,241,.5);
}
.workflow-embed-card { position: relative; }
.workflow-fullscreen-hint {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: none !important;
  padding: 9px 16px;
  border-radius: 12px;
  background: rgba(15,23,42,.85);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,.18);
  cursor: pointer;
  backdrop-filter: blur(8px);
  font-size: 13px;
  z-index: 3;
}
.workflow-fullscreen-hint:hover { background: rgba(99,102,241,.9); color:#fff; }

/* 全屏覆盖层 */
.workflow-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #06111f;
}
.workflow-fullscreen iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.workflow-fullscreen-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10000;
  padding: 9px 18px;
  border-radius: 12px;
  background: rgba(15,23,42,.9);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  cursor: pointer;
  backdrop-filter: blur(8px);
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.workflow-fullscreen-close:hover { background: #ef4444; }

/* === 2026-07-02 Agent 页面视觉重构：大面板、左对齐、深色高对比 === */
.agent-head {
  align-items: flex-start;
  margin-bottom: 10px;
}
.agent-head > div {
  display: grid;
  gap: 18px;
}
.agent-head h2 {
  margin: 0;
  color: #8ed8ff;
  letter-spacing: -.02em;
  text-shadow: 0 0 28px rgba(56, 189, 248, .22);
}
.agent-history-btn {
  justify-self: start;
  min-width: 142px;
  min-height: 58px;
  padding: 0 24px !important;
  border-radius: 18px !important;
  font-size: 19px !important;
  font-weight: 850;
  color: #dcecff !important;
  background: linear-gradient(180deg, rgba(37, 52, 78, .82), rgba(21, 31, 49, .78)) !important;
  border: 1px solid rgba(163, 190, 232, .32) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 16px 36px rgba(0,0,0,.22) !important;
}
.agent-history-btn:hover {
  color: #ffffff !important;
  border-color: rgba(125, 211, 252, .55) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 20px 48px rgba(14,165,233,.16) !important;
}

.agent-layout {
  justify-content: stretch;
  align-items: flex-start;
  min-height: auto;
  padding: 16px 0 44px;
}
.agent-input {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 250px);
  padding: clamp(26px, 2.4vw, 44px);
  border-radius: 30px;
  color: #eaf4ff;
  --ink: #f7fbff;
  --muted: #aebdd2;
  --line: rgba(148, 163, 184, .22);
  background:
    radial-gradient(circle at 18% 0%, rgba(59, 130, 246, .18), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(34, 211, 238, .12), transparent 30%),
    linear-gradient(145deg, rgba(13, 23, 39, .96), rgba(9, 15, 27, .94) 58%, rgba(7, 12, 23, .96)) !important;
  border: 1px solid rgba(148, 190, 255, .22) !important;
  box-shadow: 0 34px 100px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255,255,255,.07) !important;
  backdrop-filter: blur(26px) saturate(135%);
}
.agent-form-grid {
  grid-template-columns: minmax(420px, .95fr) minmax(500px, 1.05fr);
  gap: clamp(28px, 3.2vw, 56px);
}
.agent-form-col-left,
.agent-form-col-right {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.agent-input .panel-block {
  margin: 0;
  padding: 0 0 22px;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}
.agent-input .panel-block:last-child { border-bottom: 0; padding-bottom: 0; }
.agent-input h1,
.agent-input h2,
.agent-input h3 {
  color: #f7fbff !important;
  text-shadow: none;
}
.agent-input .agent-intro-block h3 {
  font-size: 24px;
  margin: 0 0 12px;
}
.agent-input .muted,
.agent-input .card p,
.agent-input label,
.agent-input .agent-hint-note,
.agent-input .agent-health-line,
.agent-input small {
  color: #aebdd2 !important;
}
.agent-input .agent-hint-note a,
.agent-input .text-link {
  color: #8ab6ff !important;
  font-weight: 800;
  text-decoration: none;
}
.agent-input .text-link:hover { color: #bfdbfe !important; text-decoration: underline; }

.agent-input button,
.agent-input input,
.agent-input select,
.agent-input textarea {
  color: #f8fbff;
  background: rgba(255,255,255,.07);
  border-color: rgba(148, 163, 184, .20);
}
.agent-input input::placeholder,
.agent-input textarea::placeholder { color: rgba(214, 226, 242, .56); }
.agent-input input:focus,
.agent-input select:focus,
.agent-input textarea:focus {
  border-color: rgba(125, 211, 252, .58) !important;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, .16) !important;
}

.agent-input .seg-group-lg { gap: 14px; }
.agent-input .seg-lg {
  min-height: 76px;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 850;
  color: #d9e8fb !important;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.045)) !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.agent-input .seg-lg.active {
  color: #eff6ff !important;
  background: linear-gradient(135deg, rgba(37, 99, 235, .38), rgba(14, 165, 233, .22)) !important;
  border-color: rgba(147, 197, 253, .68) !important;
  box-shadow: 0 0 0 1px rgba(147,197,253,.18), 0 18px 42px rgba(37,99,235,.18);
}

.agent-input .radio-option,
.agent-input .checkbox-option, {
  color: #eef6ff !important;
  background: rgba(255,255,255,.055) !important;
  border: 1px solid rgba(148, 163, 184, .18) !important;
  border-radius: 18px;
}
.agent-input .radio-option { padding: 18px 20px; }
.agent-input .checkbox-option { padding: 10px 4px; }
.agent-input .radio-option span,
.agent-input .checkbox-option span {
  color: #eef6ff !important;
  font-size: 16px;
  font-weight: 800;
}
.agent-input .radio-option small,
.agent-input .checkbox-option small {
  color: #9fb0c8 !important;
  font-size: 13px;
  font-weight: 500;
}
.agent-input input[type="radio"],
.agent-input input[type="checkbox"] {
  accent-color: #7aa2ff;
}

.agent-input .paste-upload-zone {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-radius: 24px;
  color: #eef6ff !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.04)),
    radial-gradient(circle at 50% 0%, rgba(125, 211, 252, .08), transparent 54%) !important;
  border: 1px dashed rgba(186, 230, 253, .30) !important;
}
.agent-input .paste-upload-zone strong {
  color: #f8fbff !important;
  font-size: 20px;
  text-shadow: 0 1px 16px rgba(125, 211, 252, .12);
}
.agent-input .paste-upload-icon { font-size: 36px; }
.agent-input #agent-prompt {
  min-height: 190px;
  width: 100%;
  font-size: 18px;
  line-height: 1.7;
  border-radius: 22px;
  padding: 20px;
  background: rgba(255,255,255,.07) !important;
}

.agent-input .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.agent-input .tag-pill {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 16px;
  color: #dbeafe !important;
  font-size: 16px;
  font-weight: 800;
  background: rgba(255,255,255,.075) !important;
  border: 1px solid rgba(148, 163, 184, .18) !important;
}
.agent-input .tag-pill:hover,
.agent-input .tag-pill.active {
  color: #ffffff !important;
  background: rgba(59, 130, 246, .28) !important;
  border-color: rgba(147, 197, 253, .52) !important;
}
.agent-input .tag-pill.add {
  color: #93c5fd !important;
  border-style: dashed !important;
}

.agent-input .dashed-btn {
  min-height: 48px;
  color: #93c5fd !important;
  border-color: rgba(147, 197, 253, .36) !important;
  background: rgba(59,130,246,.08) !important;
}
.agent-input .brand-color-row { gap: 12px; }
.agent-input .brand-color-input {
  width: 62px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,.08) !important;
}
.agent-input .brand-color-row .ghost,
.agent-input .agent-beautify-btn, .ghost {
  color: #dbeafe !important;
  background: rgba(255,255,255,.075) !important;
  border: 1px solid rgba(148, 163, 184, .20) !important;
}
.agent-input .agent-start-btn {
  min-height: 62px;
  border-radius: 20px;
  font-size: 20px;
  font-weight: 900;
  color: #06111f !important;
  background: linear-gradient(100deg, #ffffff 0%, #dbeafe 45%, #7dd3fc 100%) !important;
  box-shadow: 0 20px 54px rgba(14,165,233,.22) !important;
}
.agent-input .agent-beautify-btn { min-height: 52px; border-radius: 18px; font-size: 17px; } {
  padding: 22px;
  color: #dbeafe !important;
}
.agent-image-list { display: grid; gap: 10px; }
.agent-image-item {
  color: #eaf4ff;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 16px;
  padding: 10px 12px;
}

@media (max-width: 1260px) {
  .agent-form-grid { grid-template-columns: 1fr; }
  .agent-input { min-height: auto; }
}
@media (max-width: 760px) {
  .agent-history-btn { min-width: 120px; min-height: 50px; font-size: 16px !important; }
  .agent-layout { padding-top: 10px; }
  .agent-input { padding: 20px; border-radius: 22px; }
  .agent-input .seg-group-lg { grid-template-columns: 1fr; }
}

/* === 图文分层工作台 === */
.textlayer-head {
  background:
    linear-gradient(135deg, rgba(12, 18, 32, .92), rgba(30, 41, 59, .84)),
    radial-gradient(circle at 12% 10%, rgba(99, 102, 241, .42), transparent 30%),
    radial-gradient(circle at 88% 22%, rgba(14, 165, 233, .36), transparent 28%);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, .20);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .20);
}
.textlayer-head p { color: #cbd5e1; }
.tl-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
}
.tl-preview-card,
.tl-panel {
  border: 1px solid rgba(226, 232, 240, .78);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 20px 58px rgba(15, 23, 42, .10);
  backdrop-filter: blur(18px);
}
.tl-preview-card {
  border-radius: 28px;
  padding: 16px;
  min-width: 0;
}
.tl-preview-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.tl-preview-top strong { display: block; font-size: 18px; }
.tl-preview-top span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.tl-mode-switch {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 5px;
  border-radius: 16px;
  background: #eef2ff;
}
.tl-mode-switch button {
  padding: 8px 12px;
  border-radius: 12px;
  color: #475569;
  background: transparent;
  box-shadow: none;
}
.tl-mode-switch button.active {
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
}
.tl-board-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  padding: 18px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 10%, rgba(99, 102, 241, .18), transparent 26%),
    radial-gradient(circle at 86% 80%, rgba(6, 182, 212, .16), transparent 28%),
    linear-gradient(135deg, #0f172a, #1e293b);
}
.tl-board-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), rgba(0,0,0,.18));
}
.tl-board-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  aspect-ratio: var(--tl-ratio, 16 / 9);
  container-type: inline-size;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(148,163,184,.18) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148,163,184,.18) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148,163,184,.18) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148,163,184,.18) 75%),
    #ffffff;
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  box-shadow: 0 28px 80px rgba(0,0,0,.32), inset 0 0 0 1px rgba(255,255,255,.66);
  user-select: none;
  touch-action: none;
}
.tl-board-img,
.tl-material-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.tl-board-img.is-ghost { opacity: .15; filter: saturate(.65); }
.tl-material-layer {
  inset: auto;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.58);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
}
.tl-text-box {
  position: absolute;
  z-index: 5;
  padding: .08em .16em;
  line-height: 1.12;
  letter-spacing: -.02em;
  border: 1px dashed transparent;
  border-radius: .2em;
  text-shadow: 0 1px 1px rgba(255,255,255,.18);
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
  user-select: text;
}
.tl-text-box:hover,
.tl-text-box:focus {
  border-color: rgba(99,102,241,.75);
  background: rgba(255,255,255,.32);
  box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}
.tl-selection-draft {
  position: absolute;
  z-index: 8;
  border: 2px solid #22d3ee;
  border-radius: 14px;
  background: rgba(34, 211, 238, .16);
  box-shadow: 0 0 0 999px rgba(15, 23, 42, .22), 0 0 28px rgba(34, 211, 238, .42);
  pointer-events: none;
}
.tl-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #64748b;
  font-weight: 800;
  background: rgba(255,255,255,.72);
}
.tl-status {
  position: absolute;
  z-index: 2;
  left: 28px;
  bottom: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 56px);
  padding: 10px 14px;
  color: #dbeafe;
  border: 1px solid rgba(147, 197, 253, .22);
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 800;
}
.tl-status.is-busy { color: #ffffff; border-color: rgba(34,211,238,.45); }
.tl-mini-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 14px 2px 2px;
}
.tl-mini {
  flex: 0 0 148px;
  display: grid;
  gap: 7px;
  text-align: left;
  padding: 10px;
  border: 1px solid rgba(226,232,240,.92);
  background: #fff;
}
.tl-mini.active { color: #0f172a; border-color: rgba(99,102,241,.58); background: #eef2ff; }
.tl-mini span { font-weight: 900; font-size: 13px; }
.tl-mini small { color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-mini-preview {
  height: 70px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fafc, #e0f2fe);
}
.tl-mini-preview img { width: 100%; height: 100%; object-fit: cover; }
.tl-mini-preview b { font-size: 28px; color: #4f46e5; }
.tl-mini-preview em { color: #94a3b8; font-style: normal; font-size: 24px; }
.tl-side {
  display: grid;
  gap: 14px;
  align-content: start;
}
.tl-panel {
  border-radius: 22px;
  padding: 16px;
}
.tl-panel-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.tl-panel-title strong { font-size: 16px; }
.tl-upload-btn {
  width: 100%;
  min-height: 94px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px dashed rgba(99, 102, 241, .42);
  background: linear-gradient(135deg, #eef2ff, #ecfeff);
}
.tl-upload-btn b { font-size: 18px; }
.tl-upload-btn span { color: #475569; font-size: 12px; font-weight: 700; }
.tl-main-actions,
.tl-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.tl-status-grid {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px 12px;
  align-items: center;
  font-size: 13px;
}
.tl-status-grid span { color: #64748b; }
.tl-status-grid strong { color: #0f172a; text-align: right; }
.tl-material-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
}
.tl-material-row {
  display: grid;
  grid-template-columns: 42px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
}
.tl-material-row img {
  width: 42px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  background: #fff;
}
.tl-material-row span { font-weight: 800; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-material-row button { padding: 6px 8px; border-radius: 9px; font-size: 12px; }

@media (max-width: 1280px) {
  .tl-workbench { grid-template-columns: 1fr; }
  .tl-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tl-preview-top { align-items: flex-start; flex-direction: column; }
  .tl-board-wrap { min-height: 340px; padding: 10px; }
  .tl-side { grid-template-columns: 1fr; }
  .tl-main-actions, .tl-action-grid { grid-template-columns: 1fr; }
  .tl-mini { flex-basis: 132px; }
}

/* === 图文分层可读性修正：浅色面板统一深色文字 === */
.tl-workbench,
.tl-workbench .tl-preview-card,
.tl-workbench .tl-panel,
.tl-workbench .tl-preview-top,
.tl-workbench .tl-panel-title,
.tl-workbench .tl-status-grid,
.tl-workbench .tl-material-list,
.tl-workbench .tl-mini,
.tl-workbench .tl-upload-btn {
  color: #0f172a !important;
}
.tl-workbench strong,
.tl-workbench b,
.tl-workbench h2,
.tl-workbench h3,
.tl-workbench span,
.tl-workbench p,
.tl-workbench small,
.tl-workbench label,
.tl-workbench em,
.tl-workbench button,
.tl-workbench .muted,
.tl-workbench .tl-preview-top span,
.tl-workbench .tl-status-grid span,
.tl-workbench .tl-status-grid strong,
.tl-workbench .tl-mini span,
.tl-workbench .tl-mini small,
.tl-workbench .tl-upload-btn span,
.tl-workbench .tl-material-row span {
  color: #0f172a !important;
  opacity: 1 !important;
}
.tl-workbench .muted,
.tl-workbench .tl-preview-top span,
.tl-workbench .tl-status-grid span,
.tl-workbench .tl-mini small,
.tl-workbench .tl-upload-btn span {
  color: #334155 !important;
}
.tl-workbench .tl-panel,
.tl-workbench .tl-preview-card,
.tl-workbench .tl-mini,
.tl-workbench .tl-material-row {
  background: rgba(255, 255, 255, .96) !important;
  border-color: rgba(148, 163, 184, .48) !important;
}
.tl-workbench .tl-mode-switch {
  background: #e2e8f0 !important;
}
.tl-workbench .tl-mode-switch button {
  color: #1e293b !important;
  background: transparent !important;
}
.tl-workbench .tl-mode-switch button.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
}
.tl-workbench button.primary,
.tl-workbench .primary,
.tl-workbench .tl-action-grid button.primary,
.tl-workbench .tl-main-actions button.primary {
  color: #0f172a !important;
  background: linear-gradient(135deg, #dbeafe, #7dd3fc) !important;
  border: 1px solid rgba(14, 165, 233, .28) !important;
  font-weight: 900 !important;
}
.tl-workbench button:disabled,
.tl-workbench button[disabled] {
  color: #64748b !important;
  background: #e2e8f0 !important;
  opacity: .92 !important;
  cursor: not-allowed;
}
.tl-workbench .tl-upload-btn {
  background: linear-gradient(135deg, #f8fafc, #e0f2fe) !important;
  border-color: rgba(37, 99, 235, .42) !important;
}
.tl-workbench .pill {
  color: #0f172a !important;
  background: #e2e8f0 !important;
}
.tl-workbench .pill.green {
  color: #065f46 !important;
  background: #dcfce7 !important;
}
.tl-workbench .pill.orange {
  color: #9a3412 !important;
  background: #ffedd5 !important;
}
.tl-workbench .tl-status {
  color: #0f172a !important;
  background: rgba(255, 255, 255, .92) !important;
  border-color: rgba(148, 163, 184, .55) !important;
}
.tl-workbench .tl-empty {
  color: #0f172a !important;
  font-weight: 900;
}
.tl-workbench .tl-board-shell .tl-text-box {
  color: inherit !important;
}

/* === 首页模块卡片：按钮统一贴近底部，保持同一底部距离 === */
.module-card-grid {
  align-items: stretch;
}
.module-card-grid .module-card {
  min-height: 330px;
  display: flex !important;
  flex-direction: column;
}
.module-card-grid .module-card .feature-list {
  margin-bottom: 0;
}
.module-card-grid .module-card .actions-row {
  margin-top: auto;
  padding-top: 22px;
}
.module-card-grid .module-card .actions-row .primary.small {
  align-self: flex-start;
}

/* === 矢量设计区右侧属性面板排版修正 === */
.design-layout .inspector {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 20px 18px 34px !important;
  scrollbar-gutter: stable;
}
.design-layout .inspector .panel-block {
  position: relative;
  z-index: 1;
  padding-bottom: 22px;
  margin-bottom: 22px;
}
.design-layout .inspector .panel-block:first-child {
  padding-bottom: 26px;
}
.design-layout .inspector .form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 18px;
  row-gap: 18px;
  align-items: end;
  width: 100%;
}
.design-layout .inspector .form-row {
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 10px;
  margin: 0;
}
.design-layout .inspector .form-row label {
  line-height: 1.1;
  white-space: nowrap;
}
.design-layout .inspector .form-row input,
.design-layout .inspector .form-row select,
.design-layout .inspector .form-row textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.design-layout .inspector input[type="range"] {
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  accent-color: #93c5fd;
}
.design-layout .inspector input[type="number"] {
  height: 46px;
  padding: 8px 12px;
}
.design-layout .inspector input[type="color"] {
  width: 62px !important;
  height: 42px;
  padding: 5px;
  justify-self: start;
  border-radius: 18px;
}
.design-layout .inspector #prop-opacity {
  align-self: center;
}
.design-layout .inspector #prop-left,
.design-layout .inspector #prop-top,
.design-layout .inspector #prop-font-size {
  justify-self: stretch;
}
.design-layout .inspector .card-title {
  margin-bottom: 18px;
}
.design-layout .inspector .layer-list {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
}
.design-layout .inspector .layer-item {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 16px;
}
.design-layout .inspector .layer-actions button {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 13px;
}
@media (max-width: 1380px) {
  .design-layout .inspector .form-grid {
    column-gap: 12px;
  }
  .design-layout .inspector input[type="number"] {
    padding-inline: 10px;
  }
}

/* === 图层管理：拖拽排序 + 上下移动按钮 === */
.design-layout .inspector .layer-item {
  cursor: grab;
}
.design-layout .inspector .layer-item:active {
  cursor: grabbing;
}
.design-layout .inspector .layer-item.is-dragging {
  opacity: .58;
  transform: scale(.985);
}
.design-layout .inspector .layer-item.is-drop-target {
  border-color: rgba(34, 211, 238, .78) !important;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, .16), inset 0 0 0 1px rgba(34, 211, 238, .32);
}
.design-layout .inspector .layer-actions {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}
.design-layout .inspector .layer-actions button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
}
.design-layout .inspector .layer-actions button:disabled {
  opacity: .35 !important;
  cursor: not-allowed;
}
.design-layout .inspector .layer-name {
  cursor: pointer;
}
@media (max-width: 1380px) {
  .design-layout .inspector .layer-actions {
    gap: 4px;
  }
  .design-layout .inspector .layer-actions button {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
}

/* === 矢量设计区顶部工具栏：分组压缩与对齐修正 === */
.workspace-top.design-toolbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: 10px 12px !important;
  min-width: 0;
}
.design-toolbar .toolbar-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.design-toolbar .toolbar-primary,
.design-toolbar .toolbar-secondary {
  flex-wrap: wrap;
}
.design-toolbar .toolbar-secondary {
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.design-toolbar .toolbar-title-field,
.design-toolbar .toolbar-group {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
  border-radius: 18px;
}
.design-toolbar .toolbar-title-field {
  flex: 1 1 260px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 12px;
}
.design-toolbar .toolbar-title-field span,
.design-toolbar .toolbar-group-label {
  flex: 0 0 auto;
  color: rgba(226, 232, 240, .64);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .02em;
  white-space: nowrap;
}
.design-toolbar #project-title-input {
  flex: 1 1 auto;
  min-width: 120px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  border-color: transparent;
  background: rgba(255, 255, 255, .065);
  color: #f8fafc;
  font-size: 14px;
  font-weight: 800;
}
.design-toolbar .toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px;
}
.design-toolbar .toolbar-group-label {
  padding: 0 6px;
}
.design-toolbar .node-tools {
  flex: 1 1 520px;
}
.design-toolbar .edit-tools,
.design-toolbar .layer-tools,
.design-toolbar .view-tools,
.design-toolbar .export-tools {
  flex: 0 1 auto;
}
.design-toolbar .toolbar-spacer {
  flex: 1 1 24px;
  min-width: 0;
}
.design-toolbar button.small {
  height: 34px;
  min-width: 58px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  color: rgba(248, 250, 252, .92);
  box-shadow: none;
}
.design-toolbar button.small:hover {
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}
.design-toolbar button.small.accent {
  color: #dff7ff;
  background: linear-gradient(135deg, rgba(99, 102, 241, .24), rgba(34, 211, 238, .18));
  border-color: rgba(125, 211, 252, .22);
}
.design-toolbar button.small.dark {
  color: #07111f;
  background: linear-gradient(180deg, #ffffff, #dce7ff);
  border-color: rgba(255, 255, 255, .44);
}
@media (min-width: 1500px) {
  .workspace-top.design-toolbar {
    grid-template-columns: minmax(0, auto) minmax(560px, 1fr);
    align-items: center !important;
  }
  .design-toolbar .toolbar-primary,
  .design-toolbar .toolbar-secondary {
    flex-wrap: nowrap;
  }
  .design-toolbar .toolbar-secondary {
    padding-top: 0;
    border-top: 0;
  }
}
@media (max-width: 760px) {
  .design-toolbar .toolbar-title-field {
    max-width: none;
    flex-basis: 100%;
  }
  .design-toolbar .toolbar-group,
  .design-toolbar .node-tools {
    flex: 1 1 100%;
  }
  .design-toolbar .toolbar-spacer {
    display: none;
  }
}

/* 顶部工具栏保持两行分组，不在宽屏强行挤成左右两列，避免内容横向溢出 */
@media (min-width: 1500px) {
  .workspace-top.design-toolbar {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .design-toolbar .toolbar-primary,
  .design-toolbar .toolbar-secondary {
    flex-wrap: wrap !important;
  }
  .design-toolbar .toolbar-secondary {
    padding-top: 8px !important;
    border-top: 1px solid rgba(255, 255, 255, .08) !important;
  }
}

/* === 图层管理：名称可双击改名 === */
.design-layout .inspector .layer-name {
  min-width: 0;
  display: block;
  cursor: text;
}
.design-layout .inspector .layer-name:hover {
  color: #ffffff;
  text-shadow: 0 0 16px rgba(125, 211, 252, .30);
}
.design-layout .inspector .layer-item.renaming {
  cursor: text;
  border-color: rgba(125, 211, 252, .72) !important;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, .16), inset 0 0 0 1px rgba(125, 211, 252, .20);
}
.design-layout .inspector .layer-name-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, .45);
  background: rgba(255, 255, 255, .10);
  color: #f8fafc;
  font-size: 14px;
  font-weight: 900;
  outline: none;
}
.design-layout .inspector .layer-name-input:focus {
  box-shadow: 0 0 0 3px rgba(125, 211, 252, .16);
}

/* === 节点工作流页面：顶部介绍与预览卡片排版修正 === */
.workflow-intro.workflow-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}
.workflow-hero-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
  transform: translateY(-10px);
}
.workflow-kicker {
  width: fit-content;
  padding: 5px 8px 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, .22);
  background: rgba(125, 211, 252, .08);
  color: rgba(226, 232, 240, .76);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .02em;
}
.workflow-intro.workflow-hero h2 {
  margin: -3px 0 0;
  max-width: 760px;
  line-height: 1.15;
}
.workflow-intro.workflow-hero p {
  margin: 0;
  max-width: 900px;
  line-height: 1.75;
}
.workflow-feature-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.workflow-feature-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: rgba(248, 250, 252, .78);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .10);
  font-size: 13px;
  font-weight: 750;
}
.workflow-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: max-content;
}
.workflow-hero-actions .workflow-design-btn,
.workflow-hero-actions .workflow-enter-btn,
.workflow-hero-actions .workflow-open-link,
.workflow-hero-actions button.ghost {
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 16px;
  font-weight: 850;
}
.workflow-hero-actions .workflow-design-btn {
  color: #07111f;
  background: linear-gradient(100deg, #f8fbff 0%, #cfeaff 100%);
  box-shadow: 0 16px 34px rgba(125, 211, 252, .16);
}
.workflow-hero-actions .workflow-enter-btn {
  color: #07111f;
  background: linear-gradient(100deg, #ffffff 0%, #dce7ff 45%, #9bdcff 100%);
  box-shadow: 0 18px 42px rgba(122, 162, 255, .18);
}
.workflow-hero-actions .workflow-open-link,
.workflow-hero-actions button.ghost {
  color: rgba(248, 250, 252, .82);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
}
.workflow-embed-card {
  position: relative;
  height: clamp(640px, 72vh, 820px) !important;
  min-height: 640px !important;
  overflow: hidden !important;
}
.workflow-card-caption {
  position: absolute;
  left: 18px;
  top: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: rgba(248, 250, 252, .84);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
  pointer-events: none;
}
.workflow-card-caption span {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 900;
}
.workflow-card-caption strong {
  color: #f8fafc;
  font-size: 13px;
}
.workflow-embed-card iframe {
  position: relative;
  z-index: 1;
}
@media (max-width: 1180px) {
  .workflow-intro.workflow-hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .workflow-hero-actions {
    justify-content: flex-start;
    min-width: 0;
  }
}
@media (max-width: 760px) {
  .workflow-card-caption {
    display: none;
  }
  .workflow-embed-card {
    height: 78vh !important;
    min-height: 560px !important;
  }
}

/* 工作流预览标题不覆盖 iframe 内部工具栏 */
.workflow-card-caption {
  display: none !important;
}

/* AI 绘图真实结果预览 */
.generated-card .generated-preview-img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  margin: 14px 0;
  border-radius: 20px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 42px rgba(0,0,0,.22);
}

.generated-save-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 4px;
  padding: 9px 16px;
  border-radius: 999px;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, .18);
  font-weight: 800;
  text-decoration: none;
}
.generated-save-link:hover { background: #dbeafe; color: #1d4ed8; }

/* === workflow preview viewport fit: embedded editor fills the visible screen === */
.view.route-workflow {
  min-height: calc(100vh - 118px);
  display: flex;
  flex-direction: column;
}
.view.route-workflow .workflow-intro.workflow-hero {
  flex: 0 0 auto;
  margin-bottom: 10px;
}
.view.route-workflow .workflow-embed-card {
  flex: 1 1 auto;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}
.view.route-workflow .workflow-embed-card iframe {
  width: 100%;
  height: 100%;
  min-height: 520px;
}
@media (max-height: 780px) {
  .view.route-workflow {
    min-height: calc(100vh - 94px);
  }
  .view.route-workflow .workflow-intro.workflow-hero {
    margin-bottom: 8px;
  }
  .view.route-workflow .workflow-embed-card iframe {
    min-height: 460px;
  }
}

/* === workflow full-screen fit: make the white embedded editor fill the dark card === */
body[data-route="workflow"] {
  overflow: hidden;
}
body[data-route="workflow"] #app {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
body[data-route="workflow"] .shell {
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 16px;
}
body[data-route="workflow"] .topbar {
  flex: 0 0 auto;
  margin-bottom: 12px;
}
body[data-route="workflow"] .topbar .top-actions {
  display: none;
}
body[data-route="workflow"] .view.route-workflow {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: auto !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body[data-route="workflow"] .view.route-workflow .workflow-intro.workflow-hero {
  flex: 0 0 auto;
}
body[data-route="workflow"] .view.route-workflow .workflow-embed-card {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  position: relative;
}
body[data-route="workflow"] .view.route-workflow .workflow-embed-card iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  display: block;
}
@media (max-width: 860px), (max-height: 640px) {
  body[data-route="workflow"] {
    overflow: auto;
  }
  body[data-route="workflow"] #app,
  body[data-route="workflow"] .shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  body[data-route="workflow"] .view.route-workflow .workflow-embed-card {
    min-height: 560px !important;
  }
}

/* === 工作流顶部：所有标题、说明、操作按钮集合成同一排 === */
body[data-route="workflow"] .topbar {
  display: none !important;
}
body[data-route="workflow"] .shell {
  padding-top: 16px;
}
body[data-route="workflow"] .view.route-workflow .workflow-intro.workflow-hero {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  min-height: 58px;
  margin-bottom: 10px !important;
  overflow: visible;
}
body[data-route="workflow"] .workflow-hero-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  transform: none !important;
  white-space: nowrap;
  overflow: hidden;
}
body[data-route="workflow"] .workflow-page-eyebrow {
  flex: 0 0 auto;
  color: rgba(226, 232, 240, .72);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
}
body[data-route="workflow"] .workflow-page-title {
  flex: 0 0 auto;
  color: #dff3ff;
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -.05em;
  text-shadow: 0 0 24px rgba(125, 211, 252, .16);
}
body[data-route="workflow"] .workflow-kicker {
  flex: 0 0 auto;
  margin-left: 2px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
}
body[data-route="workflow"] .workflow-intro.workflow-hero h2 {
  flex: 1 1 auto;
  min-width: 170px;
  max-width: none;
  margin: 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #bdeaff;
  font-size: clamp(18px, 1.25vw, 24px);
  line-height: 1.1;
  letter-spacing: -.04em;
}
body[data-route="workflow"] .workflow-hero-actions {
  flex: 0 0 auto;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  min-width: max-content !important;
}
body[data-route="workflow"] .workflow-hero-actions .workflow-design-btn,
body[data-route="workflow"] .workflow-hero-actions .workflow-enter-btn,
body[data-route="workflow"] .workflow-hero-actions .workflow-open-link,
body[data-route="workflow"] .workflow-hero-actions button.ghost {
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1;
}
@media (max-width: 1440px) {
  body[data-route="workflow"] .workflow-hero-copy { gap: 9px !important; }
  body[data-route="workflow"] .workflow-page-eyebrow { font-size: 12px; }
  body[data-route="workflow"] .workflow-page-title { font-size: 25px; }
  body[data-route="workflow"] .workflow-kicker { font-size: 11px; padding: 0 8px; }
  body[data-route="workflow"] .workflow-intro.workflow-hero h2 { font-size: 18px; }
  body[data-route="workflow"] .workflow-hero-actions { gap: 8px !important; }
  body[data-route="workflow"] .workflow-hero-actions .workflow-design-btn,
  body[data-route="workflow"] .workflow-hero-actions .workflow-enter-btn,
  body[data-route="workflow"] .workflow-hero-actions .workflow-open-link,
  body[data-route="workflow"] .workflow-hero-actions button.ghost {
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }
}
@media (max-width: 1100px) {
  body[data-route="workflow"] .view.route-workflow .workflow-intro.workflow-hero {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }
  body[data-route="workflow"] .workflow-hero-copy {
    flex-basis: 100%;
    flex-wrap: wrap;
    white-space: normal;
    overflow: visible;
  }
  body[data-route="workflow"] .workflow-hero-actions {
    justify-content: flex-start !important;
    min-width: 0 !important;
    flex-wrap: wrap !important;
  }
}
