:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #1c2430;
  --muted: #697586;
  --line: #e6eaf2;
  --primary: #5b5cf6;
  --primary-dark: #4545d8;
  --soft: #eef0ff;
  --success: #12a164;
  --shadow: 0 18px 45px rgba(24, 32, 56, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top left, #eef0ff 0, transparent 28rem), var(--bg);
  color: var(--ink);
}

button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 272px;
  padding: 24px;
  background: #0f172a;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width .22s ease, padding .22s ease;
}

.sidebar-toggle { position: absolute; right: -14px; top: 22px; z-index: 12; width: 30px; height: 30px; border-radius: 999px; background: #fff; color: #334155; border: 1px solid #dbe2ee; box-shadow: 0 8px 20px rgba(15,23,42,.16); font-size: 22px; line-height: 1; }
.sidebar-toggle:hover { color: var(--primary); }
.app-shell.sidebar-collapsed .sidebar { width: 76px; padding: 24px 12px; align-items: center; }
.app-shell.sidebar-collapsed .sidebar-toggle { transform: rotate(180deg); }
.app-shell.sidebar-collapsed .brand { justify-content: center; }
.app-shell.sidebar-collapsed .brand > div:last-child, .app-shell.sidebar-collapsed .sidebar-card, .app-shell.sidebar-collapsed .nav-item { font-size: 0; }
.app-shell.sidebar-collapsed .nav { width: 100%; }
.app-shell.sidebar-collapsed .nav-item { position: relative; height: 44px; padding: 0; text-align: center; }
.app-shell.sidebar-collapsed .nav-item::before { content: attr(data-short); display: grid; place-items: center; height: 100%; color: inherit; font-size: 16px; font-weight: 800; }
.app-shell.sidebar-collapsed .brand-mark { width: 42px; height: 42px; }
.app-shell.sidebar-collapsed .main { min-width: 0; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6, #22d3ee);
  font-weight: 800;
}
.brand h1, .brand p { margin: 0; }
.brand h1 { font-size: 20px; }
.brand p { color: #aab4c6; font-size: 13px; }

.nav { display: grid; gap: 8px; }
.nav-item {
  text-align: left;
  color: #cbd5e1;
  background: transparent;
  padding: 12px 14px;
  border-radius: 12px;
}
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255, 255, 255, 0.1); }

.sidebar-card {
  margin-top: auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-card span, .sidebar-card small { display: block; color: #aab4c6; }
.sidebar-card strong { display: block; margin: 8px 0; font-size: 28px; }

.main { flex: 1; padding: 28px; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.topbar h2 { margin: 4px 0 0; font-size: 28px; }
.top-actions, .hero-actions, .filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.asset-admin-only {
  white-space: nowrap;
  padding: 10px 12px;
  font-size: 13px;
}
.eyebrow {
  margin: 0;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}

.view { display: none; }
.view.active { display: block; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.6fr);
  gap: 20px;
  margin-bottom: 20px;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(238,240,255,0.92));
  box-shadow: var(--shadow);
}
.hero h3 { margin: 12px 0; font-size: 34px; line-height: 1.18; }
.hero p { color: var(--muted); max-width: 760px; }
.hero-panel { display: grid; gap: 12px; }

.metric, .card, .panel, .task-item, .asset-card, .model-item, .quota-card, .mini-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.metric { padding: 18px; }
.metric span, .quota-card span, .task-meta, .muted { color: var(--muted); }
.metric strong { display: block; margin-top: 8px; font-size: 30px; }

.grid { display: grid; gap: 18px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.more-tools-head { display:flex;align-items:center;justify-content:space-between;margin-bottom:18px; }
.more-tools-head h3 { margin:0 0 6px;font-size:22px; }
.more-tools-grid { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:18px; }
.more-tool-card { min-height:170px;padding:22px;border:1px solid #e5e6eb;border-radius:12px;background:#fff;color:#1d2129;text-align:left;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s; }
.more-tool-card:hover:not(:disabled),.more-tool-card.active { border-color:#165dff;box-shadow:0 8px 24px rgba(22,93,255,.12);transform:translateY(-2px); }
.more-tool-card.disabled { cursor:not-allowed;opacity:.55;background:#f7f8fa; }
.more-tool-icon { display:grid;place-items:center;width:46px;height:46px;margin-bottom:18px;border-radius:10px;background:#e8f3ff;color:#165dff;font-size:16px;font-weight:800; }
.more-tool-card strong,.more-tool-card small { display:block; }
.more-tool-card strong { margin-bottom:7px;font-size:16px; }
.more-tool-card small { color:#86909c;line-height:1.5; }
.watermark-page-head { display:flex;align-items:flex-start;gap:14px;margin-bottom:18px; }
.watermark-page-head h3 { margin:1px 0 6px;font-size:22px; }
.watermark-page-head .ghost { flex:0 0 auto; }
.watermark-tool-panel { padding:22px; }
.watermark-upload-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:18px; }
.watermark-upload-card { position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:230px;padding:20px;border:1px dashed #c9cdd4;border-radius:12px;background:#f7f8fa;text-align:center;cursor:pointer;transition:border-color .15s,background .15s; }
.watermark-upload-card:hover { border-color:#165dff;background:#f2f7ff; }
.watermark-upload-card strong { margin:12px 0 6px;color:#1d2129; }
.watermark-upload-card small { color:#86909c;line-height:1.5; }
.watermark-upload-icon { display:grid;place-items:center;min-width:54px;height:42px;padding:0 10px;border-radius:8px;background:#165dff;color:#fff;font-size:13px;font-weight:700; }
#watermarkLogoPreview { max-width:220px;max-height:90px;margin-top:14px;object-fit:contain;background:repeating-conic-gradient(#e5e6eb 0 25%,#fff 0 50%) 50%/16px 16px;border-radius:6px; }
#sliceImagePreview { max-width:240px;max-height:150px;margin-top:14px;object-fit:contain;border-radius:8px;box-shadow:0 5px 18px rgba(0,0,0,.1); }
.watermark-file-list { display:flex;flex-wrap:wrap;justify-content:center;gap:6px;max-height:76px;overflow:auto;margin-top:10px; }
.watermark-file-list span { max-width:150px;padding:4px 8px;border-radius:999px;background:#e8f3ff;color:#165dff;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.watermark-actions { display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:18px;padding-top:18px;border-top:1px solid #e5e6eb; }
.watermark-actions button { min-width:140px; }
.slice-tool-layout { display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);gap:16px;margin-top:18px; }
.slice-upload-card { min-height:320px; }
.slice-settings-card { display:flex;flex-direction:column;justify-content:center;min-height:320px;padding:28px;border:1px solid #e5e6eb;border-radius:12px;background:#f7f8fa; }
.slice-settings-card>label { margin-bottom:10px;color:#1d2129;font-weight:600; }
.slice-height-control { display:flex;align-items:center;overflow:hidden;border:1px solid #c9cdd4;border-radius:8px;background:#fff; }
.slice-height-control:focus-within { border-color:#165dff;box-shadow:0 0 0 3px rgba(22,93,255,.1); }
.slice-height-control input { width:100%;height:48px;padding:0 14px;border:0;outline:0;background:transparent;color:#1d2129;font-size:20px;font-weight:600; }
.slice-height-control span { padding:0 15px;color:#86909c;border-left:1px solid #e5e6eb; }
.slice-result-estimate { margin:16px 0 10px;padding:12px;border-radius:8px;background:#e8f3ff;color:#165dff;font-weight:600;line-height:1.5; }
.purchase-order-layout { display:grid;grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);gap:16px;margin-top:18px; }
.purchase-order-upload { min-height:310px; }
.purchase-order-info { min-height:310px;padding:28px;border:1px solid #e5e6eb;border-radius:12px;background:#f7f8fa; }
.purchase-order-info h4 { margin:0 0 18px;font-size:17px; }
.purchase-order-info ol { margin:0;padding-left:22px;color:#4e5969;line-height:2; }
.purchase-order-target { margin-top:20px;padding:13px;border-radius:8px;background:#e8f3ff;color:#4e5969;line-height:1.6;overflow-wrap:anywhere; }
.purchase-order-target strong { color:#165dff; }
@media (max-width:1000px){.more-tools-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:700px){.more-tools-grid,.watermark-upload-grid,.slice-tool-layout,.purchase-order-layout{grid-template-columns:1fr}.watermark-page-head{flex-direction:column}.watermark-actions{align-items:stretch;flex-direction:column}.watermark-actions button{width:100%}}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card, .panel { padding: 22px; box-shadow: 0 10px 30px rgba(24, 32, 56, 0.04); }
.card h4, .panel h3 { margin-top: 0; }
.card p, .panel p { color: var(--muted); line-height: 1.65; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 14px;
}
.section-title.compact { margin: 0 0 18px; }
.section-title h3 { margin: 0; }
.split { display: grid; grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr); gap: 18px; }

label { display: grid; gap: 8px; color: #334155; font-weight: 650; margin-bottom: 14px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(91, 92, 246, 0.12); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }

.primary, .secondary, .ghost { border-radius: 999px; padding: 11px 18px; font-weight: 700; }
.primary { color: #fff; background: var(--primary); }
.primary:hover { background: var(--primary-dark); }
.secondary { color: var(--primary); background: var(--soft); }
.ghost { color: var(--muted); background: #fff; border: 1px solid var(--line); }
.full { width: 100%; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.product-list, .task-list, .model-list { display: grid; gap: 12px; }
.product-item, .task-item, .model-item { padding: 16px; }
.product-item { border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.product-item h4, .task-item h4, .asset-card h4, .model-item h4 { margin: 0 0 8px; }
.product-item p, .task-item p, .asset-card p { margin: 0; color: var(--muted); line-height: 1.55; }

.task-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.task-image-slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.task-image-slot {
  width: 74px;
  height: 74px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  font-size: 11px;
  text-align: center;
}
.task-image-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.task-image-slot span {
  position: absolute;
  left: 5px;
  bottom: 5px;
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-weight: 800;
}
.task-image-slot b { font-size: 12px; }
.task-image-slot.pending { background: repeating-linear-gradient(135deg, #f8fafc 0 8px, #eef2ff 8px 16px); }
.task-image-slot.failed { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }
.task-image-slot.failed span { background: rgba(185, 28, 28, .82); }
.task-image-slot.done { padding: 0; cursor: pointer; }
.status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.status.pending { color: #7a4d00; background: #fff3d9; }
.status.running { color: #1d4ed8; background: #dbeafe; }
.status.done { color: #047857; background: #d1fae5; }
.status.failed { color: #b91c1c; background: #fee2e2; }
.status.partial { color: #92400e; background: #fef3c7; }

.preview-box {
  min-height: 180px;
  border-radius: 16px;
  border: 1px dashed #cdd4e3;
  background: #fafbff;
  padding: 18px;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
}

.reference-box,
.parameter-box {
  margin: 4px 0 16px;
  padding: 16px;
  border: 1px dashed #cdd4e3;
  border-radius: 18px;
  background: #fafbff;
}

.reference-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.compact-reference {
  margin: 0;
}

.compact-reference .reference-preview {
  min-height: 86px;
}

.reference-focus-box {
  margin-top: 0;
}

.parameter-box {
  border-style: solid;
  background: #fff;
}

.preset-hint {
  margin: -4px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f0f7ff;
  color: #2563eb;
  line-height: 1.55;
  font-size: 13px;
}

.reference-preview {
  min-height: 118px;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  overflow: hidden;
}

.reference-preview.empty {
  border-style: dashed;
}

.reference-focus {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed rgba(99, 102, 241, 0.28);
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.05);
}

.reference-focus .muted {
  grid-column: 1 / -1;
  margin: 0;
}

.reference-focus label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: var(--text);
}

.reference-focus input {
  width: auto;
}

.reference-preview img,
.reference-preview video {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 12px;
  background: #0f172a;
}

.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.asset-card { overflow: hidden; }
.asset-thumb {
  min-height: 150px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #eef0ff, #e0f7ff);
  color: var(--primary);
  font-size: 44px;
}

.asset-thumb.image-real {
  padding: 0;
  background: #0f172a;
}

.asset-thumb.image-real img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.asset-body { padding: 16px; }
.asset-reference {
  margin-top: 10px !important;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
  word-break: break-all;
  font-size: 13px;
}
.asset-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag { padding: 5px 9px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 12px; }

.model-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.switch { width: 46px; height: 26px; padding: 3px; border-radius: 999px; background: #cbd5e1; }
.switch.on { background: var(--success); }
.switch::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch.on::after { transform: translateX(20px); }

.quota-card { padding: 16px; margin-bottom: 12px; }
.quota-card strong { display: block; margin-top: 6px; font-size: 24px; }
.placeholder { text-align: center; padding: 48px; }
.big-icon { font-size: 64px; }
.mini-card { padding: 18px; color: var(--muted); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: none;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 20;
}
.toast.show { display: block; }

.auto-close-notice {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(3px);
}
.auto-close-notice.show { display: grid; }
.auto-close-notice-dialog {
  width: min(520px, 92vw);
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
  animation: auto-notice-in .18s ease-out;
}
.auto-close-notice-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auto-close-notice-head strong { font-size: 17px; }
.auto-close-notice-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.auto-close-notice-close:hover { background: #e2e8f0; color: #0f172a; }
.auto-close-notice-message { margin: 16px 0 12px; color: #334155; font-size: 15px; line-height: 1.75; }
.auto-close-notice-foot { color: #94a3b8; font-size: 12px; text-align: right; }
.tool-progress-modal{position:fixed;inset:0;z-index:10050;display:none;place-items:center;background:rgba(15,23,42,.42);backdrop-filter:blur(3px)}
.tool-progress-modal.show{display:grid}
.tool-progress-dialog{width:min(420px,calc(100vw - 32px));padding:30px 28px;text-align:center;background:#fff;border-radius:18px;box-shadow:0 24px 80px rgba(15,23,42,.24)}
.tool-progress-dialog h3{margin:16px 0 8px;font-size:19px;color:#1d2129}
.tool-progress-dialog p{min-height:24px;margin:0;color:#4e5969;line-height:1.7}
.tool-progress-spinner{width:38px;height:38px;margin:auto;border:4px solid #e8f3ff;border-top-color:#165dff;border-radius:50%;animation:tool-progress-spin .8s linear infinite}
.tool-progress-dialog button{margin-top:20px;min-width:96px;padding:9px 20px;border:0;border-radius:8px;background:#165dff;color:#fff;cursor:pointer}
@keyframes tool-progress-spin{to{transform:rotate(360deg)}}
@keyframes auto-notice-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.board-view { height: calc(100vh - 125px); min-height: 620px; }
.board-view.active { display: block; }
.board-view ~ * { min-width: 0; }
.board-shell { height: 100%; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 12px; color: #f8fafc; }
.board-chat-panel { min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 22px; background: #111318; border: 1px solid #292d35; box-shadow: 0 18px 50px rgba(2,6,23,.22); }
.board-chat-panel.dragging { border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99,102,241,.2), 0 18px 50px rgba(2,6,23,.22); }
.board-chat-panel.dragging::after { content: "松开即可加入对话和画板"; position: absolute; inset: 14px; z-index: 20; display: grid; place-items: center; border: 2px dashed #818cf8; border-radius: 18px; background: rgba(15,18,24,.9); color: #fff; font-weight: 800; pointer-events: none; }
.board-chat-panel { position: relative; }
.board-project-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 10px; align-items: center; }
.board-project-head input { grid-column: 1 / -1; width: 100%; }
.board-project-actions { display: flex; align-items: center; gap: 7px; min-width: 0; }
.board-project-head select { width: 150px; min-width: 110px; border-color: #343943; background: #171a20; color: #fff; font-weight: 700; }
.board-project-add { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: #252932; color: #fff; font-size: 20px; }
.board-project-head input { min-width: 0; flex: 1; border: 0; border-bottom: 1px solid #343943; border-radius: 0; background: transparent; color: #fff; padding: 8px 2px; font-weight: 800; }
.board-project-head span { color: #94a3b8; font-size: 12px; white-space: nowrap; }
.board-chat-copy { flex: 1; min-height: 110px; display: flex; flex-direction: column; justify-content: center; }
.board-chat-copy h3 { margin: 0 0 8px; font-size: 25px; }
.board-chat-copy p { margin: 0; color: #94a3b8; line-height: 1.7; }
.board-selected-strip { display: flex; gap: 8px; min-height: 58px; overflow-x: auto; }
.board-selected-thumb { position: relative; flex: 0 0 56px; height: 56px; border: 2px solid #6366f1; border-radius: 12px; overflow: hidden; background: #222631; }
.board-selected-thumb img { width: 100%; height: 100%; object-fit: cover; }
.board-selected-thumb span { position: absolute; left: 4px; bottom: 3px; padding: 1px 5px; border-radius: 8px; background: rgba(2,6,23,.75); font-size: 10px; }
.board-chat-panel textarea { min-height: 112px; resize: vertical; border: 1px solid #343943; border-radius: 16px; background: #171a20; color: #fff; padding: 14px; }
.board-generate-options { display: grid; grid-template-columns: minmax(0,1fr) 82px 90px; gap: 8px; }
.board-generate-options select { min-width: 0; border-color: #343943; background: #171a20; color: #fff; }
.board-chat-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; }
.board-chat-actions .ghost { color: #e2e8f0; border-color: #343943; background: #171a20; }
.board-task-state { min-height: 22px; color: #94a3b8; font-size: 12px; line-height: 1.5; }
.board-workspace { position: relative; min-width: 0; overflow: hidden; border-radius: 22px; background-color: #101214; background-image: radial-gradient(circle, rgba(148,163,184,.18) 1.2px, transparent 1.2px); background-size: 24px 24px; border: 1px solid #292d35; touch-action: none; }
.board-stage { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; }
.board-selection-box { position: absolute; z-index: 7; pointer-events: none; border: 1px solid #818cf8; background: rgba(99,102,241,.16); }
.board-selection-box[hidden] { display: none; }
.board-node { position: absolute; min-width: 80px; min-height: 60px; border: 2px solid transparent; border-radius: 10px; background: #222631; box-shadow: 0 14px 34px rgba(0,0,0,.28); user-select: none; }
.board-node.placeholder-node { display: grid; place-items: center; border: 2px dashed #818cf8; background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(30,41,59,.9)); color: #c7d2fe; }
.board-placeholder-inner { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 12px; pointer-events: none; }
.board-placeholder-spinner { width: 24px; height: 24px; border: 3px solid rgba(199,210,254,.28); border-top-color: #a5b4fc; border-radius: 50%; animation: board-spin .9s linear infinite; }
.board-placeholder-inner small { color: #a5b4fc; font-size: 11px; }
@keyframes board-spin { to { transform: rotate(360deg); } }
.board-node.selected { border-color: #ff9f1c; box-shadow: 0 0 0 3px rgba(255,159,28,.16), 0 14px 34px rgba(0,0,0,.32); }
.board-node img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 7px; pointer-events: none; }
.board-node-label { position: absolute; left: 8px; top: 8px; padding: 3px 7px; border-radius: 999px; background: rgba(15,23,42,.75); color: #fff; font-size: 11px; pointer-events: none; }
.board-node-resize { position: absolute; right: -7px; bottom: -7px; width: 15px; height: 15px; border-radius: 50%; background: #ff9f1c; border: 2px solid #fff; cursor: nwse-resize; display: none; }
.board-node.selected .board-node-resize { display: block; }
.board-node.text-node { display: flex; align-items: center; min-width: 180px; min-height: 70px; padding: 14px; background: rgba(255,255,255,.96); color: #111827; }
.board-node.text-node [contenteditable] { width: 100%; min-height: 38px; outline: none; white-space: pre-wrap; user-select: text; cursor: text; font-size: 24px; font-weight: 700; }
.board-node-menu { position: absolute; z-index: 8; width: 170px; padding: 8px; border: 1px solid #343943; border-radius: 15px; background: rgba(26,29,35,.98); box-shadow: 0 18px 42px rgba(0,0,0,.4); }
.board-node-menu[hidden] { display: none; }
.board-node-menu button { display: block; width: 100%; padding: 10px 11px; border-radius: 9px; background: transparent; color: #e5e7eb; text-align: left; font-size: 13px; }
.board-node-menu button:hover { background: #fff; color: #111827; }
.board-toolbar, .board-zoom-controls { position: absolute; z-index: 5; display: flex; align-items: center; gap: 5px; padding: 8px; border: 1px solid #343943; border-radius: 15px; background: rgba(22,25,31,.94); box-shadow: 0 12px 35px rgba(0,0,0,.28); }
.board-toolbar { left: 50%; bottom: 18px; transform: translateX(-50%); }
.board-zoom-controls { right: 18px; bottom: 18px; }
.board-toolbar button, .board-zoom-controls button { min-width: 38px; height: 36px; border-radius: 10px; background: transparent; color: #e2e8f0; }
.board-toolbar button:hover, .board-toolbar button.active, .board-zoom-controls button:hover { background: #fff; color: #111827; }
.board-zoom-controls span { min-width: 54px; text-align: center; color: #cbd5e1; font-size: 12px; }
.board-drop-hint { position: absolute; right: 18px; top: 18px; padding: 8px 12px; border-radius: 12px; background: rgba(22,25,31,.78); color: #94a3b8; font-size: 12px; pointer-events: none; }
.board-workspace.dragging { outline: 3px solid #6366f1; outline-offset: -3px; }
.board-workspace.space-panning { cursor: grab!important; }
.board-workspace.space-panning:active { cursor: grabbing!important; }
.board-editor-modal { position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: 20px; background: rgba(2,6,23,.78); }
.board-editor-modal[hidden] { display: none; }
.board-editor-dialog { width: min(920px,96vw); max-height: 94vh; overflow: auto; padding: 18px; border-radius: 22px; background: #111318; color: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.45); }
.board-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.board-editor-head h3 { margin: 0; }
.board-editor-head button { width: 36px; height: 36px; border-radius: 999px; background: #252932; color: #fff; font-size: 24px; }
.board-editor-canvas-wrap { display: grid; place-items: center; height: min(62vh, 680px); overflow: hidden; border-radius: 16px; background: #080a0d; }
.board-editor-canvas-wrap canvas { width: auto; max-width: 100%; max-height: 100%; height: auto; object-fit: contain; display: block; cursor: crosshair; }
.board-editor-hint { color: #94a3b8; line-height: 1.6; }
.board-editor-dialog textarea { width: 100%; min-height: 76px; padding: 12px; border: 1px solid #343943; border-radius: 13px; background: #171a20; color: #fff; resize: vertical; }
.board-editor-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

@media (max-width: 1050px) {
  .board-view { height: auto; min-height: 0; }
  .board-shell { grid-template-columns: 1fr; }
  .board-chat-panel { min-height: 440px; }
  .board-workspace { min-height: 650px; }
}

@media (max-width: 1020px) {
  .sidebar {
    position: fixed;
    z-index: 10;
    width: 220px;
    transform: translateX(-190px);
    transition: transform 0.2s;
  }
  .sidebar:hover { transform: translateX(0); }
  .main { padding-left: 58px; }
  .hero, .split, .grid.two, .grid.three, .asset-grid { grid-template-columns: 1fr; }
  .reference-pair { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .main { padding: 18px 14px 18px 54px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .hero { padding: 20px; }
  .hero h3 { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
}
