/* Arco-inspired visual layer. Business layout and interactions stay unchanged. */
:root {
  --bg: #f2f3f5;
  --panel: #ffffff;
  --ink: #1d2129;
  --muted: #86909c;
  --line: #e5e6eb;
  --primary: #165dff;
  --primary-dark: #0e42d2;
  --soft: #e8f3ff;
  --success: #00b42a;
  --danger: #f53f3f;
  --warning: #ff7d00;
  --shadow: 0 4px 14px rgba(0, 0, 0, .06);
  --arco-radius: 8px;
  --arco-radius-lg: 12px;
}

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
::selection { color: #fff; background: rgba(22, 93, 255, .82); }

.app-shell { background: var(--bg); }
.sidebar {
  width: 236px;
  padding: 16px 12px;
  gap: 16px;
  background: #fff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: none;
  z-index: 30;
}
.brand { min-height: 48px; padding: 0 8px; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(145deg, #165dff, #4080ff);
  box-shadow: 0 6px 16px rgba(22, 93, 255, .22);
  color: #fff;
  font-size: 13px;
}
.brand h1 { color: var(--ink); font-size: 17px; font-weight: 700; }
.brand p { margin-top: 2px; color: var(--muted); font-size: 12px; }
.nav { gap: 4px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 6px;
  color: #4e5969;
  font-weight: 500;
  line-height: 1.4;
  transition: color .15s, background .15s;
}
.nav-item::before {
  position: static;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: #86909c;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}
.nav-item::after { display: none; }
.nav-item[data-view="overview"]::before { content: "⌂"; }
.nav-item[data-view="quick-image"]::before { content: "▧"; }
.nav-item[data-view="chat-image"]::before { content: "◫"; }
.nav-item[data-view="infinite-board"]::before { content: "⌗"; }
.nav-item[data-view="video"]::before { content: "▷"; }
.nav-item[data-view="tasks"]::before { content: "☷"; }
.nav-item[data-view="assets"]::before { content: "◇"; }
.nav-item[data-view="models"]::before { content: "⚙"; }
.nav-item[data-view="bi"]::before { content: "▥"; }
.nav-item[data-view="more-tools"]::before { content: "⊞"; }
.nav-item:hover { color: var(--ink); background: #f2f3f5; }
.nav-item.active { color: var(--primary); background: var(--soft); font-weight: 600; }
.nav-item.active::before { color: var(--primary); }
.sidebar-card {
  padding: 14px;
  border: 1px solid #bedaff;
  border-radius: var(--arco-radius-lg);
  background: linear-gradient(145deg, #f7fbff, #e8f3ff);
}
.sidebar-card span, .sidebar-card small { color: #4e5969; }
.sidebar-card strong { margin: 5px 0; color: var(--primary); font-size: 22px; }
.sidebar-toggle {
  right: -13px;
  top: 24px;
  width: 26px;
  height: 26px;
  border-color: var(--line);
  border-radius: 50%;
  color: #4e5969;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
  font-size: 18px;
}
.app-shell.sidebar-collapsed .sidebar { width: 64px; padding: 16px 10px; }
.app-shell.sidebar-collapsed .nav-item { height: 40px; min-height: 40px; border-radius: 6px; }
.app-shell.sidebar-collapsed .nav-item { display: grid; place-items: center; gap: 0; }
.app-shell.sidebar-collapsed .nav-item::before { content: attr(data-short); display: grid; width: auto; height: auto; font-size: 13px; }

.main { padding: 0 24px 32px; }
.topbar {
  min-height: 64px;
  margin: 0 -24px 20px;
  padding: 0 24px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 22;
  backdrop-filter: blur(10px);
}
.topbar h2 { margin: 2px 0 0; font-size: 20px; line-height: 1.3; }
.eyebrow { color: #86909c; letter-spacing: .04em; font-size: 11px; }

.hero {
  gap: 24px;
  padding: 28px 32px;
  border: 1px solid #bedaff;
  border-radius: var(--arco-radius-lg);
  background: linear-gradient(120deg, #fff 0%, #f7fbff 54%, #e8f3ff 100%);
  box-shadow: none;
}
.hero h3 { max-width: 920px; margin: 10px 0; font-size: clamp(26px, 2.5vw, 34px); }
.hero p { color: #4e5969; }
.hero-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: center; }

.metric, .card, .panel, .task-item, .asset-card, .model-item, .quota-card, .mini-card,
.reference-box, .parameter-box, .preview-box, .product-item {
  border-color: var(--line);
  border-radius: var(--arco-radius-lg);
  box-shadow: none;
}
.metric { padding: 16px; background: rgba(255,255,255,.9); }
.metric span { color: #86909c; font-size: 12px; }
.metric strong { margin-top: 4px; font-size: 25px; }
.card, .panel { padding: 20px; }
.card:hover, .asset-card:hover, .model-item:hover, .task-item:hover {
  border-color: #bedaff;
  box-shadow: 0 6px 18px rgba(22, 93, 255, .07);
}
.card h4, .panel h3, .section-title h3 { color: var(--ink); font-weight: 600; }
.card p, .panel p { color: #4e5969; }
.section-title { margin: 22px 0 12px; }
.section-title.compact { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.split, .grid, .asset-grid { gap: 16px; }

label { color: #4e5969; font-size: 13px; font-weight: 500; gap: 6px; }
input, textarea, select {
  min-height: 36px;
  padding: 8px 11px;
  border-color: #c9cdd4;
  border-radius: 6px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, textarea:hover, select:hover { border-color: #86909c; }
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22,93,255,.12);
}
input::placeholder, textarea::placeholder { color: #c9cdd4; }
textarea { min-height: 96px; }
input[type="checkbox"], input[type="radio"] { min-height: 0; accent-color: var(--primary); }

.primary, .secondary, .ghost, .asset-admin-only {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.primary { background: var(--primary); box-shadow: none; }
.primary:hover { background: #4080ff; }
.primary:active, .secondary:active, .ghost:active { transform: translateY(1px); }
.secondary { color: var(--primary); background: var(--soft); }
.secondary:hover { background: #dbeaff; }
.ghost { color: #4e5969; border-color: #c9cdd4; background: #fff; }
.ghost:hover { color: var(--primary); border-color: #94bfff; background: #f7fbff; }
button:disabled { cursor: not-allowed; opacity: .55; }
.badge, .tag, .status { border-radius: 4px; font-weight: 500; }
.badge { background: var(--soft); color: var(--primary); }
.status.running { color: #165dff; background: #e8f3ff; }
.status.done { color: #00b42a; background: #e8ffea; }
.status.failed { color: #f53f3f; background: #ffece8; }
.status.pending, .status.partial { color: #ff7d00; background: #fff7e8; }

.task-list, .model-list, .product-list { gap: 10px; }
.task-item { padding: 16px 18px; background: #fff; }
.task-image-slot { border-radius: 6px; background: #f7f8fa; }
.task-image-slot.pending { background: linear-gradient(110deg, #f2f3f5 8%, #fff 18%, #f2f3f5 33%); background-size: 200% 100%; animation: arco-shimmer 1.5s linear infinite; }
@keyframes arco-shimmer { to { background-position-x: -200%; } }
.asset-card { background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; }
.asset-card:hover { transform: translateY(-2px); }
.asset-thumb { background: #f7f8fa; }
.asset-thumb.image-real { background: #f2f3f5; }
.asset-thumb.image-real img { object-fit: contain; }
.asset-body { padding: 14px 16px 16px; }
.asset-reference { background: #f7f8fa; }
.tag { color: #4e5969; background: #f2f3f5; }
.model-item { padding: 16px 18px; }
.switch { background: #c9cdd4; }
.switch.on { background: var(--primary); }
.quota-card strong { color: var(--ink); }

.preview-box, .reference-box { background: #f7f8fa; border-color: #c9cdd4; }
.parameter-box { background: #fff; }
.reference-preview { border-radius: 6px; background: #f7f8fa; }
.reference-focus { border-color: #bedaff; border-radius: 8px; background: #f7fbff; }
.preset-hint { border: 1px solid #bedaff; border-radius: 6px; background: #f7fbff; color: #165dff; }

.toast {
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
}
.auto-close-notice { background: rgba(0,0,0,.32); }
.auto-close-notice-dialog { border-radius: 10px; box-shadow: 0 10px 36px rgba(0,0,0,.18); }
.auto-close-notice-close { border-radius: 6px; }

.image-preview-dialog { border-radius: 12px !important; box-shadow: 0 12px 48px rgba(0,0,0,.28) !important; }
.image-action-link { border-radius: 6px !important; }

/* Keep the canvas dark, but align its controls with the global blue system. */
.board-shell { gap: 12px; }
.board-chat-panel, .board-workspace { border-radius: 12px; }
.board-chat-panel { border-color: #272e3b; box-shadow: none; }
.board-chat-panel textarea, .board-generate-options select, .board-project-head select { border-radius: 6px; }
.board-project-add, .board-toolbar button, .board-zoom-controls button { border-radius: 6px; }
.board-selected-thumb { border-color: #4080ff; border-radius: 6px; }
.board-selection-box { border-color: #4080ff; background: rgba(22,93,255,.14); }
.board-node { border-radius: 6px; }
.board-node.selected { border-color: #4080ff; box-shadow: 0 0 0 3px rgba(22,93,255,.18), 0 14px 34px rgba(0,0,0,.32); }
.board-node-resize { background: #4080ff; }
.board-node-menu, .board-toolbar, .board-zoom-controls { border-radius: 8px; }
.board-node-menu button { border-radius: 5px; }
.board-node-menu button:hover, .board-toolbar button:hover, .board-toolbar button.active, .board-zoom-controls button:hover { color: #fff; background: #165dff; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .hero-panel { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 1020px) {
  .sidebar { width: 220px; }
  .main { padding-left: 58px; }
}
@media (max-width: 680px) {
  .main { padding: 0 12px 24px 54px; }
  .topbar { margin: 0 -12px 16px; padding: 12px; }
  .hero { padding: 22px 18px; }
  .hero-panel { grid-template-columns: 1fr; }
  .metric strong { font-size: 22px; }
}

/* Runtime components are injected after stylesheets, so use specific overrides. */
body .stage2-userbar { padding: 0 12px; min-height: 36px; border-radius: 6px; color: #4e5969; }
body .stage2-login-mask { background: rgba(0,0,0,.42); backdrop-filter: blur(3px); }
body .stage2-login { width: min(430px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 48px rgba(0,0,0,.18); }
body .stage2-login h3 { font-size: 18px; }
body .stage2-user-item { padding: 14px 16px; border-radius: 8px; }
body .stage2-user-costs span { border-radius: 4px; background: #f2f3f5; }
body .quick-asset-picker { border-radius: 8px; background: #f7f8fa; }
body .quick-asset-option { border-radius: 6px; box-shadow: none; }
body .quick-asset-option.selected { border-color: #165dff; box-shadow: 0 0 0 2px rgba(22,93,255,.12); }
body .quick-asset-option img { border-radius: 4px; }
body .task-card-modern { padding: 16px 18px !important; }
body .task-retry-btn { border-color: #bedaff; border-radius: 4px; background: #e8f3ff; color: #165dff; font-weight: 500; }
body .task-retry-btn:hover { background: #dbeaff; }
body .task-image-preview { border-radius: 6px; background: #f7f8fa; }
body .task-page-jump input { border-radius: 6px; }
body .image-preview-dialog { border-radius: 12px; box-shadow: 0 12px 48px rgba(0,0,0,.28); }
body .image-preview-dialog img { border-radius: 8px; }
body .image-preview-dialog .image-action-link { border-radius: 6px !important; background: #165dff !important; box-shadow: none !important; font-weight: 500 !important; }
body .image-preview-nav { color: #165dff; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
body .image-preview-nav:hover { color: #fff; background: #165dff; }
.board-readonly .board-node { cursor: default !important; }
.board-chat-panel.board-readonly textarea, .board-chat-panel.board-readonly select { opacity: .62; pointer-events: none; }
.board-chat-panel.board-readonly .board-chat-copy::after { content: "管理员正在只读查看其他用户的画板"; display: inline-flex; width: fit-content; margin-top: 12px; padding: 5px 9px; border-radius: 4px; background: rgba(22,93,255,.16); color: #94bfff; font-size: 12px; }
