:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #ff6b4a;
  --primary-hover: #f05538;
  --danger: #e11d48;
  --success: #16a34a;
  --warning: #d97706;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 17, 23, 0.95);
  position: sticky;
  top: 0;
  z-index: 10;
  min-width: 0;
}

.main-nav {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: visible;
}
.nav-rail {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}
.nav-more-wrap {
  position: relative;
  flex-shrink: 0;
}
.nav-more-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.nav-sort-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.nav-sort-btn.active,
.nav-sort-btn[aria-pressed="true"] {
  border-color: rgba(13, 148, 136, 0.55);
  color: #0f766e;
  background: rgba(13, 148, 136, 0.12);
}
.main-nav.nav-sort-mode .nav-btn {
  cursor: grab;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.35);
}
.main-nav.nav-sort-mode .nav-btn:active {
  cursor: grabbing;
}
.nav-more-btn[aria-expanded="true"],
.nav-more-btn.has-active {
  border-color: rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.12);
}
.nav-more-caret,
.header-account-caret {
  font-size: 0.7em;
  opacity: 0.75;
  line-height: 1;
}
.nav-more-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 10.5rem;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 1200;
}
.nav-more-panel .nav-btn {
  width: 100%;
  justify-content: flex-start;
  border-radius: 8px;
  text-align: left;
}
.nav-more-panel[hidden],
.header-account-menu[hidden] {
  display: none !important;
}
.main-nav.nav-sorting {
  cursor: grabbing;
}
.main-nav.nav-sorting .nav-btn {
  cursor: grabbing;
}
.main-nav.nav-sorting .nav-more-panel {
  display: flex !important;
}

.nav-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  user-select: none;
  touch-action: manipulation;
  will-change: transform;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
a.nav-btn {
  text-decoration: none;
  display: inline-block;
}
.nav-btn:active { cursor: pointer; }
.main-nav.nav-sorting .nav-btn { cursor: grab; }
.main-nav.nav-sorting .nav-btn:active { cursor: grabbing; }
.nav-btn.nav-dragging,
.nav-btn.nav-placeholder {
  opacity: 0.35;
  border-style: dashed;
  border-color: rgba(46, 229, 157, 0.55);
  color: transparent;
  background: rgba(46, 229, 157, 0.08);
  box-shadow: none;
}

.nav-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  margin: 0;
  pointer-events: none;
  opacity: 0.95;
  border-color: rgba(46, 229, 157, 0.75) !important;
  background: #1b2230 !important;
  color: #e8ecf4 !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(46, 229, 157, 0.25);
  transform: translate(-9999px, -9999px);
  will-change: transform;
}

.nav-btn.active {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.45);
}

.header-status {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
  min-width: 0;
}

.header-account {
  position: relative;
  flex-shrink: 0;
}
.header-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 9.5rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.header-account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 7rem;
}
.header-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 10rem;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 1200;
}
.header-account-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
}
.header-account-item:hover {
  background: rgba(148, 163, 184, 0.12);
}
.header-account-item[hidden] {
  display: none !important;
}
.header-account-logout {
  color: var(--danger);
  margin-top: 2px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
}

.ctx-usage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 2px 2px;
  border: none;
  background: transparent;
  min-width: 0;
  user-select: none;
  white-space: nowrap;
  cursor: default;
}

.ctx-ring {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}

.ctx-ring-track,
.ctx-ring-fill {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
}

.ctx-ring-track {
  stroke: #cbd5e1;
}

.ctx-ring-fill {
  stroke: #16a34a;
  /* circumference = 2πr ≈ 94.25 for r=15 */
  stroke-dasharray: 94.25;
  stroke-dashoffset: 94.25;
  transition: stroke-dashoffset 0.4s ease, stroke 0.25s ease;
}

.ctx-usage-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1;
  min-width: 2.5em;
  color: #0f172a;
}

.ctx-usage[data-level="idle"] .ctx-usage-pct {
  color: #64748b;
  font-weight: 600;
}

.ctx-usage[data-level="idle"] .ctx-ring-fill {
  stroke: #94a3b8;
}

.ctx-usage[data-level="ok"] .ctx-ring-fill {
  stroke: #16a34a;
}

.ctx-usage[data-level="ok"] .ctx-usage-pct {
  color: #15803d;
}

.ctx-usage[data-level="warn"] .ctx-ring-fill {
  stroke: #d97706;
}

.ctx-usage[data-level="warn"] .ctx-usage-pct {
  color: #b45309;
}

.ctx-usage[data-level="crit"] .ctx-ring-fill {
  stroke: #e11d48;
  animation: ctx-usage-pulse 1.6s ease-in-out infinite;
}

.ctx-usage[data-level="crit"] .ctx-usage-pct {
  color: #be123c;
}

@keyframes ctx-usage-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.brand {
  flex-shrink: 0;
  min-width: 0;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  border-radius: 8px;
}
.brand:hover h1 {
  color: #1d4ed8;
}
.brand:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
.brand h1 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
  white-space: nowrap;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}


.view-panel.hidden { display: none !important; }

.full-width { grid-column: 1 / -1; }
.full-width.narrow { max-width: 720px; margin: 0 auto; width: 100%; }

.split-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  min-height: 480px;
  min-width: 0;
  max-width: 100%;
}

.editor-panel {
  border-left: 1px solid var(--border);
  padding-left: 20px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.persona-list.wide, .script-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
}

.script-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: pointer;
}

.script-item.active { border-color: var(--primary); }
.script-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.script-item-main .muted {
  color: var(--muted);
  font-size: 0.78rem;
}
.script-meta { flex: 1; min-width: 0; }
.script-meta strong { display: block; margin-bottom: 4px; }
.script-meta span { color: var(--muted); font-size: 0.78rem; }
.script-preview {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.info-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.intent-row { margin-bottom: 10px; }
.intent-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  font-size: 0.82rem;
}

.event-kind {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}
.event-chat { background: rgba(99, 102, 241, 0.2); color: #c7d2fe; }
.event-enter { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.event-gift { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }

.empty-state.small { padding: 24px 12px; }
.empty-state.small p { margin: 0; }

@media (max-width: 1200px) {
  .header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 8px 12px;
  }
  .brand p { display: none; }
  .split-layout { grid-template-columns: 1fr; }
  .editor-panel { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; }
}

@media (max-width: 720px) {
  .header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand status"
      "nav nav";
  }
  .brand { grid-area: brand; }
  .main-nav { grid-area: nav; justify-content: flex-start; }
  .header-status { grid-area: status; }
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
}

.badge-online { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-offline { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.badge-ready { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.badge-warn { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }

.layout {
  display: grid;
  grid-template-columns: 320px 1fr 380px;
  gap: 16px;
  padding: 16px;
  min-height: calc(100vh - 72px);
}

#view-monitor.layout {
  grid-template-columns: 320px 1fr;
  height: calc(100dvh - 72px);
  max-height: calc(100dvh - 72px);
  overflow: hidden;
  align-items: stretch;
}

/* 左侧独立滚动；右侧弹幕区始终落在首屏，不必整页下拉 */
#view-monitor .panel-left {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

#view-monitor .panel-center {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#view-monitor .message-feed {
  min-height: 0;
}

#view-monitor .empty-state {
  margin: 2.5rem auto 0;
  padding: 24px 20px;
}

.monitor-sim-panel > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  user-select: none;
}
.monitor-sim-panel > summary::-webkit-details-marker { display: none; }
.monitor-sim-panel > summary h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.monitor-sim-panel > summary h2::after {
  content: "▸";
  font-size: 0.85em;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.monitor-sim-panel[open] > summary h2::after {
  transform: rotate(90deg);
}
.monitor-sim-panel > summary .hint { margin: 0; }
.monitor-sim-body { margin-top: 12px; }

.panel { min-height: 0; }
.panel-left, .panel-right { display: flex; flex-direction: column; gap: 16px; }
.panel-center { display: flex; flex-direction: column; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0;
  font-size: 1rem;
}

.field { margin-bottom: 12px; min-width: 0; max-width: 100%; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.host-profile-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.host-profile-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
}
.host-profile-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 10px;
}
.host-avatar-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.host-avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #ff8a6a 0%, #e85a3a 55%, #c2410c 100%);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 16px rgba(232, 90, 58, 0.22);
}
.host-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.host-avatar-hint {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.host-avatar-btn:hover .host-avatar-hint {
  color: var(--text);
}
.host-profile-fields {
  flex: 1;
  min-width: 0;
}
.host-profile-fields .field {
  margin-bottom: 8px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }
.btn-small { padding: 6px 10px; font-size: 0.82rem; background: var(--panel); color: var(--text); border: 1px solid var(--border); }

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 0.9rem;
}

.persona-list { display: flex; flex-direction: column; gap: 8px; }

.persona-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  cursor: pointer;
}

.persona-item.active { border-color: var(--primary); }
.persona-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.persona-meta { flex: 1; min-width: 0; }
.persona-meta strong { display: block; font-size: 0.92rem; }
.persona-meta span { color: var(--muted); font-size: 0.78rem; }

.toggle {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #334155;
  position: relative;
  border: none;
  cursor: pointer;
}

.toggle.on { background: var(--primary); }
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: 0.15s ease;
}

.toggle.on::after { transform: translateX(18px); }

.message-feed {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.empty-state {
  margin: auto;
  text-align: center;
  color: var(--muted);
  max-width: 420px;
  padding: 40px 20px;
}

.message-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.message-head .btn-graph-relation {
  flex-shrink: 0;
  white-space: nowrap;
}

.message-user {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel);
  border: 1px solid var(--border);
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.message-time { color: var(--muted); font-size: 0.78rem; }
.message-content {
  padding: 10px 12px;
  background: var(--panel);
  border-radius: 10px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.reply-grid { display: grid; gap: 10px; }
.reply-slots { display: grid; gap: 10px; }

.reply-item {
  border-left: 3px solid var(--primary);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 10px 10px 0;
}
.reply-item.reply-pending {
  opacity: 0.92;
  background: rgba(255, 255, 255, 0.035);
}
.reply-item.reply-ready {
  animation: reply-pop 0.28s ease-out;
}
@keyframes reply-pop {
  from { opacity: 0.55; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.reply-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  min-height: 28px;
}
.reply-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #2ee59d;
  border-radius: 50%;
  animation: reply-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes reply-spin {
  to { transform: rotate(360deg); }
}
.intent-row.intent-pending { color: var(--muted); }
.reply-progress { margin-top: 2px; }

.reply-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.reply-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.reply-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
}

.reply-text { line-height: 1.55; white-space: pre-wrap; }
.reply-error { color: #fca5a5; font-size: 0.85rem; }

.reply-tag.compliance-hit {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.reply-item.compliance-flagged {
  border-left-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.06);
}
.compliance-hits-line {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #fca5a5;
  line-height: 1.4;
}
.compliance-hit-word {
  display: inline-block;
  margin: 0 4px 2px 0;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.douyin-rules-card .douyin-rules-summary {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.douyin-rules-details {
  margin: 8px 0 10px;
}
.douyin-rules-details summary {
  cursor: pointer;
  color: var(--text);
  font-size: 0.84rem;
  margin-bottom: 8px;
}
.douyin-rule-cat {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.15);
}
.douyin-rule-cat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.douyin-rule-cat-head strong {
  font-size: 0.84rem;
}
.douyin-sev {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.15);
  color: #fcd34d;
}
.douyin-sev.block {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}
.douyin-rule-cat .hint {
  margin: 0 0 6px;
  font-size: 0.75rem;
}
.douyin-rule-cat textarea {
  width: 100%;
  min-height: 52px;
  font-size: 0.8rem;
  resize: vertical;
}
.douyin-custom-words {
  width: 100%;
  margin: 4px 0 8px;
  font-size: 0.8rem;
}
.douyin-scan-box {
  display: flex;
  gap: 8px;
  align-items: center;
}
.douyin-scan-box input {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
}
.douyin-scan-result {
  margin-top: 6px;
  font-size: 0.78rem;
  white-space: pre-wrap;
}
.douyin-scan-result.has-hits {
  color: #fca5a5;
}

.reply-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.gen-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.gen-controls label {
  font-size: 0.78rem;
  color: var(--muted);
}

.gen-count {
  width: 52px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: inherit;
  font-size: 0.82rem;
}

.manual-gens {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.manual-gens.hidden { display: none; }

.manual-gen-item {
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.06);
}

.manual-gen-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.card-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tts-config {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}

.tts-config select {
  max-width: 120px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: inherit;
  font-size: 0.78rem;
}

.tts-config select#ttsPitch,
.tts-config select#ttsVol,
.tts-config select#ttsSpeed {
  max-width: 72px;
}

.tts-btn {
  border-color: rgba(56, 189, 248, 0.45) !important;
  color: #7dd3fc !important;
}

.tts-config .tts-express {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.polish-toggle.on {
  border-color: rgba(34, 197, 94, 0.55);
  color: #86efac;
}

.polish-toggle.off {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.adopt-btn {
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #fcd34d !important;
}

.reply-debug {
  display: none !important;
}

.reply-debug summary {
  cursor: pointer;
  color: #a5b4fc;
  font-size: 0.82rem;
  user-select: none;
}

.debug-block { margin-top: 10px; }

.debug-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.debug-pre {
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #12151c;
  border: 1px solid var(--border);
  color: #dbe4ff;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: 220px;
  overflow: auto;
}

.debug-prompt { max-height: 360px; }

.prompt-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

.prompt-area {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  min-height: 120px;
}

.placeholder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.placeholder-chips code {
  background: #12151c;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.72rem;
  color: #c7d2fe;
}

.prompt-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0 14px;
}

.prompt-test-result {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: rgba(0,0,0,0.18);
}

.prompt-test-result .reply-main {
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 8px 0 12px;
}

@media (max-width: 1200px) {
  .prompt-grid { grid-template-columns: 1fr; }
}


.hidden { display: none !important; }

.persona-editor { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow: auto; }

/* 音效台 */
.sfx-deck-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 8px 0;
}
/* —— 底部音乐播放台（汽水青绿） —— */
.sfx-music-dock {
  --sfx-bar: #1a9f6e;
  --sfx-bar-deep: #128a61;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  z-index: 900;
  width: min(1100px, calc(100% - 24px));
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: "DIN Alternate", "Avenir Next", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  color: #eef8f2;
}
.sfx-music-dock.idle { display: none; }
.sfx-music-dock.minimized { display: none !important; }
body:has(.sfx-music-dock:not(.idle):not(.minimized)) { padding-bottom: 480px; }

.sfx-music-lyric-panel {
  background: linear-gradient(180deg, #07110e 0%, #0d1f18 100%);
  border: 1px solid rgba(46, 229, 157, 0.28);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  padding: 12px 16px 10px;
  display: grid;
  grid-template-columns: 1.55fr 0.7fr;
  grid-template-rows: auto 1fr;
  gap: 8px 14px;
}
.sfx-music-dock-meta {
  grid-column: 1 / -1;
  text-align: left;
  margin-bottom: 0;
}
.sfx-battle-dock {
  min-height: 260px;
  max-height: 300px;
  overflow: auto;
  padding-right: 4px;
}
.sfx-battle-dock-top {
  margin-bottom: 8px;
}
.sfx-battle-dock-top > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.sfx-battle-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 5px;
  border-radius: 6px;
  background: #1a9f6e;
  color: #f0fff8;
  font-size: 0.72rem;
  font-weight: 700;
}
.sfx-battle-goal {
  font-size: 0.78rem;
  color: #2ee59d;
  font-weight: 600;
}
.sfx-battle-song-rhythm {
  font-size: 0.75rem;
  color: rgba(167, 243, 208, 0.85);
}
.sfx-battle-purpose {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(238, 248, 242, 0.88);
}
.sfx-battle-topics-hero {
  margin-bottom: 8px;
}
.sfx-battle-topics-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.sfx-battle-topics-head h4 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #a7f3d0;
}
.sfx-battle-topics-head small {
  font-size: 0.72rem;
  color: rgba(238, 248, 242, 0.55);
}
.sfx-battle-topic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sfx-battle-topic-card {
  border: 1px solid rgba(46, 229, 157, 0.28);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
}
.sfx-battle-topic-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.sfx-battle-topic-card-head strong {
  display: block;
  font-size: 0.95rem;
  color: #f4fff9;
}
.sfx-battle-topic-card-head em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 0.8rem;
  color: rgba(167, 243, 208, 0.8);
}
.sfx-topic-refresh {
  flex-shrink: 0;
  border: 1px solid rgba(46, 229, 157, 0.45);
  background: rgba(26, 159, 110, 0.25);
  color: #eef8f2;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}
.sfx-topic-refresh:hover { background: rgba(26, 159, 110, 0.45); }
.sfx-topic-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sfx-topic-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.18);
  color: #eef8f2;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
}
.sfx-topic-line:hover {
  border-color: rgba(46, 229, 157, 0.45);
  background: rgba(46, 229, 157, 0.12);
}
.sfx-topic-line .dot {
  flex-shrink: 0;
  width: 1.2rem;
  color: #2ee59d;
  font-weight: 700;
  font-size: 0.8rem;
}
.sfx-topic-line .line-txt { flex: 1; }
.sfx-topic-line .swap {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: rgba(167, 243, 208, 0.65);
}
.sfx-battle-more {
  margin-top: 6px;
  border-top: 1px dashed rgba(46, 229, 157, 0.25);
  padding-top: 6px;
}
.sfx-battle-more > summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: rgba(167, 243, 208, 0.75);
  list-style: none;
}
.sfx-battle-more > summary::-webkit-details-marker { display: none; }
.sfx-battle-dock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}
.sfx-battle-block h4 {
  margin: 0 0 4px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(167, 243, 208, 0.8);
}
.sfx-battle-block ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(238, 248, 242, 0.78);
}
.sfx-battle-block ul b { color: #2ee59d; }
.sfx-battle-dock-foot {
  margin-top: 6px;
  font-size: 0.72rem;
  color: rgba(238, 248, 242, 0.65);
}
.sfx-battle-dock-foot p { margin: 2px 0; }
.sfx-battle-taboo { color: rgba(255, 180, 160, 0.85) !important; }
.sfx-script-empty {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(238, 248, 242, 0.45);
}

.sfx-battle-mini {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(46, 229, 157, 0.28);
  background: linear-gradient(135deg, rgba(7, 17, 14, 0.92), rgba(26, 159, 110, 0.18));
}
.sfx-battle-mini.idle { opacity: 0.65; }
.sfx-battle-mini-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.sfx-battle-mini-head strong { font-size: 0.9rem; }
.sfx-battle-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.sfx-battle-tags .tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(46, 229, 157, 0.16);
  color: #a7f3d0;
}
.sfx-battle-manage h4 {
  margin: 12px 0 4px;
  font-size: 0.85rem;
}
.sfx-battle-manage-hero {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.sfx-battle-manage-hero p { margin: 4px 0 0; font-size: 0.88rem; }
.sfx-battle-float {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(46, 229, 157, 0.2);
  max-height: 220px;
  overflow: auto;
}
.sfx-lyric-float.lyrics-only .sfx-battle-float {
  display: none !important;
}
.sfx-lyric-float.lyrics-only .sfx-lyric-float-body {
  height: 220px;
}
.sfx-battle-float.hidden {
  display: none !important;
}
.sfx-lyric-float {
  width: min(460px, calc(100vw - 24px));
}
@media (max-width: 900px) {
  .sfx-music-lyric-panel,
  .sfx-battle-dock-grid {
    grid-template-columns: 1fr;
  }
  body:has(.sfx-music-dock:not(.idle):not(.minimized)) { padding-bottom: 560px; }
}

.sfx-tr-btn.active-toggle {
  background: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* 悬浮歌词 */
.sfx-lyric-float {
  position: fixed;
  z-index: 950;
  width: min(420px, calc(100vw - 24px));
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(46, 229, 157, 0.35);
  background: rgba(7, 17, 14, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  color: #eef8f2;
  font-family: "DIN Alternate", "Avenir Next", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  user-select: none;
}
.sfx-lyric-float.hidden { display: none !important; }
.sfx-lyric-float-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(26, 159, 110, 0.35);
  cursor: move;
}
.sfx-lyric-float-head strong {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sfx-lyric-float-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.sfx-lyric-float-actions .sfx-tr-btn {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}
.sfx-lyric-float-body {
  height: 180px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* 固定：穿透点击，仅标题栏可拖/关 */
.sfx-lyric-float.pinned {
  pointer-events: none;
  border-color: rgba(46, 229, 157, 0.55);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(46, 229, 157, 0.25);
}
.sfx-lyric-float.pinned .sfx-lyric-float-head {
  pointer-events: auto;
}

/* 最小化后的展开入口（播放台已隐藏时） */
.sfx-music-restore {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 940;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(26, 159, 110, 0.92);
  color: #f0fff8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  font-family: "DIN Alternate", "Avenir Next", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
}
.sfx-music-restore.visible { display: inline-flex; }
.sfx-music-restore:hover { background: #1a9f6e; }

.sfx-music-cat {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(167, 243, 208, 0.72);
}
.sfx-music-title {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f4fff9;
}
.sfx-music-now-hint {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: rgba(167, 243, 208, 0.55);
}
.sfx-music-lyrics {
  min-height: 120px;
  max-height: 160px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  text-align: center;
}
.sfx-lyric-line {
  margin: 0;
  padding: 4px 8px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(226, 245, 234, 0.55);
  opacity: 0.75;
  flex-shrink: 0;
  transition: color 0.2s ease, font-size 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}
.sfx-lyric-line.near {
  opacity: 0.9;
  color: rgba(226, 245, 234, 0.78);
}
.sfx-lyric-line.active {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  opacity: 1;
  transform: scale(1.03);
  text-shadow: 0 0 16px rgba(46, 229, 157, 0.45);
}
.sfx-lyric-line.muted {
  opacity: 0.55;
  color: rgba(167, 243, 208, 0.5);
}

.sfx-music-transport {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 14px 12px;
  background: var(--sfx-bar);
  border-radius: 0 0 14px 14px;
}
.sfx-transport-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sfx-tr-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.sfx-tr-btn:hover { background: rgba(255, 255, 255, 0.14); }
.sfx-tr-btn:active { transform: scale(0.94); }
.sfx-tr-btn[data-sfx-hotkey] {
  position: relative;
}
.sfx-tr-ico {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}
.sfx-tr-skip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f4fff9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.sfx-tr-skip:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(167, 243, 208, 0.45);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.sfx-tr-skip:active {
  background: rgba(46, 229, 157, 0.28);
  border-color: rgba(46, 229, 157, 0.5);
}
.sfx-tr-duck {
  margin-left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #a7f3d0;
}
.sfx-tr-duck:hover {
  background: rgba(46, 229, 157, 0.22);
  color: #fff;
}
.sfx-tr-climax {
  margin-left: 4px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
}
.sfx-tr-climax:hover {
  background: rgba(251, 191, 36, 0.32);
  color: #fff;
}
.sfx-climax-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 2px;
  min-height: 28px;
}
.sfx-climax-dock-label {
  font-size: 0.78rem;
  color: #fde68a;
  min-width: 7.5em;
}
.sfx-climax-dock-label.is-empty {
  color: rgba(255, 255, 255, 0.55);
}
.sfx-climax-btn {
  appearance: none;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.14);
  color: #fef3c7;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
}
.sfx-climax-btn:hover {
  background: rgba(251, 191, 36, 0.3);
  color: #fff;
}
.sfx-climax-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.sfx-climax-btn.sfx-climax-jump {
  border-color: rgba(46, 229, 157, 0.45);
  background: rgba(46, 229, 157, 0.14);
  color: #bbf7d0;
}
.sfx-control-tip {
  position: fixed;
  z-index: 1200;
  max-width: 240px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(6, 18, 14, 0.94);
  border: 1px solid rgba(46, 229, 157, 0.45);
  color: #eef8f2;
  font-size: 0.82rem;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  opacity: 0;
  transition: opacity 0.15s ease;
}
.sfx-control-tip.show { opacity: 1; }
.sfx-control-tip .sfx-tip-hotkey {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(46, 229, 157, 0.22);
  border: 1px solid rgba(46, 229, 157, 0.45);
  color: #a7f3d0;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.sfx-tr-play {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  font-size: 1.05rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}
.sfx-tr-play:hover {
  background: rgba(255, 255, 255, 0.32);
}
.sfx-tr-play.is-playing {
  background: rgba(46, 229, 157, 0.38);
  border-color: rgba(46, 229, 157, 0.55);
  box-shadow: 0 0 0 2px rgba(46, 229, 157, 0.35);
  animation: sfxPlayPulse 1.6s ease-in-out infinite;
}
@keyframes sfxPlayPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(46, 229, 157, 0.28); }
  50% { box-shadow: 0 0 0 5px rgba(46, 229, 157, 0.12); }
}
.sfx-tr-close {
  margin-left: 6px;
  opacity: 0.9;
}
.sfx-transport-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sfx-wave-row {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.92);
}
.sfx-music-wave {
  width: 100%;
  height: 44px;
  display: block;
  cursor: pointer;
  border-radius: 4px;
}
.sfx-vol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 340px;
}
.sfx-vol-ico { font-size: 0.85rem; opacity: 0.95; }
.sfx-vol-row input[type="range"] {
  flex: 1;
  accent-color: #9affd4;
  height: 4px;
  min-width: 72px;
}
.sfx-vol-row .sfx-tr-btn {
  width: auto;
  min-width: 34px;
  padding: 0 8px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.sfx-music-playlist {
  margin: 0 10px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.sfx-music-playlist.hidden { display: none; }
.sfx-music-playlist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
}
.sfx-music-playlist-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sfx-music-playlist-count {
  font-size: 0.75rem;
  opacity: 0.7;
}
.sfx-music-playlist-close {
  width: auto !important;
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  font-size: 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
}
.sfx-music-playlist-body {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}
.sfx-music-playlist-empty {
  padding: 16px 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
}
.sfx-music-playlist-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
}
.sfx-music-playlist-item:hover {
  background: rgba(255, 255, 255, 0.1);
}
.sfx-music-playlist-item.is-current {
  background: rgba(154, 255, 212, 0.16);
  color: #9affd4;
}
.sfx-music-playlist-idx {
  opacity: 0.55;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
}
.sfx-music-playlist-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sfx-music-playlist-now {
  font-size: 0.72rem;
  opacity: 0.85;
  white-space: nowrap;
}
body:has(.sfx-music-dock.playlist-open:not(.idle):not(.minimized)) {
  padding-bottom: 680px;
}
@media (max-width: 720px) {
  .sfx-music-dock { width: calc(100% - 16px); bottom: 8px; }
  .sfx-music-transport { grid-template-columns: 1fr; gap: 8px; }
  .sfx-transport-btns { justify-content: center; }
  .sfx-vol-row { max-width: none; }
  body:has(.sfx-music-dock.playlist-open:not(.idle):not(.minimized)) {
    padding-bottom: 720px;
  }
}

.sfx-quick-pad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sfx-quick-pad-cats {
  grid-template-columns: 1fr 1fr;
}
.sfx-pad-btn.sfx-pad-cat {
  border-color: rgba(46, 229, 157, 0.22);
  background: rgba(46, 229, 157, 0.06);
}
.sfx-pad-btn.sfx-pad-cat:hover {
  border-color: rgba(46, 229, 157, 0.45);
  background: rgba(46, 229, 157, 0.14);
}
.sfx-pad-btn.sfx-pad-cat.active {
  border-color: rgba(46, 229, 157, 0.7);
  background: linear-gradient(135deg, rgba(46, 229, 157, 0.28), rgba(26, 159, 110, 0.18));
  box-shadow: inset 0 0 0 1px rgba(46, 229, 157, 0.25);
}
.sfx-pad-hotkey-hint {
  margin: 0 0 8px;
  font-size: 0.72rem;
}
.sfx-pad-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1em;
  margin-right: 6px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 700;
  color: #9affd4;
}
.sfx-pad-btn.sfx-pad-cat.active .sfx-pad-key {
  background: rgba(6, 40, 28, 0.35);
  border-color: rgba(6, 40, 28, 0.45);
  color: #06281c;
}
.sfx-pad-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.sfx-pad-btn:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.12);
}
.sfx-pad-btn small {
  color: var(--muted);
  font-size: 0.75rem;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}
.script-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
#view-sfx.hidden { display: none !important; }
#view-sfx .full-width { grid-column: 1 / -1; }

.sfx-media-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sfx-page-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
}
.sfx-media-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06);
}
.sfx-media-tab {
  border: 0;
  background: transparent;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted, #666);
}
.sfx-media-tab.active {
  background: #fff;
  color: var(--text, #1a1a1a);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.sfx-cat-heading {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted, #888);
}
.sfx-cat-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  max-height: 280px;
  overflow: auto;
}
.sfx-cat-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  color: var(--text, #222);
}
.sfx-cat-nav-item:hover {
  background: rgba(0, 0, 0, 0.06);
}
.sfx-cat-nav-item.active {
  border-color: rgba(0, 0, 0, 0.18);
  background: #1a1a1a;
  color: #fff;
}
.sfx-cat-nav-item .sfx-cat-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.sfx-group {
  margin-bottom: 10px;
}
.sfx-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text, #333);
  margin: 0 0 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
}
.sfx-group-empty {
  margin: 0 0 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--muted, #999);
}
.sfx-pad-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 10px 0;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}
.sfx-pad-tab {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.sfx-pad-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.sfx-pad-tab.active {
  border-color: rgba(46, 229, 157, 0.55);
  background: linear-gradient(180deg, #2ee59d, #1a9f6e);
  color: #06281c;
  box-shadow: 0 4px 14px rgba(46, 229, 157, 0.28);
}
.sfx-pad-tab[data-pad-media="sfx"].active {
  border-color: rgba(96, 165, 250, 0.55);
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
  color: #0b1e3a;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
}

/* 记忆管理 */
.memory-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}
.memory-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}
.memory-tab.active {
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
}
.memory-host-form {
  max-width: 860px;
}
.memory-fan-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.memory-fan-toolbar input[type="search"],
.memory-fan-toolbar select {
  min-width: 160px;
}
.memory-split {
  min-height: 520px;
}
.memory-fan-list {
  max-height: 70vh;
  overflow: auto;
}
.memory-fan-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.memory-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.memory-stat {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.memory-stat-k {
  font-size: 0.75rem;
  color: var(--muted);
}
.memory-stat-v {
  margin-top: 4px;
  font-size: 1.05rem;
  font-weight: 600;
}
.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}
.tier-badge.tier-new { color: #93a0b8; }
.tier-badge.tier-regular { color: #93c5fd; border-color: rgba(96, 165, 250, 0.4); }
.tier-badge.tier-supporter { color: #fcd34d; border-color: rgba(245, 158, 11, 0.45); }
.tier-badge.tier-whale { color: #f9a8d4; border-color: rgba(244, 114, 182, 0.5); }
.fan-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 28px;
}
.fan-fact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.8rem;
}
.fan-fact button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.memory-timeline {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.18);
}
.memory-tl-item {
  display: grid;
  grid-template-columns: 140px 64px 1fr;
  gap: 8px;
  font-size: 0.8rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(42, 49, 66, 0.6);
}
.memory-tl-item:last-child { border-bottom: 0; }
.memory-tl-time { color: var(--muted); }
.memory-tl-kind {
  color: #a5b4fc;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.script-item-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.knowledge-claims-list {
  max-height: 62vh;
}
.claim-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(42, 49, 66, 0.7);
}
.claim-row.health-danger,
.claim-row.health-expired {
  background: rgba(239, 68, 68, 0.08);
}
.claim-row.health-warning {
  background: rgba(245, 158, 11, 0.08);
}
.claim-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
  align-items: center;
}
.claim-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.knowledge-pre {
  max-height: 160px;
  white-space: pre-wrap;
  margin-bottom: 12px;
}
.dream-claims {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  max-height: 240px;
  overflow: auto;
}
.dream-claim-item {
  align-items: flex-start;
  gap: 8px;
}
.knowledge-contradict {
  grid-template-columns: 140px 72px 1fr;
}

@media (max-width: 1200px) {
  .layout { grid-template-columns: 1fr; }
  .panel-right { order: 3; }
  .persona-editor { position: static; max-height: none; }
  .split-layout { grid-template-columns: 1fr; }
  .memory-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memory-tl-item { grid-template-columns: 1fr; gap: 2px; }
}

/* —— 工作台 / 商品·记忆重设计 —— */
.workbench { display: flex; flex-direction: column; gap: 14px; }
.workbench-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.workbench-head h2 { margin: 0 0 4px; font-size: 1.25rem; letter-spacing: 0.02em; }
.workbench-sub { margin: 0; color: var(--muted); font-size: 0.86rem; max-width: 42rem; line-height: 1.45; }
.workbench-body.split-layout { min-height: 560px; min-width: 0; max-width: 100%; }
.workbench-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.workbench-rail-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.workbench-rail-tools input[type="search"],
.workbench-rail-tools select {
  min-width: 0;
  flex: 1 1 120px;
}
.shelf-list, .crm-list {
  max-height: 68vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.shelf-card, .crm-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.shelf-card:hover, .crm-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.06);
}
.shelf-card.active, .crm-card.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  transform: translateX(2px);
  box-shadow: inset 3px 0 0 var(--primary);
}
.shelf-card-avatar, .crm-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  color: #c7d2fe;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.35), rgba(14, 165, 233, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
  overflow: hidden;
}
.crm-avatar.tier-strip-new { border-left: 3px solid #93a0b8; }
.crm-avatar.tier-strip-regular { border-left: 3px solid #60a5fa; }
.crm-avatar.tier-strip-supporter { border-left: 3px solid #f59e0b; }
.crm-avatar.tier-strip-whale { border-left: 3px solid #f472b6; }
.shelf-card-body, .crm-card-body { min-width: 0; }
.shelf-card-title, .crm-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  min-width: 0;
}
.shelf-card-name,
.crm-card-title span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shelf-card-title .tier-badge {
  flex: 0 0 auto;
  white-space: nowrap;
}
.shelf-card-meta, .crm-card-meta {
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.shelf-card-meta-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shelf-card-meta .platform-badge {
  flex: 0 0 auto;
}
.shelf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.shelf-dot.off { background: #64748b; }

.platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: 0;
  padding: 0 6px;
  height: 18px;
  font-size: 0.65rem;
  line-height: 1;
  border-radius: 4px;
  border: 1px solid rgba(100, 116, 139, 0.35);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0;
  transform: none;
}
.platform-badge.plat-douyin { border-color: rgba(254, 44, 85, 0.5); background: #fe2c55; color: #fff; }
.platform-badge.plat-taobao,
.platform-badge.plat-tmall { color: #c2410c; border-color: rgba(234, 88, 12, 0.4); }
.platform-badge.plat-jd { color: #b91c1c; border-color: rgba(220, 38, 38, 0.4); }
.platform-badge.plat-pdd { color: #c026d3; border-color: rgba(192, 38, 211, 0.35); }

.platform-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.platform-link-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 8px;
  background: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.platform-link-main {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.platform-link-url {
  display: block;
  color: var(--accent, #2563eb);
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  word-break: normal;
}
.platform-link-copy,
.platform-link-main .btn-danger {
  flex: 0 0 auto;
}
.platform-link-meta {
  margin-left: 2px;
}
.platform-link-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

.collapsible-url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  vertical-align: baseline;
}
.collapsible-url .collapsible-url-text {
  display: inline-block;
  max-width: min(42ch, calc(100% - 4.5rem));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: bottom;
  color: var(--accent, #2563eb);
}
.collapsible-url-btn {
  flex-shrink: 0;
  padding: 1px 8px !important;
  font-size: 0.75rem !important;
}

.import-gaps-panel {
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(13, 148, 136, 0.25);
  border-radius: 10px;
  background: rgba(13, 148, 136, 0.06);
}
.import-gaps-panel.hidden { display: none !important; }
.import-gaps-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.import-gaps-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  line-height: 1.45;
}
.import-gaps-list .gap-hint {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 2px;
}
.import-gap-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.import-gap-item.is-key {
  border-color: rgba(255, 107, 74, 0.35);
  background: rgba(255, 107, 74, 0.06);
}
.import-gap-item.is-ok {
  border-color: rgba(13, 148, 136, 0.25);
  background: rgba(13, 148, 136, 0.06);
}

.seed-editor-backdrop .seed-editor-modal {
  width: min(920px, 96vw);
  max-height: min(92vh, 900px);
}
.seed-editor-top h3 { margin: 0 0 4px; color: #1e293b; }
.seed-editor-hint { margin: 0 0 8px; }
.seed-editor-actions {
  align-items: center;
}
.seed-autosave-status {
  margin-right: auto;
  color: #64748b;
  font-size: 0.82rem;
  min-height: 1.2em;
}
.seed-editor-body { background: #f7f8fa; }
.seed-editor {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.seed-editor-banner {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 18px rgba(15, 23, 42, 0.04);
}
.seed-editor-banner-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.seed-editor-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}
.seed-editor-meta { color: #64748b !important; }
.seed-title-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #64748b;
}
.seed-title-field input {
  min-width: min(420px, 70vw);
  font-size: 1.12rem;
  font-weight: 650;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
}
.seed-title-field input:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.seed-editor-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.seed-stat {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
}
.seed-stat.warn {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.1);
  border-color: rgba(13, 148, 136, 0.22);
}
.seed-stat.key {
  color: #c2410c;
  background: rgba(255, 107, 74, 0.1);
  border-color: rgba(255, 107, 74, 0.28);
}
.seed-editor-toolbar { display: flex; gap: 8px; }
.seed-filter-btn.is-active {
  background: rgba(13, 148, 136, 0.12) !important;
  border-color: rgba(13, 148, 136, 0.4) !important;
  color: #0f766e !important;
}
.seed-gap-rail {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.seed-gap-rail-title {
  font-size: 0.8rem;
  font-weight: 650;
  margin-bottom: 8px;
  color: #475569;
}
.seed-gap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.seed-gap-chip {
  font-size: 0.78rem;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.22);
  color: #0f766e;
}
.seed-pending-empty {
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px dashed #cbd5e1;
}
.seed-pending-empty.hidden { display: none !important; }
.seed-sec {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.seed-sec.is-important-sec { border-color: #cbd5e1; }
.seed-sec.has-pending { border-color: rgba(13, 148, 136, 0.35); }
.seed-sec-hidden,
.seed-row-hidden { display: none !important; }
.seed-sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
}
.seed-sec-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
  font-size: 0.75rem;
  font-weight: 700;
}
.seed-sec-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.seed-sec-titles h4 { margin: 0; font-size: 1rem; color: #1e293b; }
.seed-sec-focus {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 107, 74, 0.1);
  color: #c2410c;
  border: 1px solid rgba(255, 107, 74, 0.25);
}
.seed-sec-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.seed-sec-badge.is-warn {
  background: rgba(13, 148, 136, 0.1);
  color: #0f766e;
  border: 1px solid rgba(13, 148, 136, 0.28);
}
.seed-sec-badge.is-ok {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.seed-sec-body { display: flex; flex-direction: column; }
.seed-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 8px 12px;
  align-items: start;
  padding: 10px 12px;
  border-top: 1px solid #f1f5f9;
}
.seed-row.is-pending { background: rgba(13, 148, 136, 0.05); }
.seed-row.is-key.is-pending { background: rgba(255, 107, 74, 0.06); }
.seed-row-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
  font-size: 0.86rem;
  color: #475569;
}
.seed-row-name { font-weight: 600; color: #334155; }
.seed-key-tag,
.seed-pending-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
}
.seed-key-tag {
  background: rgba(255, 107, 74, 0.12);
  color: #c2410c;
}
.seed-pending-tag {
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
}
.seed-pending-tag.hidden { display: none !important; }
.seed-row-input,
.seed-row-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  color: #0f172a;
}
.seed-row-input:focus,
.seed-row-textarea:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.seed-row.is-pending .seed-row-input,
.seed-row.is-pending .seed-row-textarea {
  border-color: rgba(13, 148, 136, 0.4);
  background: #fff;
}
.seed-row-textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.5;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.84rem;
}
.seed-row-url {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.seed-row-url .seed-row-input {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seed-row-url .btn {
  flex-shrink: 0;
}
.seed-sec-empty { padding: 12px; }
.seed-field-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #64748b;
  max-width: 28rem;
}
.seed-ex-btn {
  flex-shrink: 0;
  min-width: 2.2rem;
  color: #475569 !important;
  border-color: rgba(100, 116, 139, 0.35) !important;
  background: rgba(148, 163, 184, 0.12) !important;
}
.seed-block-tools {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.seed-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.seed-title-row input { flex: 1; min-width: 0; }
.seed-row-control {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}
.seed-row-control .seed-row-input,
.seed-row-control .seed-row-textarea {
  flex: 1;
  min-width: 0;
}
.seed-row-control-block {
  flex-direction: column;
}
.seed-row-control-block .seed-ai-btn {
  align-self: flex-end;
}
.seed-ai-btn {
  flex-shrink: 0;
  min-width: 2.4rem;
  padding: 4px 8px !important;
  font-weight: 650;
  color: #0f766e !important;
  border-color: rgba(13, 148, 136, 0.35) !important;
  background: rgba(13, 148, 136, 0.08) !important;
}
.seed-ai-btn.is-pending-ai {
  color: #c2410c !important;
  border-color: rgba(255, 107, 74, 0.4) !important;
  background: rgba(255, 107, 74, 0.1) !important;
}
.seed-ai-sec-btn {
  flex-shrink: 0;
  font-size: 0.75rem !important;
}
.seed-ai-batch-btn { white-space: nowrap; }
.seed-row.has-ai-panel,
.seed-sec.has-ai-panel {
  position: relative;
}
.seed-ai-popover {
  margin: 0 12px 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(13, 148, 136, 0.28);
  background: #f8fffd;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.seed-ai-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.seed-ai-popover-tools { display: flex; gap: 6px; }
.seed-ai-popover-meta { margin-bottom: 10px; }
.seed-ai-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}
.seed-ai-card {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.seed-ai-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.seed-ai-card-idx {
  margin-left: auto;
  font-size: 0.75rem;
  color: #64748b;
}
.seed-ai-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  color: #475569;
  background: #f8fafc;
}
.seed-ai-badge.conf-high {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.12);
  border-color: rgba(13, 148, 136, 0.3);
}
.seed-ai-badge.conf-medium {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}
.seed-ai-badge.conf-low {
  color: #64748b;
  background: #f1f5f9;
}
.seed-ai-badge.kind-factual {
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.35);
}
.seed-ai-badge.kind-inferred {
  color: #c2410c;
  border-color: rgba(255, 107, 74, 0.35);
}
.seed-ai-badge.kind-template {
  color: #475569;
}
.seed-ai-preview {
  font-size: 0.9rem;
  color: #0f172a;
  line-height: 1.45;
  margin-bottom: 4px;
}
.seed-ai-reason-short { margin-bottom: 8px; }
.seed-ai-card-actions { display: flex; gap: 6px; }
.seed-ai-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}
.seed-ai-detail-block { margin-bottom: 8px; }
.seed-ai-detail-block pre {
  margin: 6px 0 0;
  padding: 8px;
  border-radius: 6px;
  background: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  max-height: 160px;
  overflow: auto;
}
.seed-ai-detail-block p { margin: 4px 0 0; font-size: 0.86rem; }
.seed-ai-detail-block ul {
  margin: 4px 0 0;
  padding-left: 1.2em;
  font-size: 0.86rem;
}
.seed-ai-detail-block.risk {
  padding: 8px;
  border-radius: 6px;
  background: rgba(255, 107, 74, 0.08);
  border: 1px solid rgba(255, 107, 74, 0.25);
}
.seed-ai-batch-backdrop .seed-ai-batch-modal {
  width: min(720px, 94vw);
  max-height: min(86vh, 800px);
  display: flex;
  flex-direction: column;
}
.seed-ai-batch-list {
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}
.seed-ai-batch-row {
  display: grid;
  grid-template-columns: auto minmax(72px, 110px) auto auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
}
.seed-ai-batch-label { font-weight: 650; color: #334155; }
.seed-ai-batch-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seed-ai-warn { color: #b45309 !important; }
@media (max-width: 720px) {
  .seed-row { grid-template-columns: 1fr; }
  .seed-row-label { padding-top: 0; }
  .seed-ai-batch-row {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
  }
  .seed-title-field input { min-width: 0; width: 100%; }
  .seed-editor-banner-side { align-items: stretch; width: 100%; }
  .seed-editor-stats { justify-content: flex-start; }
}

.product-doc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.product-doc-card {
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 10px;
  background: rgba(255,255,255,0.55);
  overflow: hidden;
}
.product-doc-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
}
.product-doc-card-head:hover { background: rgba(0,0,0,0.03); }
.product-doc-kind {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(100,116,139,0.35);
  color: var(--muted);
}
.product-doc-kind.kind-import {
  color: #0369a1;
  border-color: rgba(3, 105, 161, 0.35);
  background: rgba(14, 165, 233, 0.08);
}
.product-doc-title {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-doc-meta {
  font-size: 0.75rem;
  color: var(--muted);
}
.product-doc-body {
  display: none;
  margin: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border, rgba(0,0,0,0.06));
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8rem;
  line-height: 1.5;
  background: rgba(0,0,0,0.02);
}
.product-doc-card.open .product-doc-body { display: block; }
.product-doc-empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 4px 0;
}

.browser-session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 10px;
  background: rgba(13, 148, 136, 0.08);
}
.browser-session-bar.ready {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.08);
}
.browser-session-bar.warn {
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(251, 191, 36, 0.12);
}
.browser-session-text { min-width: 220px; flex: 1; }
.browser-session-text strong { margin-right: 8px; }
#browserSessionStatus.is-ready { color: #15803d; font-weight: 600; }
#browserSessionStatus.is-warn { color: #b45309; font-weight: 600; }

.import-rail {
  margin: 8px 0 12px;
  padding: 8px;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.04);
}
.import-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.import-rail-head strong {
  font-size: 0.82rem;
}
.import-rail-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
}
.import-rail-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.import-rail-row.active .import-rail-item {
  border-color: rgba(37, 99, 235, 0.35);
  background: #fff;
}
.import-rail-item {
  display: block;
  flex: 1;
  min-width: 0;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255,255,255,0.65);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.import-rail-item:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #fff;
}
.import-rail-del {
  flex-shrink: 0;
  align-self: center;
  padding: 2px 8px !important;
  min-width: 0;
}
.import-rail-item .t {
  font-size: 0.84rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-rail-item .m {
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
}
.import-record-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
  padding: 4px 6px 4px 0;
}
.import-record-row.active {
  background: rgba(37, 99, 235, 0.08);
  box-shadow: inset 3px 0 0 #2563eb;
}
.import-record-row .import-record-item {
  border: 0;
  border-bottom: 0;
  background: transparent;
  flex: 1;
  min-width: 0;
}
.import-record-row .import-record-item:hover { background: transparent; }
.import-record-item.active {
  background: transparent;
  box-shadow: none;
}

.import-records-modal {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.import-records-modal > h3 {
  flex-shrink: 0;
}
.import-records-modal > .hint {
  flex-shrink: 0;
}
.import-records-modal > .ui-modal-actions {
  flex-shrink: 0;
  margin-top: 10px;
}
.import-records-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 10px;
  overflow: hidden;
}
.import-records-list {
  overflow: auto;
  border-right: 1px solid var(--border, rgba(0,0,0,0.08));
  background: rgba(0,0,0,0.02);
  min-height: 0;
}
.import-record-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.import-record-item:hover { background: rgba(0,0,0,0.04); }
.import-record-item.active {
  background: rgba(37, 99, 235, 0.08);
  box-shadow: inset 3px 0 0 #2563eb;
}
.import-record-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.import-record-meta {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}
.import-record-status {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
  padding: 0 5px;
  border-radius: 3px;
  border: 1px solid rgba(100,116,139,0.3);
}
.import-record-status.st-ok { color: #15803d; border-color: rgba(22,163,74,0.35); }
.import-record-status.st-partial { color: #b45309; border-color: rgba(217,119,6,0.35); }
.import-record-status.st-failed { color: #b91c1c; border-color: rgba(220,38,38,0.35); }
.import-records-preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}
.import-records-preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.06));
  flex-shrink: 0;
}
.import-records-preview-head h4 {
  margin: 0;
  flex: 1;
  min-width: 120px;
  font-size: 1.05rem;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}
.import-md-body {
  margin: 0;
  padding: 16px 18px 20px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  line-height: 1.65;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
}
.import-md-empty {
  padding: 28px 18px;
  color: var(--muted);
  font-size: 0.95rem;
}
.md-viewer-modal {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.md-viewer-modal > h3 {
  flex-shrink: 0;
  white-space: normal;
  word-break: break-word;
}
.md-viewer-modal > .ui-modal-actions {
  flex-shrink: 0;
  margin-top: 10px;
}
.md-viewer-modal .ui-modal-body {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  margin-bottom: 0;
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 10px;
}
.md-viewer-modal .import-md-body {
  max-height: none;
  height: 100%;
  box-sizing: border-box;
}

.ui-modal-backdrop.import-records-backdrop {
  padding: 10px;
  place-items: stretch;
  align-items: stretch;
}
.ui-modal-backdrop.import-records-backdrop .import-records-modal,
.ui-modal-backdrop.import-records-backdrop .md-viewer-modal {
  margin: auto;
}

@media (max-width: 720px) {
  .ui-modal.import-records-modal,
  .ui-modal.md-viewer-modal {
    width: calc(100vw - 8px);
    height: calc(100vh - 8px);
    max-height: calc(100vh - 8px);
  }
  .import-records-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(140px, 28%) 1fr;
  }
  .import-records-list {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border, rgba(0,0,0,0.08));
  }
}

#productEditor {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
#productForm {
  min-width: 0;
  max-width: 100%;
}

.dossier-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin: -4px -4px 14px;
  border-radius: 12px;
  background: rgba(23, 26, 34, 0.92);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.dossier-head h3 { margin: 0; font-size: 1.05rem; }
.dossier-head-meta { margin-top: 2px; font-size: 0.78rem; color: var(--muted); }
.dossier-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-back-list {
  display: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}

.seg-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.seg-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  transition: background 0.18s ease, color 0.18s ease;
}
.seg-tab.active {
  background: rgba(99, 102, 241, 0.28);
  color: #e0e7ff;
}

.wb-acc {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.18s ease;
}
.wb-acc[open] { border-color: rgba(99, 102, 241, 0.35); }
.wb-acc > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #dbe3f5;
  user-select: none;
}
.wb-acc > summary::-webkit-details-marker { display: none; }
.wb-acc > summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.75rem;
  transition: transform 0.18s ease;
}
.wb-acc[open] > summary::after { transform: rotate(-180deg); }
.wb-acc-body { padding: 0 14px 14px; min-width: 0; max-width: 100%; overflow-x: hidden; }

.row-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.row-editor-item {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}
.row-editor-item input,
.row-editor-item textarea {
  width: 100%;
  min-width: 0;
}
.row-editor-item textarea { min-height: 58px; resize: vertical; }
.dropzone {
  border: 1.5px dashed rgba(99, 102, 241, 0.45);
  border-radius: 12px;
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  background: rgba(99, 102, 241, 0.05);
  margin-bottom: 12px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
}
.adv-tools {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
}
.adv-tools > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 0.88rem;
  user-select: none;
}
.adv-tools > summary::-webkit-details-marker { display: none; }
.adv-tools-body { padding: 0 14px 14px; }

.host-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.75fr);
  gap: 16px;
  align-items: start;
}
.host-preview {
  position: sticky;
  top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  padding: 14px;
}
.host-preview h4 { margin: 0 0 8px; font-size: 0.88rem; color: #c7d2fe; }
.host-preview-body {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  min-height: 120px;
}
.host-section-label {
  margin: 4px 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.dossier-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.14);
}
.dossier-section h4 {
  margin: 0 0 10px;
  font-size: 0.86rem;
  color: #c7d2fe;
}
.dossier-section details > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.health-bar-wrap { margin-bottom: 14px; }
.health-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}
.health-bar > span { display: block; min-width: 0; transition: width 0.25s ease; }
.health-bar .h-healthy { background: #22c55e; }
.health-bar .h-watch { background: #38bdf8; }
.health-bar .h-warning { background: #f59e0b; }
.health-bar .h-danger { background: #f97316; }
.health-bar .h-expired { background: #64748b; }
.health-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}
.health-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.claim-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.18);
}
.claim-card .fresh-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin: 8px 0;
  overflow: hidden;
}
.claim-card .fresh-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  border-radius: 999px;
}
.dream-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}
.dream-steps span {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.dream-steps span.on {
  color: #c7d2fe;
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.15);
}

.ui-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}
.ui-empty-art {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.35), transparent 60%),
    linear-gradient(225deg, rgba(34, 211, 238, 0.25), transparent 55%),
    rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}
.ui-empty p { margin: 0; max-width: 16rem; line-height: 1.45; font-size: 0.9rem; }

.ui-toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  /* 须高于种子编辑器(1300) / 忙碌层(2000)，否则弹窗内操作的提示看不见 */
  z-index: 2200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.ui-toast {
  pointer-events: auto;
  min-width: 200px;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(30, 34, 48, 0.96);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.88rem;
  animation: toastIn 0.22s ease;
}
.ui-toast.ok { border-color: rgba(34, 197, 94, 0.45); }
.ui-toast.warn { border-color: rgba(245, 158, 11, 0.55); color: #fde68a; }
.ui-toast.err { border-color: rgba(239, 68, 68, 0.5); }
.ui-toast.out { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px); }
}

.ui-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(8, 10, 16, 0.62);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: toastIn 0.18s ease;
}
.ui-modal-backdrop.ui-busy-backdrop {
  z-index: 2000;
}
.seed-ai-btn.is-loading,
.seed-ai-batch-btn.is-loading,
.seed-ai-sec-btn.is-loading,
.seed-vision-btn.is-loading {
  opacity: 0.85;
  pointer-events: none;
}
.seed-btn-spin {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 6px;
  border: 2px solid rgba(15, 23, 42, 0.15);
  border-top-color: #0d9488;
  border-radius: 50%;
  animation: seed-btn-spin 0.7s linear infinite;
  vertical-align: -1px;
  flex-shrink: 0;
}
.seed-ai-batch-btn.is-loading .seed-btn-spin,
.btn-primary.is-loading .seed-btn-spin {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}
@keyframes seed-btn-spin {
  to { transform: rotate(360deg); }
}
.seed-vision-btn {
  color: #0f766e !important;
  border-color: rgba(13, 148, 136, 0.4) !important;
  background: rgba(13, 148, 136, 0.1) !important;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.seed-vision-btn .seed-btn-spin {
  border-color: rgba(13, 148, 136, 0.25);
  border-top-color: #0f766e;
}
.seed-file-input-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}
.seed-editor.is-drag-images {
  outline: 2px dashed rgba(13, 148, 136, 0.55);
  outline-offset: -6px;
  background: rgba(13, 148, 136, 0.06);
}
.seed-vision-backdrop {
  z-index: 2100 !important;
}
.seed-vision-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}
.seed-vision-list {
  overflow: auto;
  max-height: min(52vh, 480px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
  padding-right: 4px;
}
.seed-vision-row {
  display: grid;
  grid-template-columns: auto 7.5rem 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.seed-vision-label {
  font-weight: 600;
  color: #334155;
  font-size: 0.88rem;
}
.seed-vision-preview {
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: break-word;
}
.ui-modal {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.ui-modal.import-records-modal,
.ui-modal.md-viewer-modal {
  width: min(1600px, calc(100vw - 16px));
  max-width: none;
  height: calc(100vh - 16px);
  max-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  padding: 16px 20px 14px;
  box-sizing: border-box;
}
.ui-modal h3 { margin: 0 0 8px; font-size: 1.05rem; }
.ui-modal-body { color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 14px; }
.ui-modal-body .field { margin-bottom: 10px; }
.ui-modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.feature-spotlight {
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.12), rgba(0, 0, 0, 0.2));
  margin-bottom: 12px;
}

/* —— 讲品作战卡（关联商品，与音乐作战卡分工） —— */
.pitch-card-panel {
  margin: 12px 0;
  border: 1px solid rgba(234, 88, 12, 0.28);
  border-radius: 14px;
  padding: 12px 14px 14px;
  background: linear-gradient(165deg, rgba(255, 107, 74, 0.08), rgba(255, 255, 255, 0.04));
}
.pitch-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.pitch-card-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #ea580c;
}
.pitch-monitor-card .pitch-music-hint {
  margin: 0 0 10px;
  color: #c2410c;
}
.pitch-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-height: 62vh;
  overflow: auto;
}
.pitch-card-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.pitch-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pitch-fact {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(234, 88, 12, 0.1);
  border: 1px solid rgba(234, 88, 12, 0.22);
  font-size: 0.78rem;
  max-width: 100%;
}
.pitch-fact b {
  color: var(--muted);
  font-weight: 600;
}
.pitch-fact span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}
.pitch-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
.pitch-meta strong { color: inherit; }
.pitch-missing {
  margin: 0;
  font-size: 0.78rem;
  color: #b45309;
}
.pitch-story {
  border: 1px solid rgba(234, 88, 12, 0.3);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 247, 237, 0.55);
  min-width: 0;
}
.pitch-story-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.pitch-story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.pitch-story-head strong {
  display: block;
  font-size: 0.95rem;
  color: #c2410c;
}
.pitch-story-head .hint {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
}
.pitch-story-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pitch-story-p {
  padding: 8px 0;
  border-top: 1px dashed rgba(234, 88, 12, 0.2);
}
.pitch-story-p:first-child { border-top: 0; padding-top: 0; }
.pitch-story-p-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.pitch-story-p-head strong {
  font-size: 0.8rem;
  color: #9a3412;
}
.pitch-story-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.pitch-outline {
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.35);
}
.pitch-outline > summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}
.pitch-outline > summary::-webkit-details-marker { display: none; }
.pitch-ops,
.pitch-taboos,
.pitch-bridges {
  margin: 8px 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}
.pitch-taboos { color: #b91c1c; }
.pitch-bridges { color: #9a3412; font-style: italic; }
.pitch-sec {
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.45);
  min-width: 0;
  margin-top: 8px;
}
.pitch-sec-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  list-style: none;
}
.pitch-sec-head::-webkit-details-marker { display: none; }
.pitch-sec-head strong {
  font-size: 0.88rem;
}
.pitch-sec-head em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
}
.pitch-narration {
  margin: 8px 0 6px;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text);
}
.pitch-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pitch-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.pitch-line-text {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
}
.pitch-line .btn,
.pitch-story-p-head .btn {
  flex-shrink: 0;
  padding: 1px 8px;
  font-size: 0.72rem;
}

/* ─── 关系图谱 ─── */
.graph-workbench { display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - 140px); }
.graph-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.graph-stat-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.graph-stat-card.is-ready { background: #fff; border-color: #dbe4f0; }
.graph-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.graph-stat-card strong {
  font-size: 0.95rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.graph-split {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(220px, 300px);
  gap: 12px;
  align-items: start;
  min-height: 0;
}
.graph-rail { max-height: 620px; }
.graph-node-list { max-height: 520px; overflow: auto; }
.graph-node-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: inherit;
}
.graph-node-item:hover { background: #f1f5f9; }
.graph-node-item.active {
  background: #fff7ed;
  border-color: #fed7aa;
}
.graph-kind-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.graph-tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #475569;
  flex-shrink: 0;
}
.graph-tag.feat { background: #ffedd5; color: #c2410c; }
.graph-center {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  height: 560px;
  max-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  min-width: 0;
}
.graph-canvas-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.graph-canvas-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.graph-canvas {
  flex: 0 0 480px;
  width: 100%;
  height: 480px !important;
  min-height: 480px;
  max-height: 480px;
  background: #f1f5f9;
  overflow: hidden;
  cursor: grab;
  position: relative;
}
.graph-canvas .vis-network,
.graph-canvas canvas {
  max-height: 480px !important;
}
.graph-canvas:active { cursor: grabbing; }
.graph-canvas .vis-network { outline: none; }
.graph-canvas-tip {
  margin: 0;
  padding: 6px 12px 8px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  flex-shrink: 0;
}
.graph-canvas-empty {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-width: 360px;
  pointer-events: none;
}
.graph-story-rail {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  max-height: 640px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.graph-detail-pane { flex-shrink: 0; }
.graph-detail-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}
.graph-detail-head {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.graph-kind-pill {
  display: inline-block;
  color: #fff;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.graph-detail-title {
  margin: 0 0 2px;
  font-size: 1.05rem;
  line-height: 1.35;
  word-break: break-word;
}
.graph-detail-id {
  margin: 0 0 8px;
  font-size: 0.7rem;
  word-break: break-all;
}
.graph-domain-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.graph-domain-btn.active {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}
.graph-detail-full {
  margin: 0 0 8px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #334155;
  max-height: 96px;
  overflow: auto;
}
.graph-detail-stats {
  display: flex;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.graph-detail-stats strong { color: var(--text); }
.graph-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.graph-detail-section h4 {
  margin: 4px 0 8px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.graph-neighbor-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.graph-neighbor-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: #f8fafc;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: inherit;
  font-size: 0.82rem;
}
.graph-neighbor-btn:hover {
  border-color: #cbd5e1;
  background: #fff;
}
.graph-rel-chip {
  flex-shrink: 0;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid;
  background: #fff;
}
.graph-story-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}
.graph-story-head h3 { margin: 0; font-size: 0.95rem; }
.graph-story-list { display: flex; flex-direction: column; gap: 8px; }
.graph-story-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.graph-story-card:hover {
  border-color: #fdba74;
  background: #fff7ed;
}
.graph-story-text {
  margin: 0 0 6px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
}
.graph-story-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.graph-path-box { max-width: 820px; }
.graph-path-form { align-items: flex-end; gap: 10px; }
.graph-path-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 16px;
}
.graph-ask-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
}
.graph-ask-bar input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}
.graph-path-understood {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed var(--border);
}
.graph-path-hits {
  margin-bottom: 14px;
}
.graph-path-hits-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.graph-path-hit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.graph-path-hit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.graph-path-hit:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.graph-path-hit-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.graph-path-hit-body strong {
  font-size: 0.9rem;
}
.graph-path-hit-score {
  font-size: 0.75rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.graph-path-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.graph-path-step-head strong {
  margin-bottom: 0;
}
.graph-path-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.graph-path-step {
  border-left: 3px solid #cbd5e1;
  padding: 8px 12px;
  background: #fff;
  border-radius: 0 8px 8px 0;
  border: 1px solid var(--border);
  border-left-width: 3px;
}
.graph-path-step.kind-path { border-left-color: #c45c26; }
.graph-path-step.kind-intent { border-left-color: #2f6fed; }
.graph-path-step.kind-evidence { border-left-color: #15803d; }
.graph-path-step.kind-result { border-left-color: #7c3aed; }
.graph-path-step.kind-hit { border-left-color: #ea580c; }
.graph-path-step.kind-understand { border-left-color: #0891b2; }
.graph-path-step.kind-hits { border-left-color: #0f766e; }
.graph-path-step strong { display: block; margin-bottom: 4px; font-size: 0.85rem; }
.graph-path-step p { margin: 0; font-size: 0.9rem; line-height: 1.45; color: #334155; }
.graph-story-preview {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.4;
}
.graph-story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.graph-health-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.graph-health-h {
  margin: 18px 0 8px;
  font-size: 0.95rem;
}
.graph-report-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  margin-bottom: 14px;
}
.graph-report-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.graph-report-score strong {
  font-size: 2rem;
  color: #c45c26;
}
.graph-report-sec {
  margin-bottom: 12px;
}
.graph-report-sec h4 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}
.graph-report-sec ul {
  margin: 0;
  padding-left: 1.2em;
}
.graph-report-sec li {
  margin: 3px 0;
  font-size: 0.88rem;
  line-height: 1.4;
}
.graph-eval-box {
  margin-bottom: 16px;
}
.graph-eval-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.graph-eval-head h3 {
  margin: 0;
  font-size: 0.95rem;
}
.graph-eval-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.graph-eval-case {
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.graph-eval-case:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.graph-eval-result {
  margin-top: 10px;
}
.graph-field-flash {
  outline: 2px solid #c45c26 !important;
  outline-offset: 2px;
  transition: outline 0.2s ease;
}
.graph-health-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
}
.graph-health-list { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.graph-health-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.graph-health-item.level-warn { border-color: #fdba74; background: #fff7ed; }
.graph-health-item.level-info { border-color: #bfdbfe; background: #f8fbff; }
.graph-health-item p { margin: 2px 0 0; }

@media (max-width: 1100px) {
  .graph-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .graph-split { grid-template-columns: 1fr; }
  .graph-story-rail, .graph-rail { max-height: none; }
  .graph-health-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .host-workbench { grid-template-columns: 1fr; }
  .host-preview { position: static; }
  .row-editor-item { grid-template-columns: 1fr; }
  .wb-split.mobile-list .wb-detail { display: none; }
  .wb-split.mobile-detail .wb-rail { display: none; }
  .wb-split.mobile-detail .wb-detail { display: block; }
  .btn-back-list { display: inline-flex; }
  .dossier-head { position: static; }
  .shelf-list, .crm-list { max-height: none; }
  .pitch-card { max-height: none; }
}

/* —— 工作日常 —— */
.opsday-workbench .workbench-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.opsday-role-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.opsday-role-bar input[type="text"],
.opsday-role-bar input[type="date"] {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
}
.opsday-role-switch { display: inline-flex; gap: 4px; }
.opsday-pane { margin-top: 14px; }
.opsday-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  overflow: visible;
}
.opsday-toolbar select,
.opsday-toolbar input[type="text"],
.opsday-plan-actions select {
  box-sizing: border-box;
  min-height: 36px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 28px 7px 10px;
  line-height: 1.35;
  background: #fff;
  color: var(--text);
  font: inherit;
  max-width: 100%;
  overflow: visible;
}
.opsday-toolbar select,
.opsday-plan-actions select {
  min-width: 7.5rem;
  appearance: auto;
  -webkit-appearance: menulist;
}
.opsday-toolbar input[type="text"] {
  padding: 0 10px;
  min-height: 36px;
  height: 36px;
}
#view-opsday .opsday-workbench,
#view-opsday .opsday-pane,
#view-opsday .opsday-reports-layout,
#view-opsday .opsday-report-rail,
#view-opsday .opsday-plan-list,
#view-opsday .opsday-plan-item {
  overflow: visible;
}
.opsday-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 14px;
}
.opsday-kpi-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  margin-bottom: 14px;
}
.opsday-kpi-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.opsday-kpi-head h3 { margin: 0 0 4px; font-size: 1.05rem; }
.opsday-kpi-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.opsday-kpi-metric {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  min-width: 0;
}
.opsday-kpi-metric .hint { display: block; margin: 0 0 4px; font-size: 0.75rem; }
.opsday-kpi-metric strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opsday-kpi-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.opsday-kpi-bar { flex: 1; height: 10px; }
.opsday-kpi-status { margin: 0; font-size: 0.86rem; }
.opsday-kpi-editor {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #f8fafc;
}
.opsday-kpi-editor h4 { margin: 0 0 6px; font-size: 0.92rem; }
.opsday-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .opsday-kpi-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opsday-grid-2 { grid-template-columns: 1fr; }
}
.opsday-hero h3 { margin: 0 0 4px; }
.opsday-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.opsday-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.opsday-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.opsday-card h4 { margin: 0 0 10px; font-size: 0.9rem; }
.opsday-sop-minis { display: flex; flex-direction: column; gap: 8px; }
.opsday-sop-mini {
  display: grid;
  grid-template-columns: 64px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
}
.opsday-progress-bar {
  display: block;
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
}
.opsday-progress-bar i {
  display: block;
  height: 100%;
  background: #c45c26;
}
.opsday-today-plans {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.opsday-today-plan {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
}
.opsday-today-plan.done span { text-decoration: line-through; color: #64748b; }
.opsday-check {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  width: 28px;
}
.opsday-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-right: 6px;
}
.opsday-badge.ok { background: #ecfdf5; color: #047857; }
.opsday-badge.warn { background: #fff7ed; color: #c2410c; }
.opsday-plan-list { display: flex; flex-direction: column; gap: 8px; }
.opsday-plan-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.opsday-plan-item.priority-high { border-left: 3px solid #dc2626; }
.opsday-plan-item.status-done { opacity: 0.72; }
.opsday-plan-main { flex: 1; min-width: 0; }
.opsday-plan-main strong { display: block; margin-bottom: 2px; }
.opsday-plan-actions { display: flex; gap: 6px; align-items: flex-start; }
.opsday-reports-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  min-height: 420px;
  overflow: visible;
}
.opsday-report-rail {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  overflow: visible;
}
.opsday-report-rail .opsday-toolbar {
  flex-direction: column;
  align-items: stretch;
}
.opsday-report-rail .opsday-toolbar select {
  width: 100%;
  min-width: 0;
}
.opsday-report-list { display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow: auto; }
.opsday-report-item {
  text-align: left;
  border: 1px solid transparent;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.opsday-report-item.active,
.opsday-report-item:hover {
  border-color: #94a3b8;
  background: #fff;
}
.opsday-report-editor {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}
.opsday-report-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.opsday-report-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.opsday-report-editor .field { margin-bottom: 10px; }
.opsday-report-editor textarea,
.opsday-report-editor input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}
.opsday-graph-snip {
  margin-top: 12px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed var(--border);
}
.opsday-graph-snip pre {
  margin: 6px 0 0;
  white-space: pre-wrap;
  font-size: 0.85rem;
  color: #334155;
}
.opsday-sop-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.opsday-sop-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.opsday-sop-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.opsday-sop-card h4 { margin: 0; font-size: 0.95rem; }
.opsday-sop-steps { display: flex; flex-direction: column; gap: 8px; }
.opsday-sop-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}
.opsday-sop-step input { margin-top: 3px; }
.opsday-sop-step strong { display: block; font-size: 0.88rem; }
.opsday-sop-step em { display: block; font-style: normal; margin-top: 2px; }

@media (max-width: 1100px) {
  .opsday-grid { grid-template-columns: 1fr; }
  .opsday-sop-board { grid-template-columns: 1fr; }
  .opsday-reports-layout { grid-template-columns: 1fr; }
}

.opsday-sop-card header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.opsday-sop-step.is-edit {
  flex-direction: column;
  gap: 6px;
  cursor: default;
}
.opsday-sop-step.is-edit input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
}

/* ─── 系统 Agent 三栏 ─── */
#view-agent.layout {
  display: flex;
  flex-direction: column;
  /* 顶栏约 72–96px；用 dvh 避免移动端地址栏跳动 */
  height: calc(100dvh - 96px);
  max-height: calc(100dvh - 96px);
  min-height: 0;
  overflow: hidden;
}
body:has(#view-agent:not(.hidden)) {
  overflow: hidden;
}
.agent-workbench-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.agent-workbench {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.agent-workbench .workbench-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.agent-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
.agent-split {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) minmax(280px, 360px);
  gap: 12px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  overflow: hidden;
}
.agent-rail,
.agent-chat,
.agent-canvas {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.agent-rail-head,
.agent-chat-head,
.agent-canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  flex-shrink: 0;
}
.agent-session-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.agent-session-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.agent-session-item:hover { background: #f1f5f9; }
.agent-session-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.agent-session-item strong {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.agent-chat-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 40%);
}
.agent-welcome {
  margin: auto;
  text-align: center;
  max-width: 420px;
  color: #475569;
}
.agent-welcome h3 { margin: 0 0 8px; color: #0f172a; }
.agent-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}
.agent-msg { max-width: 92%; display: flex; flex-direction: column; gap: 4px; }
.agent-msg-user { align-self: flex-end; }
.agent-msg-assistant { align-self: flex-start; }
.agent-msg-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.55;
  font-size: 0.92rem;
  white-space: pre-wrap;
}
.agent-msg-user .agent-msg-bubble {
  background: #1d4ed8;
  color: #fff;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}
.agent-msg-assistant .agent-msg-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
  white-space: normal;
}
.agent-msg-assistant .agent-msg-bubble p { margin: 0 0 6px; }
.agent-msg-assistant .agent-msg-bubble p:last-child { margin-bottom: 0; }
.agent-msg-assistant .agent-msg-bubble ul { margin: 4px 0 8px 1.1em; padding: 0; }
.agent-msg-assistant .agent-msg-bubble h3,
.agent-msg-assistant .agent-msg-bubble h4,
.agent-msg-assistant .agent-msg-bubble h5 { margin: 8px 0 4px; font-size: 0.95rem; }
.agent-msg time {
  font-size: 0.72rem;
  color: #94a3b8;
  padding: 0 4px;
}
.agent-tool-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.agent-chip {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}
.agent-chip.ok { background: #ecfdf5; color: #047857; }
.agent-chip.err { background: #fef2f2; color: #b91c1c; }
.agent-typing .agent-msg-bubble { color: #64748b; font-style: italic; }
.agent-chat-composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: #fff;
  align-items: flex-end;
  flex-shrink: 0;
}
.agent-chat-composer textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  min-height: 44px;
  max-height: 120px;
  background: #f8fafc;
}
.agent-chat-composer textarea:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
}
.agent-canvas-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.agent-canvas-idle {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.55;
  padding: 8px 4px;
}
.agent-canvas-idle-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 650;
  color: #334155;
}
.agent-canvas-idle ul {
  margin: 8px 0 12px 1.1em;
  padding: 0;
}
.agent-canvas-idle li { margin: 4px 0; }
.agent-artifact {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.agent-artifact:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.agent-artifact-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 8px;
}
.agent-hit-clickable {
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.agent-hit-clickable:hover { background: #eff6ff; }
.agent-hit-clickable em {
  position: absolute;
  right: 10px;
  top: 10px;
  font-style: normal;
  font-size: 0.75rem;
  color: #2563eb;
}
.agent-chart-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0 4px;
}
.agent-chart-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px 6px;
}
.agent-chart-card h5 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: #334155;
  font-weight: 650;
}
.agent-chart-wrap {
  position: relative;
  height: 180px;
  width: 100%;
}
.agent-charts-panel .agent-panel-stats {
  margin-bottom: 8px;
}
.agent-panel-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.agent-panel-stats > div {
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.agent-panel-stats span { font-size: 0.72rem; color: #64748b; }
.agent-panel-stats strong { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-sop-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.agent-sop-row {
  display: grid;
  grid-template-columns: 52px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}
.agent-sop-row em { font-style: normal; color: #64748b; text-align: right; }
.agent-plain-list,
.agent-hit-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.agent-hit-list li,
.agent-plain-list li {
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 8px;
}
.agent-hit-list li strong { display: block; }
.agent-product-card {
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.agent-product-card h4 { margin: 0 0 8px; }
.agent-product-card p { margin: 4px 0; color: #334155; }
.agent-canvas-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.agent-md h3, .agent-md h4, .agent-md h5 { margin: 10px 0 6px; }
.agent-md ul { margin: 4px 0 10px 1.1em; padding: 0; }
.agent-md p { margin: 0 0 6px; }
.agent-empty { padding: 12px; }
@media (max-width: 1100px) {
  #view-agent.layout {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  body:has(#view-agent:not(.hidden)) {
    overflow: auto;
  }
  .agent-split {
    grid-template-columns: 1fr;
    min-height: auto;
    overflow: visible;
  }
  .agent-rail { max-height: 180px; }
  .agent-chat { min-height: 420px; height: auto; }
  .agent-canvas { min-height: 280px; height: auto; }
}

/* ─── 悬浮语音助手（右下角仅一个人形入口） ─── */
.voice-avatar-restore { display: none !important; }
.voice-avatar {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 40;
  width: 220px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(8px);
  overflow: hidden;
  transition: width 0.2s, transform 0.2s, opacity 0.2s, filter 0.2s;
}
/* 关闭态：仍显示人形，灰一点；点一下即可打开 */
.voice-avatar.is-off {
  display: block;
  opacity: 0.78;
  filter: grayscale(0.4);
}
.voice-avatar.is-off .voice-avatar-power,
.voice-avatar.is-off .voice-avatar-toggle {
  display: none !important;
}
.voice-avatar.is-off.collapsed .voice-avatar-figure {
  cursor: pointer;
}
.voice-avatar.is-off.collapsed:hover {
  opacity: 1;
  filter: none;
  transform: translateY(-1px);
}
.voice-avatar-power {
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.voice-avatar-power:hover { color: var(--danger); background: rgba(225, 29, 72, 0.08); }
.voice-avatar.collapsed .voice-avatar-power {
  top: -6px;
  left: -6px;
  width: 22px;
  height: 22px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
/* 缩小态：默认隐藏 × / 展开，悬停或触摸时再显示 */
.voice-avatar.collapsed:not(.is-off) .voice-avatar-power,
.voice-avatar.collapsed:not(.is-off) .voice-avatar-toggle {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.voice-avatar.collapsed:not(.is-off):hover .voice-avatar-power,
.voice-avatar.collapsed:not(.is-off):hover .voice-avatar-toggle,
.voice-avatar.collapsed:not(.is-off):focus-within .voice-avatar-power,
.voice-avatar.collapsed:not(.is-off):focus-within .voice-avatar-toggle,
.voice-avatar.collapsed:not(.is-off).is-chrome-visible .voice-avatar-power,
.voice-avatar.collapsed:not(.is-off).is-chrome-visible .voice-avatar-toggle {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.voice-avatar.collapsed {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  overflow: visible;
}
.voice-avatar.collapsed .voice-avatar-body {
  padding: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
  gap: 0;
}
.voice-avatar.collapsed .voice-avatar-body > :not(.voice-avatar-figure) {
  display: none !important;
}
.voice-avatar.collapsed .voice-avatar-figure {
  margin: 0;
  width: 64px;
  height: 64px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  border-radius: 50%;
}
.voice-avatar.collapsed .voice-avatar-ring {
  inset: 2px;
  border-radius: 50%;
}
.voice-avatar.collapsed .voice-avatar-person {
  width: 40px;
  height: 50px;
}
.voice-avatar.collapsed .voice-avatar-toggle {
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  line-height: 1;
  color: #64748b;
}
.voice-avatar.collapsed[data-phase="listening"] {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 10px 28px rgba(15, 23, 42, 0.18);
}
.voice-avatar.collapsed[data-phase="speaking"] {
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25), 0 10px 28px rgba(15, 23, 42, 0.18);
}
.voice-avatar.collapsed[data-phase="thinking"] {
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.22), 0 10px 28px rgba(15, 23, 42, 0.18);
}
.voice-avatar-toggle {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.85rem;
  z-index: 2;
  padding: 2px 6px;
}
.voice-avatar-body {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.voice-avatar-figure {
  position: relative;
  width: 72px;
  height: 88px;
  display: grid;
  place-items: center;
}
.voice-avatar-ring {
  position: absolute;
  inset: 4px 6px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.voice-avatar-person {
  width: 56px;
  height: 70px;
  fill: #1e293b;
  opacity: 0.92;
  position: relative;
  z-index: 1;
}
.voice-avatar[data-phase="listening"] .voice-avatar-ring {
  border-color: #3b82f6;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.18);
  animation: va-pulse 1.1s ease-in-out infinite;
}
.voice-avatar[data-phase="thinking"] .voice-avatar-ring {
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}
.voice-avatar[data-phase="speaking"] .voice-avatar-ring {
  border-color: #10b981;
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.18);
  animation: va-pulse 0.7s ease-in-out infinite;
}
.voice-avatar[data-phase="speaking"] .voice-avatar-person {
  fill: #047857;
}
@keyframes va-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}
.voice-avatar-meta {
  text-align: center;
  line-height: 1.25;
}
.voice-avatar-name {
  display: block;
  font-size: 0.88rem;
  color: #0f172a;
}
.voice-avatar-phase {
  font-size: 0.72rem;
  color: #64748b;
}
.voice-avatar-bubble {
  width: 100%;
  min-height: 44px;
  max-height: 110px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #334155;
}
.voice-avatar-bubble.empty {
  color: #94a3b8;
}
.voice-avatar-user {
  margin: 0 0 4px;
  color: #1d4ed8;
  font-weight: 550;
}
.voice-avatar-reply {
  margin: 0;
  white-space: pre-wrap;
}
.voice-avatar-user:empty,
.voice-avatar-reply:empty { display: none; }
.voice-avatar-talk {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 650;
  font-size: 0.88rem;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  cursor: pointer;
  user-select: none;
  touch-action: none;
}
.voice-avatar-talk:active,
.voice-avatar[data-phase="listening"] .voice-avatar-talk,
.voice-avatar.is-holding .voice-avatar-talk {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}
.voice-avatar.is-holding .voice-avatar-figure {
  transform: scale(1.04);
}
.voice-avatar.collapsed.is-holding {
  box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.28), 0 10px 28px rgba(15, 23, 42, 0.18);
}
.voice-avatar-fallback {
  display: flex;
  gap: 6px;
  width: 100%;
}
.voice-avatar-fallback.hidden { display: none; }
.voice-avatar-fallback input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 0.8rem;
}
.voice-avatar-link {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
}
.voice-avatar-link:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .voice-avatar {
    right: 12px;
    bottom: 72px;
    width: 200px;
  }
}
