:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --panel: #ffffff;
  --panel-soft: #f8fbfa;
  --ink: #14211f;
  --text: #14211f;
  --muted: #60716d;
  --line: #d9e3df;
  --line-strong: #bdd0ca;
  --accent: #0f766e;
  --accent-dark: #0a5f59;
  --accent-strong: #0a5f59;
  --warn: #9a5b00;
  --warn-bg: #fff6dd;
  --danger: #b42318;
  --danger-bg: #fff1ef;
  --pass: #147a48;
  --pass-bg: #edf8f1;
  --shadow: 0 20px 48px rgba(22, 35, 32, 0.08);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

body.theme-dark {
  color-scheme: dark;
  --bg: #101615;
  --panel: #16201f;
  --panel-soft: #1b2826;
  --ink: #e8efeb;
  --text: #e8efeb;
  --muted: #a8bbb5;
  --line: #30423f;
  --line-strong: #516b65;
  --accent: #55beb2;
  --accent-dark: #8fded4;
  --accent-strong: #8fded4;
  --warn: #dec27c;
  --warn-bg: #292415;
  --warn-badge: #dec27c;
  --warn-badge-bg: #292415;
  --danger: #e4a09a;
  --danger-bg: #2a1e1d;
  --pass: #9ed8b7;
  --pass-bg: #172821;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
}

body.theme-dark {
  background:
    linear-gradient(180deg, #111817 0%, #0f1514 46%, #111716 100%),
    #101615;
}

body.theme-dark .sidebar,
body.theme-dark .panel,
body.theme-dark .route-card,
body.theme-dark .vw-stage-guide,
body.theme-dark .vw-guide-grid > div,
body.theme-dark .vw-pipeline-bar li,
body.theme-dark .advanced,
body.theme-dark .check-grid label,
body.theme-dark .image-card,
body.theme-dark .table-row,
body.theme-dark .source-view {
  background: var(--panel);
}

body.theme-dark .workspace {
  background:
    linear-gradient(180deg, rgba(20, 31, 29, 0.64) 0%, rgba(16, 22, 21, 0) 240px),
    var(--bg);
}

body.theme-dark .brand span,
body.theme-dark .eyebrow {
  color: #86d6cc;
}

body.theme-dark .nav-group-toggle {
  color: #d7e2de;
}

body.theme-dark .brand strong,
body.theme-dark .nav-item:not(.active) {
  color: #d7e2de;
}

body.theme-dark .nav-item:hover {
  background: #1a2825;
  color: #edf5f1;
}

body.theme-dark .nav-item.active {
  background: linear-gradient(180deg, #2ba99d 0%, #21897f 100%);
  color: #f8fffc;
  box-shadow: 0 10px 22px rgba(33, 137, 127, 0.28);
}

body.theme-dark .nav-item.muted {
  color: #7f918c;
}

body.theme-dark .sidebar-note {
  background: #15211f;
  border-color: #2f4842;
}

body.theme-dark .sidebar {
  background: #121c1a;
  border-color: #263a36;
}

body.theme-dark .panel,
body.theme-dark .route-card,
body.theme-dark .vw-stage-guide,
body.theme-dark .vw-guide-grid > div,
body.theme-dark .vw-pipeline-bar li,
body.theme-dark .module,
body.theme-dark .advanced,
body.theme-dark .image-card,
body.theme-dark .table-row,
body.theme-dark .stat-card,
body.theme-dark .metric-card,
body.theme-dark .project-kpi,
body.theme-dark .project-card,
body.theme-dark .mini-card,
body.theme-dark .rule-list div {
  background: linear-gradient(180deg, #172321 0%, #141e1d 100%);
  border-color: #2f4540;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: #111a18;
  border-color: #3b5650;
  color: var(--ink);
}

body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
  border-color: #69c9be;
  box-shadow: 0 0 0 3px rgba(85, 190, 178, 0.16);
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
  color: #7f9690;
  opacity: 1;
}

body.theme-dark .secondary {
  background: #172421;
  color: var(--ink);
}

body.theme-dark .primary {
  background: linear-gradient(180deg, #3bb8ac 0%, #258d83 100%);
  color: #f9fffd;
}

body.theme-dark .primary:disabled {
  background: #40514d;
  color: #aebcb8;
}

body.theme-dark .ghost {
  background: rgba(232, 239, 235, 0.03);
  color: #c9d8d3;
}

body.theme-dark .route-card.active,
body.theme-dark .video-route-card.active,
body.theme-dark .drop-zone.dragging {
  background: linear-gradient(180deg, #173a35 0%, #132d2a 100%);
}

body.theme-dark .drop-zone {
  background: #131d1b;
  border-color: #334d48;
}

body.theme-dark .drop-zone:focus-visible {
  background: #172822;
  border-color: #69c9be;
  box-shadow: 0 0 0 3px rgba(85, 190, 178, 0.16);
}

body.theme-dark .vw-plan-panel,
body.theme-dark .plan-snapshot {
  background: #15211f;
  border-color: #395550;
}

body.theme-dark .vw-pipeline {
  background: linear-gradient(180deg, rgba(17, 24, 23, 0.98) 0%, rgba(17, 24, 23, 0.92) 100%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.26);
}

body.theme-dark .vw-pipeline-bar li.active {
  background: #1a2e2a;
  border-color: #67d8cb;
}

body.theme-dark .vw-stage-guide .eyebrow {
  color: #7dd7cc;
}

body.theme-dark .output {
  background: linear-gradient(180deg, #15201e 0%, #111a18 100%);
  border-color: #36524c;
  color: #dfe9e5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

body.theme-dark .skill-content {
  background: #111a18;
  border-color: #263c37;
}

body.theme-dark .bar-track {
  background: #263532;
}

body.theme-dark .ring {
  background: conic-gradient(var(--accent) calc(var(--value) * 1%), #263532 0);
}

body.theme-dark .split-meter {
  background: #263532;
}

body.theme-dark .char-pipeline {
  background: linear-gradient(180deg, rgba(17, 24, 23, 0.98) 0%, rgba(17, 24, 23, 0.92) 100%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.26);
}
body.theme-dark .char-pipeline-bar li.active {
  background: #1a2e2a;
  border-color: #67d8cb;
}
body.theme-dark .char-gate-guide {
  background: linear-gradient(180deg, rgba(85, 190, 178, 0.08), rgba(20, 30, 29, 0)), #15211f;
  border-color: #395550;
}
body.theme-dark .char-dialogue-area textarea {
  background: #15211f;
  border-color: #395550;
  color: var(--fg);
}
body.theme-dark .char-suggest-chip {
  border-color: #395550;
  color: var(--fg);
}
body.theme-dark .char-suggest-chip:hover,
body.theme-dark .char-suggest-chip.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body.theme-dark .route-card,
body.theme-dark .vw-stage-guide,
body.theme-dark .vw-guide-grid > div,
body.theme-dark .vw-pipeline-bar li,
body.theme-dark .char-pipeline-bar li,
body.theme-dark .char-gate-guide,
body.theme-dark .module,
body.theme-dark .advanced,
body.theme-dark .stat-card,
body.theme-dark .metric-card,
body.theme-dark .project-kpi,
body.theme-dark .project-card,
body.theme-dark .breakdown-row,
body.theme-dark .mini-card,
body.theme-dark .rule-list div {
  border-color: var(--line);
}

body.theme-dark .scene-pipeline {
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4);
}
body.theme-dark .scene-pipeline-bar li.active {
  background: rgba(15, 118, 110, 0.18);
}
body.theme-dark .scene-gate-guide {
  background: var(--panel);
  border-color: var(--line);
}
body.theme-dark .scene-dialogue-area textarea {
  border-color: var(--accent);
  background: var(--panel);
}
body.theme-dark .scene-suggest-chip {
  border-color: var(--accent);
  color: var(--fg);
}
body.theme-dark .scene-suggest-chip:hover,
body.theme-dark .scene-suggest-chip.selected {
  background: var(--accent);
  color: #fff;
}
body.theme-dark .scene-pipeline-bar li,
body.theme-dark .scene-gate-guide,
body.theme-dark .scene-pipeline-bar li.clickable:hover {
  background: var(--panel);
}

body.theme-dark .prop-pipeline {
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.4);
}
body.theme-dark .prop-pipeline-bar li.active {
  background: rgba(15, 118, 110, 0.18);
}
body.theme-dark .prop-gate-guide {
  background: var(--panel);
  border-color: var(--line);
}
body.theme-dark .prop-dialogue-area textarea {
  border-color: var(--accent);
  background: var(--panel);
}
body.theme-dark .prop-suggest-chip {
  border-color: var(--accent);
  color: var(--fg);
}
body.theme-dark .prop-suggest-chip:hover,
body.theme-dark .prop-suggest-chip.selected {
  background: var(--accent);
  color: #fff;
}
body.theme-dark .prop-pipeline-bar li,
body.theme-dark .prop-gate-guide,
body.theme-dark .prop-pipeline-bar li.clickable:hover {
  background: var(--panel);
}

body.theme-dark .route-card.active {
  border-color: #5ed1c4;
  box-shadow: 0 0 0 2px rgba(85, 190, 178, 0.18), 0 18px 36px rgba(0, 0, 0, 0.26);
}

body.theme-dark .vw-stage-guide {
  background:
    linear-gradient(180deg, rgba(85, 190, 178, 0.08), rgba(20, 30, 29, 0)),
    #172321;
}

body.theme-dark .vw-guide-grid > div {
  background: #131d1b;
  border-color: #304842;
}

body.theme-dark p,
body.theme-dark small,
body.theme-dark .route-card small,
body.theme-dark .vw-stage-guide p,
body.theme-dark .vw-guide-grid li,
body.theme-dark .vw-pipeline-bar li .vw-step-label,
body.theme-dark .module-head span,
body.theme-dark .drop-zone,
body.theme-dark .sidebar-note span,
body.theme-dark .nav-section-label,
body.theme-dark .account-bar span,
body.theme-dark .table-row span,
body.theme-dark .row-title small,
body.theme-dark .image-meta span,
body.theme-dark .gate small,
body.theme-dark .output-actions span,
body.theme-dark .metric-card small,
body.theme-dark .project-card-main small,
body.theme-dark .project-card-meta,
body.theme-dark .project-empty span,
body.theme-dark .breakdown-row span {
  color: var(--muted);
}

body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark .route-card strong,
body.theme-dark .vw-stage-guide strong,
body.theme-dark .vw-pipeline-bar li.active .vw-step-label,
body.theme-dark .vw-pipeline-bar li.done .vw-step-label,
body.theme-dark .field span,
body.theme-dark .main-input span,
body.theme-dark .advanced summary,
body.theme-dark .drop-zone strong,
body.theme-dark .gate strong,
body.theme-dark .row-title strong,
body.theme-dark .breakdown-row strong,
body.theme-dark .metric-card strong,
body.theme-dark .project-kpi strong,
body.theme-dark .project-card-main strong,
body.theme-dark .output {
  color: var(--ink);
}

body.theme-dark .gate.pass {
  border-color: #3f6f57;
  background: #182a22;
}

body.theme-dark .gate.warn {
  border-color: #6c5a2e;
  background: #292516;
}

body.theme-dark .gate.stop {
  border-color: #6b3c38;
  background: #2b1f1e;
}

body.theme-dark .mode-badge,
body.theme-dark .gate.pass span,
body.theme-dark .status-chip.success {
  background: #203b30;
  color: #b7e6ca;
}

body.theme-dark .gate.warn span,
body.theme-dark .status-chip.stopped,
body.theme-dark .status-chip.neutral {
  background: #3d3218;
  color: #ead08a;
}

body.theme-dark .gate.stop span {
  background: #432825;
  color: #f0aaa2;
}

body.theme-dark .status-chip.error {
  background: #432825;
  color: #f0aaa2;
}

body.theme-dark .output-actions .variant-copy,
body.theme-dark .small,
body.theme-dark .project-filter {
  border-color: #49635d;
  color: #d8e5e1;
}

body.theme-dark .output-actions .variant-copy:hover,
body.theme-dark .secondary:hover,
body.theme-dark .ghost:hover {
  border-color: #6b9289;
  background: #1a2926;
}

body.theme-dark .sidebar-note strong.enabled {
  color: #99dfc3;
}

body.theme-dark .sidebar-note strong.disabled,
body.theme-dark .login-error,
body.theme-dark .admin-message {
  color: #e4a09a;
}

/* ===== Landing Page ===== */

.landing-screen {
  --ls: min(680px, 90vh, 85vw);
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #080d22;
  overflow: hidden;
}

.landing-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Logo */
.landing-logo-wrap {
  position: relative;
  z-index: 2;
  width: min(420px, 60vw, 50vh);
}

.landing-logo-img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: lighten;
}

/* Bottom content */
.landing-bottom {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}

.landing-tagline {
  color: rgba(160, 180, 210, 0.45);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 5px;
  text-align: center;
}

.landing-enter {
  padding: 12px 56px;
  border: 1px solid rgba(140, 180, 220, 0.18);
  border-radius: 4px;
  background: transparent;
  color: rgba(180, 200, 230, 0.6);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.4s ease;
}

.landing-enter:hover {
  color: rgba(210, 225, 245, 0.9);
  border-color: rgba(160, 200, 240, 0.4);
  background: rgba(140, 180, 230, 0.06);
  box-shadow: 0 0 40px rgba(100, 160, 230, 0.08);
}

/* ===== Login Screen ===== */

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #080e1a;
  overflow: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-glow {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(100, 160, 220, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  display: grid;
  gap: 20px;
  border: 1px solid rgba(140, 180, 220, 0.15);
  border-radius: 12px;
  background: rgba(15, 22, 35, 0.85);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(140, 180, 220, 0.08);
  padding: 36px 32px;
  animation: login-slide-up 0.5s ease-out;
}

@keyframes login-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-logo {
  width: 120px;
  height: auto;
  justify-self: center;
  filter: drop-shadow(0 0 20px rgba(100, 160, 220, 0.1));
}

.login-card .field span {
  color: rgba(180, 200, 220, 0.7);
}

.login-card input {
  background: rgba(20, 30, 50, 0.6);
  border: 1px solid rgba(140, 180, 220, 0.15);
  color: #e0eaf4;
  border-radius: 6px;
}

.login-card input:focus {
  border-color: rgba(140, 180, 220, 0.4);
  outline: none;
  box-shadow: 0 0 0 2px rgba(100, 160, 220, 0.1);
}

.login-card .primary {
  background: rgba(100, 160, 220, 0.2);
  border: 1px solid rgba(140, 180, 220, 0.3);
  color: rgba(220, 235, 250, 0.95);
  font-weight: 600;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.login-card .primary:hover {
  background: rgba(100, 160, 220, 0.3);
  border-color: rgba(140, 180, 220, 0.5);
}

.login-back {
  justify-self: center;
  padding: 6px 20px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(140, 160, 180, 0.5);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
}

.login-back:hover {
  color: rgba(180, 200, 220, 0.8);
}

.login-error {
  min-height: 22px;
  color: #e4a09a;
  font-size: 13px;
  font-weight: 760;
  text-align: center;
}

.admin-message {
  min-height: 22px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 760;
}

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

button {
  border: 0;
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.11);
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 22px 16px;
}

.brand {
  display: grid;
  gap: 4px;
}

.brand span,
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong {
  font-size: 20px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-group-toggle {
  min-height: 42px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  font-weight: 850;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-group-toggle::after {
  content: "▾";
  font-size: 10px;
  margin-left: auto;
  transition: transform 0.15s;
}

.nav-group-toggle.open::after {
  transform: rotate(180deg);
}

.nav-group {
  display: none;
  gap: 4px;
  padding-left: 10px;
}

.nav-group.open {
  display: grid;
}

.nav-item {
  min-height: 42px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
  font-weight: 760;
}

.nav-item.active {
  background: var(--accent);
  color: #ffffff;
}

.nav-item.muted {
  color: #7a8985;
}

.sidebar-note {
  display: grid;
  gap: 6px;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
}

.sidebar-note strong {
  color: var(--muted);
  font-size: 13px;
}

.sidebar-note strong.enabled {
  color: var(--accent-dark);
}

.sidebar-note strong.disabled {
  color: var(--danger);
}

.sidebar-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.workspace {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.account-bar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.eyebrow {
  margin: 0 0 6px;
}

h1,
h2,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 31px;
  line-height: 1.15;
}

h2 {
  font-size: 19px;
}

p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.panel-stack {
  display: grid;
  gap: 16px;
}

.hidden {
  display: none !important;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.vw-pipeline {
  position: sticky;
  top: 0;
  z-index: 35;
  padding: 10px 0 12px;
  background: var(--bg);
  box-shadow: 0 14px 26px rgba(22, 35, 32, 0.08);
}

.vw-pipeline-bar {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: stage;
}

.vw-pipeline-bar li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
  counter-increment: stage;
}

.vw-pipeline-bar li:first-child { border-radius: 8px 0 0 8px; }
.vw-pipeline-bar li:last-child { border-radius: 0 8px 8px 0; }
.vw-pipeline-bar li + li { border-left: none; }

.vw-pipeline-bar li .vw-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 820;
  flex-shrink: 0;
  background: var(--line);
  color: var(--muted);
}

.vw-pipeline-bar li .vw-step-label {
  font-size: 13px;
  font-weight: 680;
  color: var(--muted);
  line-height: 1.3;
}

.vw-pipeline-bar li.done .vw-step-num {
  background: var(--accent);
  color: #fff;
}
.vw-pipeline-bar li.done .vw-step-label { color: var(--ink); }

.vw-pipeline-bar li.active {
  background: #eef8f5;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
  z-index: 1;
}
.vw-pipeline-bar li.active .vw-step-num {
  background: var(--accent);
  color: #fff;
}
.vw-pipeline-bar li.active .vw-step-label {
  color: var(--ink);
  font-weight: 820;
}

.vw-pipeline-bar li.locked { opacity: 0.5; }

.vw-pipeline-bar li.clickable { cursor: pointer; }
.vw-pipeline-bar li.clickable:hover { background: #f0faf7; }

.vw-plan-panel {
  position: sticky;
  top: 72px;
  z-index: 34;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f3fbf8;
  box-shadow: 0 16px 32px rgba(22, 35, 32, 0.08);
  padding: 14px;
}

.vw-work-layout {
  display: grid;
  grid-template-columns: minmax(480px, 0.85fr) minmax(560px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.vw-stage-guide {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(255, 255, 255, 0)), var(--panel-soft);
}

.vw-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.vw-guide-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.vw-guide-grid strong {
  display: block;
  margin-bottom: 6px;
}

.vw-guide-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.62;
}

.vw-input-section { display: grid; gap: 14px; }


.inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.plan-snapshot {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  padding: 12px;
  overscroll-behavior: contain;
}

.route-card {
  min-height: 142px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 14px;
  text-align: left;
  box-shadow: 0 8px 24px rgba(22, 35, 32, 0.04);
}

.route-card:hover {
  border-color: var(--line-strong);
}

.route-card.active {
  border-color: var(--accent);
  background: #eef8f5;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.route-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 820;
}

.route-card strong {
  font-size: 16px;
}

.route-card small {
  color: var(--muted);
  line-height: 1.45;
}

.work-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 16px;
  align-items: start;
}

.composer {
  display: grid;
  gap: 16px;
}

.inspector {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

#videoPanel .work-layout {
  grid-template-columns: minmax(520px, 0.9fr) minmax(620px, 1.1fr);
}

#videoPanel .inspector {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  overscroll-behavior: contain;
}

#videoPanel .inspector .panel:nth-child(1) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#videoPanel .inspector .panel:nth-child(2) {
  flex: 0 0 auto;
  max-height: 230px;
  overflow: auto;
  overscroll-behavior: contain;
}

#videoPanel #videoOutputActions {
  flex: 0 0 auto;
}

#videoPanel #videoOutputBox {
  flex: 1 1 auto;
  min-height: min(62vh, 680px);
  max-height: none;
  overscroll-behavior: contain;
}

#videoPanel #videoGateList {
  max-height: 155px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.section-head.compact {
  align-items: center;
}

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

.btn-rerun {
  border-radius: 999px;
  background: var(--warning-bg, #fff8e1);
  color: var(--warning, #e65100);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--warning, #e65100);
  transition: opacity 0.15s;
}

.btn-rerun:hover {
  opacity: 0.8;
}

.mode-badge {
  border-radius: 999px;
  background: #edf8f1;
  color: var(--accent-dark);
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.main-input {
  display: grid;
  gap: 10px;
}

.main-input span,
.field span {
  font-weight: 800;
}

.main-input textarea {
  min-height: 190px;
  font-size: 16px;
}

.upload-block,
.module,
.advanced {
  display: grid;
  gap: 12px;
}

.drop-zone {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 112px;
  border: 1px dashed #8fb9b4;
  border-radius: 8px;
  background: #fbfdfc;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  outline: none;
}

.drop-zone input {
  display: none;
}

.drop-zone strong {
  color: var(--ink);
}

.drop-zone.dragging {
  border-color: var(--accent);
  background: #eef8f5;
}

.drop-zone:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 169, 153, 0.16);
  background: #eef8f5;
}

.drop-zone-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.drop-zone-actions small {
  color: var(--muted);
  line-height: 1.35;
}

.drop-zone-pick {
  min-height: 30px;
  padding: 6px 12px;
}

.image-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.asset-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.image-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
}

.image-card img {
  width: 78px;
  height: 94px;
  border-radius: 7px;
  object-fit: cover;
  background: #eef2f0;
}

.image-meta {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.image-meta strong,
.image-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-meta strong {
  font-size: 13px;
}

.image-meta span {
  color: var(--muted);
  font-size: 12px;
}

.asset-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
}

.asset-icon {
  display: grid;
  place-items: center;
  min-height: 70px;
  border-radius: 7px;
  background: #eef6f3;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.asset-meta {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.asset-meta strong,
.asset-meta span,
.asset-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-meta strong {
  white-space: nowrap;
  font-size: 13px;
}

.asset-meta span,
.asset-meta small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.asset-meta small {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.image-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.replace-image {
  min-height: 30px;
  border-radius: 7px;
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 780;
  flex: 1;
}

.remove-image {
  min-height: 30px;
  border-radius: 7px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 780;
  flex: 1;
}

.image-placeholder img {
  opacity: 0.4;
  filter: grayscale(1);
}

.module {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.module-head {
  display: grid;
  gap: 4px;
}

.module-head span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.advanced {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0;
}

.advanced summary {
  padding: 13px 14px;
  cursor: pointer;
  font-weight: 840;
}

.advanced .field-grid,
.advanced .field-grid.two {
  padding: 0 14px 14px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  color: var(--ink);
  font-weight: 760;
}

.check-grid input {
  width: auto;
}

.action-bar {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.primary,
.secondary,
.ghost {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 15px;
  font-weight: 820;
}

.primary {
  background: var(--accent);
  color: #ffffff;
}

.primary:disabled {
  background: #aab8b4;
  cursor: not-allowed;
}

.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.gate-list {
  display: grid;
  gap: 9px;
}

.gate {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.gate span {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 840;
}

.gate strong {
  font-size: 14px;
}

.gate small {
  color: var(--muted);
  line-height: 1.45;
}

.gate.pass {
  border-color: #b9dbc8;
  background: var(--pass-bg);
}

.gate.pass span {
  background: #d9f2e3;
  color: var(--pass);
}

.gate.warn {
  border-color: #edd89d;
  background: var(--warn-bg);
}

.gate.warn span {
  background: #ffe9a8;
  color: var(--warn);
}

.gate.stop {
  border-color: #f0beb7;
  background: var(--danger-bg);
}

.gate.stop span {
  background: #ffd9d4;
  color: var(--danger);
}

.template-panel.hidden {
  display: none;
}

.template-card {
  display: grid;
  gap: 10px;
}

.template-library-panel {
  align-self: start;
}

.template-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}

.case-template-card {
  display: grid;
  grid-template-rows: 220px minmax(0, 1fr) auto;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #07100f;
  color: #eaf8f4;
}

.case-template-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 220px;
  padding: 12px;
  color: #ecfdf5;
  background:
    linear-gradient(135deg, rgba(12, 28, 24, 0.95), rgba(18, 96, 84, 0.85)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
}

.case-template-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-template-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 11, 9, 0.05), rgba(3, 11, 9, 0.72));
}

.case-template-code,
.case-template-lock {
  position: relative;
  z-index: 1;
  border-radius: 999px;
  background: rgba(4, 11, 10, 0.72);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 780;
}

.case-template-body {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.case-template-category {
  margin: 0;
  color: #65ead1;
  font-size: 12px;
  font-weight: 800;
}

.case-template-body h3 {
  margin: 0;
  color: #ffffff;
  font-size: 20px;
  line-height: 1.25;
}

.case-template-use,
.case-template-prompt {
  margin: 0;
  line-height: 1.5;
}

.case-template-use {
  color: #cfe5df;
  font-size: 13px;
}

.case-template-prompt {
  color: #b7c9c3;
  font-size: 13px;
}

.case-template-full-prompt {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(111, 230, 207, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
}

.case-template-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #e9fff8;
  font-size: 12px;
}

.case-template-prompt-head span {
  color: #9cc9bd;
  font-size: 11px;
}

.case-template-full-prompt pre {
  margin: 0;
  max-height: 210px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #d7f7ee;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.case-template-needs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-template-needs span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dffaf4;
  font-size: 11px;
  font-weight: 720;
  padding: 4px 8px;
}

.case-template-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
}

.case-template-actions button {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.case-template-actions .is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: #e8f8f3;
}

.case-template-card .template-chip-row span {
  background: rgba(90, 220, 194, 0.12);
  border-color: rgba(111, 230, 207, 0.24);
  color: #b7f3df;
}

body.theme-dark .case-template-card {
  background: #151f1d;
  border-color: #304943;
}

body.theme-dark .case-template-visual {
  background:
    linear-gradient(135deg, rgba(20, 31, 29, 0.98), rgba(35, 104, 94, 0.55)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent);
}

.template-card-head {
  display: grid;
  gap: 4px;
}

.template-card-head strong {
  color: var(--text);
  font-size: 15px;
}

.template-card-head small {
  color: var(--muted);
  line-height: 1.45;
}

.template-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-chip-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4faf8;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 760;
  padding: 4px 8px;
}

.template-list {
  display: grid;
  gap: 6px;
}

.template-list strong {
  font-size: 12px;
  color: var(--text);
}

.template-list ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

body.theme-dark .template-chip-row span {
  background: #122821;
  border-color: #284139;
  color: #b7f3df;
}

body.theme-dark .template-card-head strong,
body.theme-dark .template-list strong {
  color: #ecfdf5;
}

.palette-preview {
  display: grid;
  gap: 12px;
}

.palette-empty {
  display: grid;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fbfdfc;
}

.palette-empty strong {
  color: var(--text);
}

.swatch-stack {
  display: grid;
  gap: 8px;
}

.swatch-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.swatch-color {
  display: block;
  width: 54px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.swatch-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.swatch-row strong {
  color: var(--text);
  font-size: 13px;
}

.swatch-row small {
  color: var(--muted);
  line-height: 1.35;
}

.tone-data-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.tone-data-mini span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4faf8;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 760;
  padding: 7px 8px;
  text-align: center;
}

body.theme-dark .palette-empty,
body.theme-dark .swatch-row {
  background: #101816;
  border-color: #284139;
}

body.theme-dark .tone-data-mini span {
  background: #122821;
  border-color: #284139;
  color: #b7f3df;
}

.gate-review-panel {
  display: block;
}

.review-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.gate-review-list {
  display: grid;
  gap: 10px;
}

.gate-review-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px;
}

.gate-review-item > div:first-child {
  display: grid;
  gap: 4px;
}

.gate-review-item strong {
  color: var(--text);
  font-size: 13px;
}

.gate-review-item small {
  color: var(--muted);
  line-height: 1.4;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-actions .active {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.gate-review {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 10px;
}

.gate-review-head {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.gate-review-head strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.gate-review-head small {
  color: var(--muted);
  line-height: 1.35;
}

.gate-review-status {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.gate-review-status button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 5px 9px;
}

.gate-review-status button.active.approve {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.gate-review-status button.active.revise {
  background: #fef3c7;
  border-color: #facc15;
  color: #92400e;
}

.gate-review textarea {
  min-height: 66px;
  resize: vertical;
}

.gate-review.revise-required {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.08);
}

body.theme-dark .gate-review {
  background: #182522;
  border-color: #304943;
}

body.theme-dark .gate-review-item {
  background: #182522;
  border-color: #304943;
}

body.theme-dark .gate-review-item strong {
  color: #e8efeb;
}

body.theme-dark .review-actions .active {
  background: #203b30;
  border-color: #5d9f7c;
  color: #b7e6ca;
}

body.theme-dark .gate-review-head strong {
  color: #e8efeb;
}

body.theme-dark .gate-review-status button {
  background: #15211f;
  border-color: #3a514c;
  color: #b6c7c2;
}

body.theme-dark .gate-review-status button.active.approve {
  background: #203b30;
  border-color: #5d9f7c;
  color: #b7e6ca;
}

body.theme-dark .gate-review-status button.active.revise {
  background: #3d3218;
  border-color: #8a7439;
  color: #ead08a;
}

body.theme-dark .gate-review.revise-required {
  border-color: #8a7439;
  box-shadow: 0 0 0 1px rgba(222, 194, 124, 0.12);
}

.output,
.skill-content {
  width: 100%;
  min-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
  color: var(--ink);
  padding: 16px;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.output {
  max-height: min(68vh, 760px);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  scrollbar-gutter: stable;
}

.output-actions {
  display: none;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -4px 0 10px;
}

.output-actions.has-actions {
  display: flex;
}

.output-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.output-actions .variant-copy {
  min-height: 30px;
}

.output.is-empty {
  color: var(--muted);
}

.skill-content {
  max-height: 360px;
  background: #101817;
  border-color: #12201e;
  color: #ecf5f2;
  font-size: 13px;
}

.ghost.copied {
  border-color: #8fcbb7;
  background: #e8f7f1;
  color: var(--accent-dark);
}

.ghost.copy-failed {
  border-color: #efb3aa;
  background: var(--danger-bg);
  color: var(--danger);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 16px;
}

.compact-grid {
  margin-top: 16px;
}

.compact-grid h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.visual-grid,
.project-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.metric-card,
.project-kpi {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
}

.metric-card {
  display: grid;
  gap: 10px;
}

.metric-card.feature {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.metric-card span,
.project-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.metric-card strong,
.project-kpi strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 19px;
}

.metric-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.ring {
  --value: 0;
  position: relative;
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(var(--accent) calc(var(--value) * 1%), #e7efec 0);
}

.ring::before {
  content: "";
  position: absolute;
  width: 54px;
  aspect-ratio: 1;
  border-radius: inherit;
  background: var(--panel-soft);
}

.ring span {
  position: relative;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.split-meter {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efec;
}

.split-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.split-meter.dual i {
  background: linear-gradient(90deg, var(--accent), #6fb7a8);
}

.project-space {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.project-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-filter {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.project-filter.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.project-run-list {
  display: grid;
  gap: 10px;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.project-card-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.project-card-main strong,
.project-card-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-main small,
.project-card-meta,
.project-empty span {
  color: var(--muted);
  font-size: 12px;
}

.project-card-meta {
  display: grid;
  gap: 5px;
  justify-items: end;
}

.status-chip {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 850;
}

.status-chip.success {
  background: var(--pass-bg);
  color: var(--pass);
}

.status-chip.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-chip.stopped,
.status-chip.neutral {
  background: var(--warn-bg);
  color: var(--warn);
}

.project-empty {
  display: grid;
  gap: 5px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 18px;
  text-align: center;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 16px;
}

.user-table,
.run-table {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.table-row {
  display: grid;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.user-row {
  grid-template-columns: minmax(160px, 1.2fr) 110px 90px 130px 130px auto;
}

.user-row.user-inactive {
  opacity: 0.55;
  border-style: dashed;
}

.user-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.badge-suspended {
  background: #fef3cd;
  color: #856404;
}

.badge-deleted {
  background: var(--danger-bg);
  color: var(--danger);
}

.warning-button {
  background: var(--warn-bg, #fef3cd);
  color: var(--warn, #856404);
}

body.theme-dark .badge-suspended {
  background: var(--warn-badge-bg);
  color: var(--warn-badge);
}

.run-row {
  grid-template-columns: minmax(160px, 1fr) 90px 90px 110px 100px 120px auto;
}

.my-run-row {
  grid-template-columns: minmax(220px, 1fr) 110px 120px 100px auto;
}

.row-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.row-title strong,
.row-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-title small,
.table-row span {
  color: var(--muted);
  font-size: 12px;
}

.quota-status {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 760;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions button {
  min-height: 32px;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.danger-button {
  background: var(--danger-bg);
  color: var(--danger);
}

.password-form {
  display: grid;
  gap: 12px;
}

.bar-chart,
.breakdown-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.bar-row,
.breakdown-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 96px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.breakdown-row {
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-soft);
}

.breakdown-row div:first-child {
  display: grid;
  gap: 4px;
}

.breakdown-row strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efec;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.run-detail {
  min-height: 220px;
  margin-top: 14px;
}

.mini-card,
.rule-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 14px;
  font-weight: 760;
}

.mini-card.muted {
  color: var(--muted);
}

.rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.source-view {
  display: none !important;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
}

.source-view summary {
  cursor: pointer;
  font-weight: 820;
}

.source-view small {
  display: block;
  margin: 8px 0;
  color: var(--muted);
  word-break: break-all;
}

.developer-meta {
  margin-top: 10px;
  color: var(--accent-dark);
  font-weight: 780;
}

.char-pipeline {
  position: sticky;
  top: 0;
  z-index: 35;
  padding: 10px 0 12px;
  background: var(--bg);
  box-shadow: 0 14px 26px rgba(22, 35, 32, 0.08);
}

.char-pipeline-bar {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.char-pipeline-bar li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
}
.char-pipeline-bar li:first-child { border-radius: 8px 0 0 8px; }
.char-pipeline-bar li:last-child { border-radius: 0 8px 8px 0; }
.char-pipeline-bar li + li { border-left: none; }

.char-pipeline-bar li .char-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 820;
  flex-shrink: 0;
  background: var(--line);
  color: var(--muted);
}

.char-pipeline-bar li .char-step-label {
  font-size: 12px;
  font-weight: 680;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-pipeline-bar li.done .char-step-num {
  background: var(--accent);
  color: #fff;
}
.char-pipeline-bar li.done .char-step-label { color: var(--ink); }

.char-pipeline-bar li.active {
  background: #eef8f5;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
  z-index: 1;
}
.char-pipeline-bar li.active .char-step-num {
  background: var(--accent);
  color: #fff;
}
.char-pipeline-bar li.active .char-step-label {
  color: var(--ink);
  font-weight: 820;
}

.char-pipeline-bar li.locked { opacity: 0.5; }
.char-pipeline-bar li.clickable { cursor: pointer; }
.char-pipeline-bar li.clickable:hover { background: #f0faf7; }

.char-gate-guide {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  margin-bottom: 14px;
}
.char-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.char-guide-grid strong {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.char-guide-grid ul {
  margin: 0;
  padding: 0 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
}

.char-dialogue-area {
  margin-bottom: 16px;
}
.char-dialogue-area span {
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
}
.char-dialogue-area textarea {
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 0.15s;
}
.char-dialogue-area textarea:focus {
  border-color: var(--focus);
  outline: none;
}

.char-suggest-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.char-suggest-bar button { white-space: nowrap; }
.char-suggest-status {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}
.char-suggest-chips {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 6px 0 4px;
}
.char-suggest-chip {
  display: block;
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  word-break: break-word;
}
.char-suggest-chip:hover {
  background: var(--accent);
  color: #fff;
}
.char-suggest-chip.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.char-suggest-chip::before {
  content: attr(data-idx);
  display: inline-block;
  width: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-right: 4px;
}
.char-suggest-chip:hover::before,
.char-suggest-chip.selected::before { color: #fff; }

.char-input-section { margin-bottom: 14px; }

#characterPanel .inspector {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

#characterPanel .inspector > .panel:nth-child(1) {
  flex: 0 0 auto;
}

#characterPanel .inspector > .panel:nth-child(2) {
  order: 3;
  flex: 0 0 auto;
}

#characterPanel .inspector > .panel:nth-child(3) {
  order: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#characterPanel #charGateList {
  max-height: 140px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

#characterPanel #charOutputBox {
  flex: 1 1 auto;
  min-height: min(50vh, 480px);
  max-height: min(76vh, 880px);
  overscroll-behavior: contain;
}

.char-locked-summary {
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 80px;
  overflow-y: auto;
}

.char-qa-upload-block .drop-zone {
  border-color: var(--accent);
}

.char-qa-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
}

.char-qa-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.char-qa-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.char-qa-check span {
  font-weight: 600;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
}

.char-qa-history {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}


/* ===== SCENE ASSET PANEL ===== */

.scene-pipeline {
  position: sticky;
  top: 0;
  z-index: 35;
  padding: 10px 0 12px;
  background: var(--bg);
  box-shadow: 0 14px 26px rgba(22, 35, 32, 0.08);
}

.scene-pipeline-bar {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.scene-pipeline-bar li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
}
.scene-pipeline-bar li:first-child { border-radius: 8px 0 0 8px; }
.scene-pipeline-bar li:last-child { border-radius: 0 8px 8px 0; }
.scene-pipeline-bar li + li { border-left: none; }

.scene-pipeline-bar li .scene-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 820;
  flex-shrink: 0;
  background: var(--line);
  color: var(--muted);
}

.scene-pipeline-bar li .scene-step-label {
  font-size: 12px;
  font-weight: 680;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-pipeline-bar li.done .scene-step-num {
  background: var(--accent);
  color: #fff;
}
.scene-pipeline-bar li.done .scene-step-label { color: var(--ink); }

.scene-pipeline-bar li.active {
  background: #eef8f5;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
  z-index: 1;
}
.scene-pipeline-bar li.active .scene-step-num {
  background: var(--accent);
  color: #fff;
}
.scene-pipeline-bar li.active .scene-step-label {
  color: var(--ink);
  font-weight: 820;
}

.scene-pipeline-bar li.locked { opacity: 0.5; }
.scene-pipeline-bar li.clickable { cursor: pointer; }
.scene-pipeline-bar li.clickable:hover { background: #f0faf7; }

.scene-gate-guide {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  margin-bottom: 14px;
}
.scene-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.scene-guide-grid strong {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.scene-guide-grid ul {
  margin: 0;
  padding: 0 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
}

.scene-dialogue-area {
  margin-bottom: 16px;
}
.scene-dialogue-area span {
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
}
.scene-dialogue-area textarea {
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 0.15s;
}
.scene-dialogue-area textarea:focus {
  border-color: var(--focus);
  outline: none;
}

.scene-suggest-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.scene-suggest-bar button { white-space: nowrap; }
.scene-suggest-status {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}
.scene-suggest-chips {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 6px 0 4px;
}
.scene-suggest-chip {
  display: block;
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  word-break: break-word;
}
.scene-suggest-chip:hover {
  background: var(--accent);
  color: #fff;
}
.scene-suggest-chip.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.scene-suggest-chip::before {
  content: attr(data-idx);
  display: inline-block;
  width: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-right: 4px;
}
.scene-suggest-chip:hover::before,
.scene-suggest-chip.selected::before { color: #fff; }

.scene-input-section { margin-bottom: 14px; }

#scenePanel .inspector {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

#scenePanel .inspector > .panel:nth-child(1) {
  flex: 0 0 auto;
}

#scenePanel .inspector > .panel:nth-child(2) {
  order: 3;
  flex: 0 0 auto;
}

#scenePanel .inspector > .panel:nth-child(3) {
  order: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#scenePanel #sceneGateList {
  max-height: 180px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

#scenePanel #sceneOutputBox {
  flex: 1 1 auto;
  min-height: min(50vh, 480px);
  max-height: min(76vh, 880px);
  overscroll-behavior: contain;
}

.scene-locked-summary {
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 80px;
  overflow-y: auto;
}

.scene-qa-upload-block .drop-zone {
  border-color: var(--accent);
}

.scene-qa-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
}

.scene-qa-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.scene-qa-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.scene-qa-check span {
  font-weight: 600;
}

.scene-qa-history {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}


/* ===== PROP ASSET PANEL ===== */

.prop-pipeline {
  position: sticky;
  top: 0;
  z-index: 35;
  padding: 10px 0 12px;
  background: var(--bg);
  box-shadow: 0 14px 26px rgba(22, 35, 32, 0.08);
}

.prop-pipeline-bar {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.prop-pipeline-bar li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
}
.prop-pipeline-bar li:first-child { border-radius: 8px 0 0 8px; }
.prop-pipeline-bar li:last-child { border-radius: 0 8px 8px 0; }
.prop-pipeline-bar li + li { border-left: none; }

.prop-pipeline-bar li .prop-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 820;
  flex-shrink: 0;
  background: var(--line);
  color: var(--muted);
}

.prop-pipeline-bar li .prop-step-label {
  font-size: 12px;
  font-weight: 680;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prop-pipeline-bar li.done .prop-step-num {
  background: var(--accent);
  color: #fff;
}
.prop-pipeline-bar li.done .prop-step-label { color: var(--ink); }

.prop-pipeline-bar li.active {
  background: #eef8f5;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
  z-index: 1;
}
.prop-pipeline-bar li.active .prop-step-num {
  background: var(--accent);
  color: #fff;
}
.prop-pipeline-bar li.active .prop-step-label {
  color: var(--ink);
  font-weight: 820;
}

.prop-pipeline-bar li.locked { opacity: 0.5; }
.prop-pipeline-bar li.clickable { cursor: pointer; }
.prop-pipeline-bar li.clickable:hover { background: #f0faf7; }

.prop-gate-guide {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  margin-bottom: 14px;
}
.prop-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.prop-guide-grid strong {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.prop-guide-grid ul {
  margin: 0;
  padding: 0 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
}

.prop-dialogue-area {
  margin-bottom: 16px;
}
.prop-dialogue-area span {
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
}
.prop-dialogue-area textarea {
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 0.15s;
}
.prop-dialogue-area textarea:focus {
  border-color: var(--focus);
  outline: none;
}

.prop-suggest-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.prop-suggest-bar button { white-space: nowrap; }
.prop-suggest-status {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}
.prop-suggest-chips {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 6px 0 4px;
}
.prop-suggest-chip {
  display: block;
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  word-break: break-word;
}
.prop-suggest-chip:hover {
  background: var(--accent);
  color: #fff;
}
.prop-suggest-chip.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.prop-suggest-chip::before {
  content: attr(data-idx);
  display: inline-block;
  width: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-right: 4px;
}
.prop-suggest-chip:hover::before,
.prop-suggest-chip.selected::before { color: #fff; }

.prop-input-section { margin-bottom: 14px; }

#propPanel .inspector {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

#propPanel .inspector > .panel:nth-child(1) {
  flex: 0 0 auto;
}

#propPanel .inspector > .panel:nth-child(2) {
  order: 3;
  flex: 0 0 auto;
}

#propPanel .inspector > .panel:nth-child(3) {
  order: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#propPanel #propGateList {
  max-height: 180px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

#propPanel #propOutputBox {
  flex: 1 1 auto;
  min-height: min(50vh, 480px);
  max-height: min(76vh, 880px);
  overscroll-behavior: contain;
}

.prop-locked-summary {
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 80px;
  overflow-y: auto;
}

.prop-qa-upload-block .drop-zone {
  border-color: var(--accent);
}

.prop-qa-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
}

.prop-qa-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.prop-qa-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.prop-qa-check span {
  font-weight: 600;
}

.prop-qa-history {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

/* ── Character Mode Selector ── */
.char-mode-selector {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  overflow-x: auto;
}

.char-mode-card {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}
.char-mode-card:hover {
  border-color: var(--accent);
  background: #f0faf7;
}
.char-mode-card.active {
  border-color: var(--accent);
  background: #eef8f5;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.char-mode-card.featured {
  border-color: #d4a843;
  background: linear-gradient(135deg, #fefcf3, #fdf6e3);
}
.char-mode-card.featured:hover {
  border-color: #c9952f;
}
.char-mode-card.featured.active {
  border-color: #c9952f;
  box-shadow: 0 0 0 3px rgba(201, 149, 47, 0.18);
}
.char-mode-icon {
  font-size: 22px;
  line-height: 1;
}
.char-mode-card strong {
  font-size: 13px;
  font-weight: 820;
  color: var(--ink);
}
.char-mode-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

/* ── Quick Mode Steps ── */
.char-quick-step-header {
  margin-bottom: 12px;
}
.char-quick-step-header strong {
  font-size: 15px;
  font-weight: 820;
  color: var(--ink);
  display: block;
}
.char-quick-step-header span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.char-quick-options {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}
.char-quick-options.wrap {
  flex-wrap: wrap;
}

.char-quick-option {
  padding: 10px 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.char-quick-option:hover {
  border-color: var(--accent);
  background: #f0faf7;
}
.char-quick-option.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.char-quick-option.random {
  border-style: dashed;
  color: var(--muted);
}
.char-quick-option.random:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.char-quick-option.random.selected {
  border-style: solid;
  background: var(--accent);
  color: #fff;
}

.char-quick-option.color-swatch::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--swatch);
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid rgba(0,0,0,0.1);
}
.char-quick-option.color-swatch.selected::before {
  border-color: rgba(255,255,255,0.4);
}

.char-quick-custom {
  margin-top: 10px;
}
.char-quick-custom span {
  font-size: 11px;
  color: var(--muted);
}

.char-quick-summary {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
  color: var(--ink);
}

/* ── Cycling Menu ── */
.char-cycle-menu {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
}
.char-cycle-menu strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.char-cycle-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.char-cycle-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: all 0.12s;
}
.char-cycle-btn:hover {
  border-color: var(--accent);
  background: #f0faf7;
}
.char-cycle-btn .char-cycle-key {
  font-weight: 820;
  color: var(--accent);
  margin-right: 6px;
}

/* ── Script Mode Role Table ── */
.char-script-role-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
}
.char-script-role-table table {
  width: 100%;
  border-collapse: collapse;
}
.char-script-role-table th,
.char-script-role-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.char-script-role-table th {
  background: var(--panel-soft);
  font-weight: 680;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.char-script-role-table tr:last-child td {
  border-bottom: none;
}

/* ── Script Mode Role Tabs ── */
.char-script-role-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.char-script-role-tabs .char-quick-option {
  padding: 6px 12px;
  font-size: 12px;
}
.char-script-current,
.char-script-summary {
  margin-top: 14px;
}

/* ── Dark Theme Overrides ── */
body.theme-dark .char-mode-card {
  border-color: var(--line);
  background: var(--panel-soft);
}
body.theme-dark .char-mode-card:hover {
  background: #1a2e2a;
}
body.theme-dark .char-mode-card.active {
  background: #162824;
  border-color: var(--accent);
}
body.theme-dark .char-mode-card.featured {
  background: linear-gradient(135deg, #2a2518, #332c1a);
  border-color: #8a7430;
}
body.theme-dark .char-quick-option {
  background: var(--panel-soft);
  border-color: var(--line);
}
body.theme-dark .char-quick-option:hover {
  background: #1a2e2a;
}
body.theme-dark .char-quick-option.selected {
  background: var(--accent);
}
body.theme-dark .char-cycle-menu {
  background: var(--panel-soft);
}
body.theme-dark .char-cycle-btn {
  background: var(--bg);
  border-color: var(--line);
}
body.theme-dark .char-cycle-btn:hover {
  background: #1a2e2a;
}

/* ── Scene Mode Selector (mirrors char-mode-*) ── */
.scene-mode-selector {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  overflow-x: auto;
}
.scene-mode-card {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}
.scene-mode-card:hover {
  border-color: var(--accent);
  background: #f0faf7;
}
.scene-mode-card.active {
  border-color: var(--accent);
  background: #eef8f5;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.scene-mode-icon {
  font-size: 22px;
  line-height: 1;
}
.scene-mode-card strong {
  font-size: 13px;
  font-weight: 820;
  color: var(--ink);
}
.scene-mode-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
body.theme-dark .scene-mode-card {
  border-color: var(--line);
  background: var(--panel-soft);
}
body.theme-dark .scene-mode-card:hover {
  background: #1a2e2a;
}
body.theme-dark .scene-mode-card.active {
  background: #162824;
  border-color: var(--accent);
}

/* ── Scene Quick Mode Steps ── */
.scene-quick-step-header {
  margin-bottom: 12px;
}
.scene-quick-step-header strong {
  font-size: 15px;
  font-weight: 820;
  color: var(--ink);
  display: block;
}
.scene-quick-step-header span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}
.scene-quick-options {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}
.scene-quick-options.wrap {
  flex-wrap: wrap;
}
.scene-quick-option {
  padding: 10px 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.scene-quick-option:hover {
  border-color: var(--accent);
  background: #f0faf7;
}
.scene-quick-option.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.scene-quick-option.random {
  border-style: dashed;
  color: var(--muted);
}
.scene-quick-option.random:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.scene-quick-option.random.selected {
  border-style: solid;
  background: var(--accent);
  color: #fff;
}
.scene-quick-custom {
  margin-top: 10px;
}
.scene-quick-custom span {
  font-size: 11px;
  color: var(--muted);
}
body.theme-dark .scene-quick-option {
  background: var(--panel-soft);
  border-color: var(--line);
}
body.theme-dark .scene-quick-option:hover {
  background: #1a2e2a;
}
body.theme-dark .scene-quick-option.selected {
  background: var(--accent);
}
.scene-script-role-table {
  display: grid;
  gap: 6px;
}

/* ── Prop Mode Selector (mirrors scene-mode-*) ── */
.prop-mode-selector {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  overflow-x: auto;
}
.prop-mode-card {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}
.prop-mode-card:hover {
  border-color: var(--accent);
  background: #f0faf7;
}
.prop-mode-card.active {
  border-color: var(--accent);
  background: #eef8f5;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.prop-mode-icon {
  font-size: 22px;
  line-height: 1;
}
.prop-mode-card strong {
  font-size: 13px;
  font-weight: 820;
  color: var(--ink);
}
.prop-mode-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
body.theme-dark .prop-mode-card {
  border-color: var(--line);
  background: var(--panel-soft);
}
body.theme-dark .prop-mode-card:hover {
  background: #1a2e2a;
}
body.theme-dark .prop-mode-card.active {
  background: #162824;
  border-color: var(--accent);
}

/* ── Prop Quick Mode Steps ── */
.prop-quick-step-header {
  margin-bottom: 12px;
}
.prop-quick-step-header strong {
  font-size: 15px;
  font-weight: 820;
  color: var(--ink);
  display: block;
}
.prop-quick-step-header span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}
.prop-quick-options {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}
.prop-quick-options.wrap {
  flex-wrap: wrap;
}
.prop-quick-option {
  padding: 10px 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.prop-quick-option:hover {
  border-color: var(--accent);
  background: #f0faf7;
}
.prop-quick-option.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.prop-quick-option.random {
  border-style: dashed;
  color: var(--muted);
}
.prop-quick-option.random:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.prop-quick-option.random.selected {
  border-style: solid;
  background: var(--accent);
  color: #fff;
}
.prop-quick-custom {
  margin-top: 10px;
}
.prop-quick-custom span {
  font-size: 11px;
  color: var(--muted);
}
body.theme-dark .prop-quick-option {
  background: var(--panel-soft);
  border-color: var(--line);
}
body.theme-dark .prop-quick-option:hover {
  background: #1a2e2a;
}
body.theme-dark .prop-quick-option.selected {
  background: var(--accent);
}
.prop-script-role-table {
  display: grid;
  gap: 6px;
}

/* ── Storyboard Panel — Mode Selector ── */
.sb-mode-selector {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  overflow-x: auto;
}
.sb-mode-card {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 10px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
}
.sb-mode-card:hover {
  border-color: var(--accent);
  background: #f0faf7;
}
.sb-mode-card.active {
  border-color: var(--accent);
  background: #eef8f5;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sb-mode-icon {
  font-size: 22px;
  line-height: 1;
}
.sb-mode-card strong {
  font-size: 13px;
  font-weight: 820;
  color: var(--ink);
}
.sb-mode-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
body.theme-dark .sb-mode-card {
  border-color: var(--line);
  background: var(--panel-soft);
}
body.theme-dark .sb-mode-card:hover {
  background: #1a2e2a;
}
body.theme-dark .sb-mode-card.active {
  background: #162824;
  border-color: var(--accent);
}

/* ── Storyboard Pipeline ── */
.sb-pipeline {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 8px 0;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.sb-pipeline-bar {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  overflow-x: auto;
}
.sb-pipeline-bar li {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  min-width: 56px;
}
.sb-pipeline-bar li:first-child { border-radius: 8px 0 0 8px; }
.sb-pipeline-bar li:last-child { border-radius: 0 8px 8px 0; }
.sb-pipeline-bar li + li { border-left: none; }

.sb-pipeline-bar li .sb-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.sb-pipeline-bar li .sb-step-label {
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 64px;
}

.sb-pipeline-bar li.done .sb-step-num {
  background: var(--accent);
  color: #fff;
}
.sb-pipeline-bar li.done .sb-step-label { color: var(--ink); }

.sb-pipeline-bar li.active {
  background: #eef8f5;
  border-color: var(--accent);
  z-index: 1;
}
.sb-pipeline-bar li.active .sb-step-num {
  background: var(--accent);
  color: #fff;
}
.sb-pipeline-bar li.active .sb-step-label {
  color: var(--ink);
  font-weight: 700;
}

.sb-pipeline-bar li.locked { opacity: 0.5; }
.sb-pipeline-bar li.clickable { cursor: pointer; }
.sb-pipeline-bar li.clickable:hover { background: #f0faf7; }

/* ── Storyboard Gate Guide ── */
.sb-gate-guide {
  background: #f7faf9;
  border: 1px solid #d9e8e3;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.sb-guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sb-guide-grid strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
}

.sb-guide-grid ul {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Storyboard Dialogue Area ── */
.sb-dialogue-area {
  margin-bottom: 10px;
}
.sb-dialogue-area span {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.sb-dialogue-area textarea {
  border: 2px solid var(--accent);
  background: #f7fdfb;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
}
.sb-dialogue-area textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

/* ── Storyboard Suggest Bar ── */
.sb-suggest-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sb-suggest-bar button { white-space: nowrap; }

/* ── Storyboard Input Sections ── */
.sb-input-section { margin-bottom: 14px; }

/* ── Storyboard QA ── */
.sb-qa-round-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--accent-bg, #e8f5f0);
  border-radius: 8px;
  margin-bottom: 14px;
}
.sb-qa-round-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}
.sb-qa-round-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.sb-qa-feedback-box {
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft, #f8fbfa);
}
.sb-qa-feedback-header {
  margin-bottom: 10px;
}
.sb-qa-feedback-header strong {
  font-size: 14px;
  color: var(--ink);
}
.sb-qa-feedback-header span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.sb-qa-feedback-box textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
}
.sb-qa-verdict-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}
.sb-qa-verdict-bar select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}
.sb-qa-verdict-bar button {
  white-space: nowrap;
}
.sb-qa-log {
  margin-top: 16px;
  border: 1px solid var(--border-light, #eee);
  border-radius: 8px;
  overflow: hidden;
}
.sb-qa-log-header {
  padding: 8px 14px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border-light, #eee);
}
.sb-qa-log-entries {
  padding: 8px 14px;
  max-height: 300px;
  overflow-y: auto;
}
.sb-qa-log-empty {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0;
}
.sb-qa-log-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light, #eee);
  font-size: 12px;
  line-height: 1.6;
}
.sb-qa-log-entry:last-child { border-bottom: none; }
.sb-qa-log-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.sb-qa-log-entry-head strong {
  font-size: 13px;
}
.sb-qa-log-verdict-pass { color: var(--accent); font-weight: 700; }
.sb-qa-log-verdict-fail { color: #c0392b; font-weight: 700; }
.sb-qa-log-feedback {
  white-space: pre-wrap;
  background: var(--panel-soft, #f8fbfa);
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 4px;
}
body.theme-dark .sb-qa-round-banner { background: rgba(255,255,255,.06); }
body.theme-dark .sb-qa-feedback-box { background: rgba(255,255,255,.04); border-color: var(--accent); }
body.theme-dark .sb-qa-log { border-color: var(--border); }
body.theme-dark .sb-qa-log-header { background: rgba(255,255,255,.04); border-color: var(--border); }
body.theme-dark .sb-qa-log-entry { border-color: var(--border); }
body.theme-dark .sb-qa-log-feedback { background: rgba(255,255,255,.04); }

/* ── Storyboard Blueprint Declaration ── */
.sb-blueprint-declaration {
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: var(--accent-bg, #e8f5f0);
}
.sb-blueprint-header {
  margin-bottom: 8px;
}
.sb-blueprint-header strong {
  font-size: 14px;
  color: var(--ink);
}
.sb-blueprint-header span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.sb-blueprint-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  background: var(--panel);
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin: 0;
}
.sb-asset-map {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.sb-asset-map-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light, #eee);
  font-size: 12px;
}
.sb-asset-map-item:last-child { border-bottom: none; }
.sb-asset-map-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.sb-asset-map-badge.blueprint { background: var(--accent); color: #fff; }
.sb-asset-map-badge.character { background: #3498db; color: #fff; }
.sb-asset-map-badge.scene { background: #e67e22; color: #fff; }
.sb-asset-map-badge.prop { background: #9b59b6; color: #fff; }
.sb-asset-map-badge.tone { background: #1abc9c; color: #fff; }
.sb-asset-map-badge.other { background: var(--muted); color: #fff; }
body.theme-dark .sb-blueprint-declaration { background: rgba(255,255,255,.04); }
body.theme-dark .sb-blueprint-text { background: rgba(255,255,255,.06); }
body.theme-dark .sb-asset-map { border-color: var(--border); }
body.theme-dark .sb-asset-map-item { border-color: var(--border); }

.sb-qa-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
}
.sb-qa-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.sb-qa-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}
.sb-qa-check span {
  color: var(--ink);
}

/* ── Storyboard Quick Mode Steps ── */
.sb-quick-step-header {
  margin-bottom: 12px;
}
.sb-quick-step-header strong {
  font-size: 15px;
  font-weight: 820;
  color: var(--ink);
  display: block;
}
.sb-quick-step-header span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}
.sb-quick-options {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}
.sb-quick-options.wrap {
  flex-wrap: wrap;
}
.sb-quick-option {
  padding: 10px 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.sb-quick-option:hover {
  border-color: var(--accent);
  background: #f0faf7;
}
.sb-quick-option.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.sb-quick-option.random {
  border-style: dashed;
  color: var(--muted);
}
.sb-quick-option.random:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.sb-quick-option.random.selected {
  border-style: solid;
  background: var(--accent);
  color: #fff;
}
.sb-quick-custom {
  margin-top: 10px;
}
.sb-quick-custom span {
  font-size: 11px;
  color: var(--muted);
}
body.theme-dark .sb-quick-option {
  background: var(--panel-soft);
  border-color: var(--line);
}
body.theme-dark .sb-quick-option:hover {
  background: #1a2e2a;
}
body.theme-dark .sb-quick-option.selected {
  background: var(--accent);
}
.sb-script-scene-table {
  display: grid;
  gap: 6px;
}

/* ── Storyboard Route Cards (Gate 8 A/B/C) ── */
.sb-route-header {
  margin-bottom: 14px;
}
.sb-route-header strong {
  font-size: 15px;
  font-weight: 820;
  color: var(--ink);
  display: block;
}
.sb-route-header span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}
.sb-route-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sb-route-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}
.sb-route-card:hover {
  border-color: var(--accent);
  background: #f0faf7;
}
.sb-route-card.active {
  border-color: var(--accent);
  background: #eef8f5;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sb-route-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.sb-route-card.active .sb-route-letter {
  background: var(--accent);
  color: #fff;
}
.sb-route-recommended {
  background: var(--accent) !important;
  color: #fff !important;
}
.sb-route-card strong {
  font-size: 14px;
  font-weight: 820;
  color: var(--ink);
}
.sb-route-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.sb-route-gates {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}
body.theme-dark .sb-route-card {
  border-color: var(--line);
  background: var(--panel-soft);
}
body.theme-dark .sb-route-card:hover {
  background: #1a2e2a;
}
body.theme-dark .sb-route-card.active {
  background: #162824;
  border-color: var(--accent);
}

/* ── Storyboard dark theme overrides ── */
body.theme-dark .sb-pipeline {
  background: var(--bg);
}
body.theme-dark .sb-pipeline-bar li.active {
  background: #162824;
}
body.theme-dark .sb-gate-guide {
  background: #1a2520;
  border-color: #2a3a35;
}
body.theme-dark .sb-dialogue-area textarea {
  background: #1a2520;
}
body.theme-dark .sb-pipeline-bar li,
body.theme-dark .sb-gate-guide,
body.theme-dark .sb-pipeline-bar li.clickable:hover {
  border-color: var(--line);
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .side-nav .nav-group-toggle,
  .side-nav .nav-group {
    grid-column: 1 / -1;
  }

  .nav-group.open {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vw-pipeline-bar {
    flex-wrap: wrap;
  }

  .vw-pipeline-bar li {
    flex: 1 1 auto;
    min-width: 120px;
  }

  .vw-guide-grid {
    grid-template-columns: 1fr;
  }

  .char-pipeline-bar {
    flex-wrap: wrap;
  }
  .char-pipeline-bar li {
    flex: 1 1 auto;
    min-width: 80px;
  }
  .char-guide-grid {
    grid-template-columns: 1fr;
  }

  .scene-pipeline-bar {
    flex-wrap: wrap;
  }
  .scene-pipeline-bar li {
    flex: 1 1 auto;
    min-width: 80px;
  }
  .scene-guide-grid {
    grid-template-columns: 1fr;
  }

  .prop-pipeline-bar {
    flex-wrap: wrap;
  }
  .prop-pipeline-bar li {
    flex: 1 1 auto;
    min-width: 80px;
  }
  .prop-guide-grid {
    grid-template-columns: 1fr;
  }

  .sb-pipeline-bar {
    flex-wrap: wrap;
  }
  .sb-pipeline-bar li {
    flex: 1 1 auto;
    min-width: 56px;
  }
  .sb-guide-grid {
    grid-template-columns: 1fr;
  }

  .admin-stats,
  .admin-form,
  .visual-grid,
  .project-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .user-row,
  .run-row,
  .my-run-row {
    grid-template-columns: 1fr;
  }

  .work-layout {
    grid-template-columns: 1fr;
  }

  .vw-work-layout {
    grid-template-columns: 1fr;
  }

  .inspector {
    position: static;
    max-height: none;
    overflow: visible;
  }

  #videoPanel #videoOutputBox {
    min-height: 420px;
    max-height: 70vh;
  }

  #videoPanel #videoGateList {
    max-height: 260px;
  }

  .project-card {
    grid-template-columns: 1fr;
  }

  .project-card-meta {
    justify-items: start;
  }

  .inspector {
    position: static;
  }
}

@media (max-width: 760px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .section-head {
    display: grid;
  }

  h1 {
    font-size: 25px;
  }

  .side-nav,
  .route-grid,
  .field-grid,
  .field-grid.two,
  .check-grid,
  .module-grid,
  .dashboard-grid,
  .visual-grid,
  .project-summary,
  .admin-stats,
  .admin-form,
  .rule-list {
    grid-template-columns: 1fr;
  }

  .vw-pipeline {
    position: static;
    box-shadow: none;
  }

  .vw-pipeline-bar { flex-direction: column; }
  .vw-pipeline-bar li { border-radius: 8px !important; border-left: 1px solid var(--line) !important; }
  .vw-pipeline-bar li + li { margin-top: -1px; border-top: none; }

  .vw-plan-panel {
    position: static;
    padding: 12px;
  }

  .char-pipeline {
    position: static;
    box-shadow: none;
  }
  .char-pipeline-bar { flex-direction: column; }
  .char-pipeline-bar li { border-radius: 8px !important; border-left: 1px solid var(--line) !important; }
  .char-pipeline-bar li + li { margin-top: -1px; border-top: none; }

  .sb-pipeline {
    position: static;
    box-shadow: none;
  }
  .sb-pipeline-bar { flex-direction: column; }
  .sb-pipeline-bar li { border-radius: 8px !important; border-left: 1px solid var(--line) !important; }
  .sb-pipeline-bar li + li { margin-top: -1px; border-top: none; }

  .route-card {
    min-height: auto;
  }

  .action-bar {
    justify-content: stretch;
  }

  .action-bar button {
    flex: 1 1 100%;
  }
}

.run-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 910;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.run-detail-overlay.hidden { display: none; }
.run-detail-drawer {
  background: var(--panel);
  border-radius: 12px;
  width: min(720px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.run-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.run-detail-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.run-detail-body {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.panel-history-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel-history-overlay.hidden { display: none; }
.panel-history-drawer {
  background: var(--panel);
  border-radius: 12px;
  width: min(680px, 92vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.panel-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.panel-history-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.panel-history-list {
  overflow-y: auto;
  padding: 8px 12px 16px;
  flex: 1;
}
.ph-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light, #eee);
}
.ph-row:last-child { border-bottom: none; }
.ph-meta { font-size: 12px; color: var(--muted); }
.ph-meta strong { color: var(--ink); font-weight: 600; font-size: 13px; }
.ph-meta small { display: block; margin-top: 2px; }
.ph-tokens { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ph-actions { display: flex; gap: 6px; }
.ph-actions button { font-size: 12px; padding: 4px 10px; }

body.theme-dark .panel-history-drawer { background: var(--panel); }
body.theme-dark .ph-row { border-bottom-color: var(--border); }

/* ═══════════════════════════════════════════════════════════════
   Design Refresh 2026-06-10 · 「放映室」电影暗色台
   追加覆盖层：令牌重调 + 字体三层 + 按钮体系 + 监视器输出区
   整层可回滚：删除本注释以下内容即恢复旧观感
   ═══════════════════════════════════════════════════════════════ */

:root {
  --font-sans: Inter, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  /* 亮色主题 · 制片厂白皮书（暖纸 + 深琥珀） */
  --bg: #f4f1ea;
  --panel: #fffdf8;
  --panel-soft: #f8f4ec;
  --ink: #221e16;
  --text: #221e16;
  --muted: #6e675a;
  --line: #e3dccd;
  --line-strong: #c9c0ab;
  --accent: #9a6700;
  --accent-dark: #7a5200;
  --accent-strong: #7a5200;
  --warn: #8a5a00;
  --warn-bg: #f7eed6;
  --danger: #b03326;
  --danger-bg: #f9e9e5;
  --pass: #2b7a4b;
  --pass-bg: #e9f3ea;
  --shadow: 0 16px 40px rgba(64, 52, 28, 0.1);
  /* 输出区随主题：浅色=纸面卡，深色=监视器黑 */
  --monitor-bg: #f7f3e8;
  --monitor-ink: #2c271e;
  --monitor-line: #d9d0bb;
  --monitor-muted: #8a8170;
  --monitor-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  --monitor-scan: rgba(60, 48, 20, 0.012);
}

body.theme-dark {
  /* 暗色主题 · 放映室（暖炭 + 哑光黄铜，与浅色同色温） */
  --bg: #151210;
  --panel: #1d1915;
  --panel-soft: #241f1a;
  --ink: #eae5da;
  --text: #eae5da;
  --muted: #a39882;
  --line: #2f2922;
  --line-strong: #4c4438;
  --accent: #c2a060;
  --accent-dark: #d4b87e;
  --accent-strong: #ab8a4c;
  --warn: #d6bd78;
  --warn-bg: #292212;
  --warn-badge: #d6bd78;
  --warn-badge-bg: #292212;
  --danger: #e89b93;
  --danger-bg: #2c1d1b;
  --pass: #9fd9b4;
  --pass-bg: #1c2619;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  --monitor-bg: #0d0f0e;
  --monitor-ink: #d8ddd9;
  --monitor-line: #262b29;
  --monitor-muted: #6c7672;
  --monitor-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), inset 0 12px 28px rgba(0, 0, 0, 0.3);
  --monitor-scan: rgba(255, 255, 255, 0.012);
  background: radial-gradient(1100px 520px at 18% -8%, rgba(194, 160, 96, 0.05), transparent 60%), var(--bg);
}

/* ── 暗色层次强化：侧栏更深、面板有边界与顶光 ── */
body.theme-dark .sidebar {
  background: #0f0d0b;
  border-right: 1px solid #241f1a;
}

body.theme-dark .panel {
  border: 1px solid #2a241d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 32px rgba(0, 0, 0, 0.38);
}

body.theme-dark .char-mode-card.active, body.theme-dark .scene-mode-card.active,
body.theme-dark .prop-mode-card.active, body.theme-dark .sb-mode-card.active {
  background: rgba(194, 160, 96, 0.09);
  border-color: var(--accent);
}

body.theme-dark .char-quick-option.selected, body.theme-dark .scene-quick-option.selected,
body.theme-dark .prop-quick-option.selected, body.theme-dark .sb-quick-option.selected {
  background: rgba(194, 160, 96, 0.14);
  border-color: var(--accent);
  color: var(--accent-dark);
}

body.theme-dark .drop-zone {
  background: #181511;
  border-color: var(--line-strong);
}

.eyebrow {
  letter-spacing: 0.1em;
}

body.theme-dark .eyebrow {
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.theme-dark .nav-item.active {
  background: rgba(194, 160, 96, 0.1);
}

body {
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}

h1, h2, h3, .row-title strong, .section-head h2 {
  letter-spacing: -0.01em;
}

/* ── 统一过渡 ── */
button, .nav-item, input, select, textarea,
.gate, .table-row, .image-card, .drop-zone,
.char-mode-card, .scene-mode-card, .prop-mode-card, .sb-mode-card,
.char-quick-option, .scene-quick-option, .prop-quick-option, .sb-quick-option {
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

/* ── 按钮体系 ── */
.primary, .run-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 130%);
  color: #ffffff;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

body.theme-dark .primary, body.theme-dark .run-button {
  color: #181004;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 2px 8px rgba(0, 0, 0, 0.35);
}

.primary:hover:not(:disabled), .run-button:hover:not(:disabled) {
  filter: brightness(1.06);
}

.primary:disabled, .run-button:disabled {
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
}

.secondary {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 8px;
}

.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
}

.ghost:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--ink);
}

/* ── 表单聚焦 ── */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ── 侧栏导航 ── */
.nav-item.active {
  background: var(--panel-soft);
  color: var(--accent-dark);
  box-shadow: inset 3px 0 0 var(--accent);
  border-radius: 0 8px 8px 0;
}

body.theme-dark .nav-item.active {
  color: var(--accent);
}

.nav-item:hover:not(.active) {
  background: var(--panel-soft);
  color: var(--ink);
}

/* ── 监视器输出区（双主题均为片场监视器黑） ── */
.output {
  background-color: var(--monitor-bg);
  background-image: repeating-linear-gradient(
    0deg,
    var(--monitor-scan) 0 1px,
    transparent 1px 3px
  );
  color: var(--monitor-ink);
  border: 1px solid var(--monitor-line);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.72;
  box-shadow: var(--monitor-shadow);
}

.output.is-empty, .output:empty {
  color: var(--monitor-muted);
  font-family: var(--font-sans);
  font-size: 13px;
}

.output::selection, .output *::selection {
  background: rgba(232, 176, 75, 0.35);
}

/* ── 数据等宽对齐 ── */
.quota-status, .ph-tokens, .stat-card strong, .metric-card strong,
.user-row span, .run-row span, .my-run-row span {
  font-variant-numeric: tabular-nums;
}

.stat-card strong, .metric-card strong {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

/* ── 闸口与卡片细节 ── */
.gate {
  border-radius: 8px;
}

.gate.pass span {
  color: var(--pass);
}

.panel, .table-row, .stat-card, .image-card {
  border-radius: 12px;
}

/* ── 滚动条 ── */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted);
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.output::-webkit-scrollbar-thumb {
  background-color: var(--monitor-line);
  background-clip: content-box;
}

/* ── 第二批 · 闸口流水线时间码风格 ── */
@keyframes gatePulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  50% { box-shadow: 0 0 0 5px transparent; }
}

@keyframes gatePop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.char-step-num, .scene-step-num, .prop-step-num, .sb-step-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  border-radius: 6px;
  font-weight: 700;
}

#charPipelineBar li.active .char-step-num,
#scenePipelineBar li.active .scene-step-num,
#propPipelineBar li.active .prop-step-num,
#sbPipelineBar li.active .sb-step-num {
  background: var(--accent);
  color: #ffffff;
  animation: gatePulse 2.2s ease-in-out infinite;
}

body.theme-dark #charPipelineBar li.active .char-step-num,
body.theme-dark #scenePipelineBar li.active .scene-step-num,
body.theme-dark #propPipelineBar li.active .prop-step-num,
body.theme-dark #sbPipelineBar li.active .sb-step-num {
  color: #181004;
}

#charPipelineBar li.done .char-step-num,
#scenePipelineBar li.done .scene-step-num,
#propPipelineBar li.done .prop-step-num,
#sbPipelineBar li.done .sb-step-num {
  color: var(--pass);
  animation: gatePop 0.22s ease;
}

#charPipelineBar li.locked, #scenePipelineBar li.locked,
#propPipelineBar li.locked, #sbPipelineBar li.locked {
  opacity: 0.45;
}

#charPipelineBar li.clickable:hover:not(.active),
#scenePipelineBar li.clickable:hover:not(.active),
#propPipelineBar li.clickable:hover:not(.active),
#sbPipelineBar li.clickable:hover:not(.active) {
  border-color: var(--accent);
  cursor: pointer;
}

/* ── 第二批 · 登录/着陆页融入品牌色（暖炭 + 黄铜） ── */
.login-screen {
  background: #14110e;
}

.login-glow {
  background: radial-gradient(circle, rgba(194, 160, 96, 0.1) 0%, transparent 60%);
}

.login-card {
  border-color: rgba(194, 160, 96, 0.22);
  background: rgba(24, 20, 16, 0.88);
}

.landing-tagline {
  color: rgba(194, 160, 96, 0.55);
}

.landing-enter {
  border-color: rgba(194, 160, 96, 0.4);
}

.landing-enter:hover {
  border-color: rgba(194, 160, 96, 0.8);
  color: #d4b87e;
}

/* ── 右侧栏版面优化：可复制结果优先且更大，锁定信息/闸口列表收紧 ── */
.inspector #charOutputBox, .inspector #sceneOutputBox,
.inspector #propOutputBox, .inspector #sbOutputBox {
  min-height: 480px;
  max-height: min(76vh, 880px);
}

.char-locked-summary, .scene-locked-summary,
.prop-locked-summary, .sb-locked-summary {
  min-height: 0;
  max-height: 190px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
}

.inspector .gate-list {
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

/* ═══ 重设计批次 2026-06-10 深夜 · 渐进披露/场记板/图标/动效/收纳 ═══ */

/* ── A1 闸口要点折叠 ── */
.gg-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 0;
  cursor: pointer;
}

.gg-toggle:hover {
  color: var(--accent-dark);
}

.gg-toggle-arrow {
  color: var(--accent);
  font-size: 11px;
}

.gg-collapsible.gg-collapsed > *:not(.gg-toggle) {
  display: none;
}

.gg-collapsible {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  background: var(--panel-soft);
}

.gg-collapsible:not(.gg-collapsed) {
  padding-bottom: 12px;
}

/* ── 上传区收紧 ── */
.drop-zone {
  padding: 12px 14px;
  min-height: 0;
}

.drop-zone strong {
  font-size: 13px;
}

.drop-zone span {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── A2 场记板闸口头部 ── */
#charGateEyebrow, #sceneGateEyebrow, #propGateEyebrow, #sbGateEyebrow {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
  position: relative;
  padding-top: 12px;
  display: inline-block;
}

#charGateEyebrow::before, #sceneGateEyebrow::before,
#propGateEyebrow::before, #sbGateEyebrow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 88px;
  height: 7px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    -55deg,
    var(--ink) 0 7px,
    transparent 7px 14px
  );
  opacity: 0.85;
}

#charGateBadge, #sceneGateBadge, #propGateBadge, #sbGateBadge {
  border: 1.5px solid var(--accent);
  color: var(--accent-dark);
  background: transparent;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  transform: rotate(-2.5deg);
  text-transform: uppercase;
}

/* ── A3 模式卡 SVG 图标 ── */
.char-mode-icon, .scene-mode-icon, .prop-mode-icon, .sb-mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-dark);
}

.char-mode-icon svg, .scene-mode-icon svg,
.prop-mode-icon svg, .sb-mode-icon svg {
  width: 22px;
  height: 22px;
}

.char-mode-card.active .char-mode-icon, .scene-mode-card.active .scene-mode-icon,
.prop-mode-card.active .prop-mode-icon, .sb-mode-card.active .sb-mode-icon {
  color: var(--accent);
}

/* ── A4 空状态：监视器待机画面 ── */
.output.is-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 32px 20px;
}

.output.is-empty::before {
  content: "";
  width: 84px;
  height: 56px;
  border: 2px solid var(--monitor-line);
  border-radius: 6px;
  background:
    radial-gradient(circle at 76px 8px, rgba(214, 90, 80, 0.9) 0 2.5px, transparent 3px),
    repeating-linear-gradient(90deg, transparent 0 9px, var(--monitor-scan) 9px 11px);
}

/* ── A6 微动效 ── */
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.panel-stack:not(.hidden) {
  animation: panelIn 0.18s ease;
}

@keyframes monitorFlash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent), inset 0 12px 28px rgba(0, 0, 0, 0.3); }
  100% { box-shadow: 0 0 0 9px transparent, inset 0 12px 28px rgba(0, 0, 0, 0.3); }
}

.output.monitor-flash {
  animation: monitorFlash 0.65s ease;
}

@keyframes copiedPop {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.ghost.copied {
  animation: copiedPop 0.25s ease;
  border-color: var(--pass);
  color: var(--pass);
}

/* ── B3 AI 建议按钮收紧 ── */
.char-suggest-bar, .scene-suggest-bar, .prop-suggest-bar, .sb-suggest-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

#charSuggestButton, #sceneSuggestButton, #propSuggestButton, #sbSuggestButton {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

#charSuggestButton:hover, #sceneSuggestButton:hover,
#propSuggestButton:hover, #sbSuggestButton:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* ── B4 管理行「⋯」收纳菜单 ── */
.row-more {
  position: relative;
  display: inline-block;
}

.row-more summary {
  list-style: none;
  cursor: pointer;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
  user-select: none;
}

.row-more summary::-webkit-details-marker {
  display: none;
}

.row-more[open] summary {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.row-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: grid;
  gap: 6px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 96px;
}

/* ── B6 路线卡与模式卡视觉对齐 ── */
.route-card.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ── A7 着陆页词条 ── */
.landing-terms {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  color: rgba(194, 160, 96, 0.7);
  text-align: center;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.landing-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── 输出区 Markdown 渲染 ── */
.output.md-rendered {
  white-space: normal;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.75;
}

.output.md-rendered p {
  margin: 0 0 10px;
}

.output.md-rendered .md-h {
  font-weight: 800;
  color: var(--monitor-ink);
  margin: 14px 0 8px;
  font-size: 14px;
  letter-spacing: 0.01em;
}

.output.md-rendered .md-h.md-h1 {
  font-size: 15.5px;
  border-bottom: 1px solid var(--monitor-line);
  padding-bottom: 6px;
}

.output.md-rendered table {
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 12px;
  font-family: var(--font-mono);
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

.output.md-rendered th, .output.md-rendered td {
  border: 1px solid var(--monitor-line);
  padding: 5px 9px;
  text-align: left;
  vertical-align: top;
  min-width: 56px;
}

.output.md-rendered th {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--accent-dark);
  font-weight: 700;
  white-space: nowrap;
}

.output.md-rendered code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: color-mix(in srgb, var(--monitor-ink) 7%, transparent);
  border-radius: 4px;
  padding: 1px 5px;
}

.output.md-rendered ul, .output.md-rendered ol {
  margin: 6px 0 10px;
  padding-left: 22px;
}

.output.md-rendered li {
  margin: 3px 0;
}

.output.md-rendered hr {
  border: none;
  border-top: 1px dashed var(--monitor-line);
  margin: 12px 0;
}

.output.md-rendered strong {
  color: var(--accent-dark);
}

/* ── 闸口总进度条 ── */
.gate-progress {
  height: 3px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0 2px;
}

.gate-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transition: width 0.35s ease;
}


/* ═══ 着陆页改版 v2 2026-06-11 · A版品牌主场（限宽编辑式 + 四模块带）═══
   整层可回滚：删除本段并恢复 index.html 着陆区旧结构即可 */

.landing-screen {
  display: block;
  background: #0a0705;
}

/* 中央琥珀微光晕（叠在底色与颗粒之间） */
.landing-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 70% at 46% 60%, rgba(194, 140, 60, 0.07) 0%, transparent 65%);
}

/* 限宽容器：超宽屏不散架 */
.landing-frame {
  position: relative;
  max-width: 1760px;
  height: 100%;
  margin: 0 auto;
  padding: 0 64px;
}

/* 主视觉：拉向中右，左右双向渐变融入黑场（裁切断口不可见） */
.landing-hero {
  position: absolute;
  right: 24px;
  bottom: 0;
  height: 94%;
  width: auto;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24%, #000 76%, transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, #000 24%, #000 76%, transparent 100%);
  animation: landing-hero-in 1.6s ease-out both;
}

@keyframes landing-hero-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 顶栏 */
.landing-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 30px 64px 0;
}

.landing-wordmark {
  color: #ece3d2;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.landing-wordmark em {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.34em;
  color: rgba(194, 160, 96, 0.85);
}

.landing-screen .landing-terms {
  margin: 4px 0 0;
  text-align: right;
}

/* 左侧品牌文案块 */
.landing-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 30px;
  height: 100%;
  max-width: 56%;
  padding-bottom: 60px;
  animation: landing-copy-in 0.9s ease-out 0.25s both;
}

@keyframes landing-copy-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.42em;
  color: rgba(194, 160, 96, 0.9);
  text-transform: uppercase;
}

.landing-eyebrow::before {
  content: "";
  width: 42px;
  height: 1px;
  background: rgba(194, 160, 96, 0.65);
}

.landing-brand {
  margin: 0;
  color: #f2ead9;
  font-size: clamp(64px, 8.2vw, 142px);
  font-weight: 900;
  line-height: 1.06;
  letter-spacing: 0.03em;
}

.landing-brand em {
  font-style: normal;
  display: block;
  color: #d8a64a;
}

.landing-slogan {
  margin: 0;
  color: rgba(222, 206, 178, 0.62);
  font-size: 21px;
  letter-spacing: 0.22em;
}

.landing-slogan b {
  color: #d8a64a;
  font-weight: 400;
}

.landing-desc {
  margin: 0;
  color: rgba(222, 206, 178, 0.42);
  font-size: 14.5px;
  line-height: 1.9;
  letter-spacing: 0.06em;
}

.landing-cta-row {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 6px;
}

.landing-screen .landing-enter {
  padding: 15px 50px;
  border-radius: 999px;
  border: 1px solid rgba(216, 166, 74, 0.55);
  background: rgba(194, 160, 96, 0.06);
  color: #f0e3c8;
  font-size: 14px;
  letter-spacing: 0.2em;
  transition: all 0.4s ease;
}

.landing-screen .landing-enter:hover {
  color: #f0e3c8;
  border-color: rgba(216, 166, 74, 0.95);
  background: rgba(194, 160, 96, 0.12);
  box-shadow: 0 0 46px rgba(216, 166, 74, 0.18);
}

.landing-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: rgba(194, 160, 96, 0.5);
}

/* 底部四模块带 */
.landing-modules {
  position: absolute;
  left: 64px;
  right: 64px;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(194, 160, 96, 0.18);
  animation: landing-copy-in 0.9s ease-out 0.55s both;
}

.landing-mod {
  padding: 22px 26px 26px;
  border-right: 1px solid rgba(194, 160, 96, 0.12);
}

.landing-mod:last-child {
  border-right: none;
}

.landing-mod i {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(216, 166, 74, 0.75);
  letter-spacing: 0.3em;
  margin-bottom: 8px;
}

.landing-mod b {
  display: block;
  color: rgba(240, 227, 200, 0.88);
  font-size: 16px;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 4px;
}

.landing-mod span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: rgba(222, 206, 178, 0.32);
  text-transform: uppercase;
}

/* 窄屏：主视觉退为背景，文案全宽，模块带 2x2 */
@media (max-width: 900px) {
  .landing-frame {
    padding: 0 28px;
  }

  .landing-hero {
    right: -10vw;
    opacity: 0.36;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40%);
            mask-image: linear-gradient(to right, transparent 0, #000 40%);
  }

  .landing-copy {
    max-width: 100%;
    padding-bottom: 150px;
    text-shadow: 0 1px 14px rgba(5, 3, 2, 0.85);
  }

  .landing-brand {
    font-size: clamp(46px, 11vw, 64px);
  }

  .landing-slogan {
    font-size: 17px;
  }

  .landing-topbar {
    padding: 22px 28px 0;
  }

  .landing-screen .landing-terms {
    display: none;
  }

  .landing-hint {
    display: none;
  }

  .landing-modules {
    left: 28px;
    right: 28px;
    grid-template-columns: repeat(2, 1fr);
  }

  .landing-mod {
    padding: 12px 14px 14px;
  }

  .landing-mod:nth-child(2) {
    border-right: none;
  }

  .landing-mod:nth-child(n + 3) {
    border-top: 1px solid rgba(194, 160, 96, 0.12);
  }
}


/* ═══ 品牌 mark 融入层 2026-06-11 · A标蒙版全站应用（侧栏/着陆/登录/页头水印/输出区台标）═══
   资产：assets/brand-mark.png（白+alpha 蒙版）/ favicon.png / brand-watermark.png（黄铜10%烘焙）
   整层可回滚：删除本段并恢复 index.html 四处品牌结构即可 */

.brand-mark {
  display: inline-block;
  aspect-ratio: 168 / 126;
  flex: none;
  -webkit-mask: url(/assets/brand-mark.png) center / contain no-repeat;
          mask: url(/assets/brand-mark.png) center / contain no-repeat;
}

/* 1/2. 侧栏品牌区（浅色深琥珀 / 深色黄铜） */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-text {
  display: grid;
  gap: 4px;
}

.side-mark {
  width: 42px;
  background: #9a6700;
}

body.theme-dark .side-mark {
  background: #c2a060;
}

/* 3. 着陆页顶栏 lockup */
.landing-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
}

.landing-mark {
  width: 50px;
  background: #ece3d2;
}

/* 4. 登录卡 */
.login-mark {
  width: 56px;
  justify-self: center;
  background: #c2a060;
}

.login-brand-cap {
  margin: -8px 0 0;
  text-align: center;
  color: #e8dfcc;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.login-brand-sub {
  margin: -14px 0 2px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.32em;
  color: rgba(194, 160, 96, 0.65);
}

/* 5. 工作区页头水印 */
.workspace .topbar {
  position: relative;
  overflow: hidden;
}

.workspace .topbar::after {
  content: "";
  position: absolute;
  right: 150px;
  top: 50%;
  transform: translateY(-50%);
  width: 150px;
  aspect-ratio: 168 / 126;
  background: url(/assets/brand-watermark.png) center / contain no-repeat;
  pointer-events: none;
}

/* 6. 输出区监视器台标（不随内容滚动，常驻右下角） */
.output {
  background-image: url(/assets/brand-watermark.png);
  background-repeat: no-repeat;
  background-position: right 14px bottom 12px;
  background-size: 54px auto;
}


/* ═══ 回复AI浮动对话坞 2026-06-11 ═══
   #xChatWrap 脱离文档流固定在右下角；收起=胶囊按钮，展开=完整输入区；AI 提问自动弹开 */

.chat-dock {
  position: fixed;
  right: 26px;
  bottom: 22px;
  z-index: 850;
  width: min(400px, calc(100vw - 52px));
  margin: 0 !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: 14px;
  padding: 12px 14px !important;
  background: var(--panel);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
}

.chat-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0 0 8px;
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

body.theme-dark .chat-dock-head {
  color: var(--accent);
}

.chat-dock-arrow {
  font-size: 11px;
  color: var(--muted);
}

/* 收起态：只剩胶囊 */
.chat-dock.chat-dock-collapsed {
  width: auto;
  padding: 10px 18px !important;
  border-radius: 999px;
}

.chat-dock.chat-dock-collapsed .chat-dock-head {
  padding: 0;
}

.chat-dock.chat-dock-collapsed > *:not(.chat-dock-head) {
  display: none !important;
}

.chat-dock.chat-dock-collapsed .chat-dock-arrow {
  transform: rotate(180deg);
}

/* AI 提问自动弹开时的提示脉冲 */
.chat-dock-pulse {
  animation: chat-dock-pulse 0.9s ease-out 2;
}

@keyframes chat-dock-pulse {
  0% { box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28), 0 0 0 0 rgba(194, 160, 96, 0.55); }
  100% { box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28), 0 0 0 14px rgba(194, 160, 96, 0); }
}

/* ═══ 登录卡黄铜化补遗 2026-06-12 ═══
   6-10 第二批只换了登录屏背景/光晕/卡片边框，输入框/标签/按钮仍是旧蓝色调，此处补齐 */

.login-card .field span {
  color: rgba(232, 223, 204, 0.62);
}

.login-card input {
  background: rgba(20, 16, 12, 0.6);
  border: 1px solid rgba(194, 160, 96, 0.18);
  color: #ece3d2;
}

.login-card input:focus {
  border-color: rgba(194, 160, 96, 0.45);
  box-shadow: 0 0 0 2px rgba(194, 160, 96, 0.12);
}

.login-card .primary {
  background: rgba(194, 160, 96, 0.18);
  border: 1px solid rgba(194, 160, 96, 0.35);
  color: #e8dfcc;
}

.login-card .primary:hover {
  background: rgba(194, 160, 96, 0.3);
  border-color: rgba(194, 160, 96, 0.6);
}

.login-back {
  color: rgba(190, 175, 150, 0.55);
}

.login-back:hover {
  color: rgba(232, 223, 204, 0.85);
}

/* ═══ 自由运镜导演板块 2026-06-12 ═══
   红线导轨特色版：贯穿红色轨迹线 hero、五维度/标记导轨、POV徽章、六项判定面板。
   红线色：浅色 #b8432f / 深色 #d96a55，呼应"划线控镜"。整层可回滚。 */

.fc-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 20px 24px 18px;
}

.fc-hero-line {
  position: absolute;
  inset: auto 0 6px 0;
  width: 100%;
  height: 56px;
  pointer-events: none;
}

.fc-path {
  stroke: #b8432f;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 12 8;
  opacity: 0.45;
  animation: fc-dash 9s linear infinite;
}

body.theme-dark .fc-path {
  stroke: #d96a55;
  opacity: 0.5;
}

@keyframes fc-dash {
  to { stroke-dashoffset: -400; }
}

.fc-hero-text {
  position: relative;
  z-index: 1;
}

.fc-hero-eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: #b8432f;
}

body.theme-dark .fc-hero-eyebrow {
  color: #d96a55;
}

.fc-hero-text h2 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: 0.04em;
}

.fc-hero-sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* ── 入口模式卡 ── */
.fc-mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.fc-mode-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.fc-mode-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.fc-mode-card.active {
  border-color: #b8432f;
  box-shadow: 0 0 0 1px #b8432f, 0 6px 18px rgba(184, 67, 47, 0.12);
}

body.theme-dark .fc-mode-card.active {
  border-color: #d96a55;
  box-shadow: 0 0 0 1px #d96a55, 0 6px 18px rgba(0, 0, 0, 0.3);
}

.fc-mode-num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #b8432f;
}

body.theme-dark .fc-mode-num {
  color: #d96a55;
}

.fc-mode-card strong {
  font-size: 14px;
}

.fc-mode-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── 导轨（维度/标记） + POV 徽章 ── */
.fc-field-label {
  margin: 14px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.fc-field-label::before {
  content: "─ ";
  color: #b8432f;
}

body.theme-dark .fc-field-label::before {
  color: #d96a55;
}

.fc-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fc-rail-card {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.fc-rail-card small {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}

.fc-rail-card:hover {
  border-color: var(--accent);
}

.fc-rail-card.active {
  border-color: #b8432f;
  background: rgba(184, 67, 47, 0.08);
  color: #b8432f;
}

.fc-rail-card.active small {
  color: rgba(184, 67, 47, 0.75);
}

body.theme-dark .fc-rail-card.active {
  border-color: #d96a55;
  background: rgba(217, 106, 85, 0.12);
  color: #d96a55;
}

body.theme-dark .fc-rail-card.active small {
  color: rgba(217, 106, 85, 0.8);
}

.fc-pov-badge {
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 64px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 8px 10px;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.fc-pov-badge small {
  font-size: 10px;
  color: var(--muted);
}

.fc-pov-badge:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.fc-pov-badge.active {
  border-color: #b8432f;
  background: rgba(184, 67, 47, 0.08);
}

.fc-pov-badge.active small {
  color: #b8432f;
  font-weight: 700;
}

body.theme-dark .fc-pov-badge.active {
  border-color: #d96a55;
  background: rgba(217, 106, 85, 0.12);
}

body.theme-dark .fc-pov-badge.active small {
  color: #d96a55;
}

/* ── 六项判定面板 ── */
.fc-judge {
  display: grid;
  gap: 6px;
}

.fc-judge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
}

.fc-judge-row strong {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  min-width: 56px;
}

.fc-judge-row em {
  margin-left: auto;
  font-style: normal;
  color: var(--muted);
  text-align: right;
}

.fc-judge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.fc-judge-row.pass .fc-judge-dot {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(194, 160, 96, 0.6);
}

.fc-judge-row.warn .fc-judge-dot {
  background: transparent;
  border: 1.5px solid var(--accent);
}

.fc-judge-row.stop .fc-judge-dot {
  background: #b8432f;
  box-shadow: 0 0 6px rgba(184, 67, 47, 0.55);
}

.fc-judge-row.stop {
  border-color: rgba(184, 67, 47, 0.5);
}

.fc-judge-row.stop em {
  color: #b8432f;
}

body.theme-dark .fc-judge-row.stop .fc-judge-dot {
  background: #d96a55;
}

body.theme-dark .fc-judge-row.stop em {
  color: #d96a55;
}

.fc-judge-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

/* ── 输出框限高（对齐四面板） + 复制弹跳 ── */
.inspector #fcOutputBox {
  min-height: 480px;
  max-height: min(76vh, 880px);
}

.copy-bounce {
  animation: fc-copy-bounce 0.4s ease;
}

@keyframes fc-copy-bounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

@media (max-width: 900px) {
  .fc-mode-selector {
    grid-template-columns: 1fr;
  }
}

/* ═══ 右侧栏滚动陷阱修复 2026-06-13 ═══
   scene/prop/sb 沿用 char 面板的成熟方案：inspector 整列限高 flex 布局，
   闸口列表限高、输出面板弹性占满剩余空间——输出框底部永远在视口内，
   不再出现"三层嵌套滚动拉不到底"（用户实测：场景面板输出不完整） */
#scenePanel .inspector,
#propPanel .inspector,
#storyboardPanel .inspector {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

#scenePanel .inspector > .panel,
#propPanel .inspector > .panel,
#storyboardPanel .inspector > .panel {
  flex: 0 0 auto;
}

#scenePanel .inspector > .panel:nth-child(2),
#propPanel .inspector > .panel:nth-child(2),
#storyboardPanel .inspector > .panel:nth-child(2) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#scenePanel #sceneGateList,
#propPanel #propGateList,
#storyboardPanel #sbGateList {
  max-height: 150px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

#scenePanel .inspector #sceneOutputBox,
#propPanel .inspector #propOutputBox,
#storyboardPanel .inspector #sbOutputBox {
  flex: 1 1 auto;
  /* 最小高必须可压缩：三个面板的刚性最小高加起来一旦超过列高就会被 overflow 裁掉 */
  min-height: 120px;
  max-height: min(76vh, 880px);
  overscroll-behavior: contain;
}

#scenePanel .scene-locked-summary,
#propPanel .prop-locked-summary,
#storyboardPanel .sb-locked-summary {
  max-height: 110px;
}

/* 对话坞可拖动提示 */
.chat-dock .chat-dock-head { cursor: grab; touch-action: none; user-select: none; }
.chat-dock .chat-dock-head:active { cursor: grabbing; }

/* ═══ 虚拟摄影棚侧栏入口 2026-06-12 ═══
   它是 <a> 不是 <button>：button 内容默认垂直居中、anchor 不会，
   必须补 flex 对齐才能和其它导航项行距一致（2026-06-13 用户反馈排版不齐） */
a.nav-item {
  display: flex;
  align-items: center;
  min-height: 42px;
  text-decoration: none;
  box-sizing: border-box;
}

a.nav-item::after {
  content: "↗";
  margin-left: 6px;
  font-size: 10px;
  color: var(--muted);
}

/* ── blocking-director 卡片复制按钮：强调色、加大、不被截断 ── */
.bd-card > summary {
  padding-right: 4px;
}
.bd-card-copy {
  flex: 0 0 auto;
  background: var(--brand, #b8860b);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  border: 0;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.bd-card-copy:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.bd-card-copy:active {
  transform: translateY(0);
}
.bd-card-copy.copy-bounce {
  animation: bdCopyPulse 0.32s ease;
}
@keyframes bdCopyPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ── 自定义机位独立浮窗（可拖拽、可叠放、不挡主界面） ── */
.bd-shot-popover-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
}
.bd-shot-popover {
  position: absolute;
  pointer-events: auto;
  width: min(480px, 92vw);
  max-width: 92vw;
  min-width: 280px;
  max-height: min(70vh, 620px);
  min-height: 200px;
  background: var(--panel, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: both;
  transition: box-shadow 0.15s ease;
  animation: bdPopIn 0.18s ease-out;
}
@keyframes bdPopIn {
  from { transform: translateY(-6px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.bd-shot-popover.is-dragging {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  transition: none;
  user-select: none;
}
.bd-shot-popover-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--panel-soft) 0%, var(--panel) 100%);
  border-bottom: 1px solid var(--line);
  cursor: move;
  user-select: none;
  touch-action: none;
}
.bd-shot-popover-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.bd-shot-popover-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
}
.bd-shot-popover-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 14px 14px;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--ink);
  background: var(--panel);
}
.bd-shot-popover-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
}
.bd-shot-popover-close:hover {
  background: var(--line);
  color: var(--ink);
}
.bd-shot-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.bd-shot-open-btn:hover {
  background: var(--panel);
}
.bd-shot-open-btn[hidden] {
  display: none;
}
.bd-shot-open-btn .bd-shot-open-count {
  background: var(--brand, #b8860b);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
}

/* ── 管理员 API 提供商切换开关 ── */
.admin-provider {
  margin: 0 0 16px;
}
.admin-provider:empty { display: none; }
.provider-switch-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.provider-switch-head h3 { margin: 0; font-size: 15px; }
.provider-switch-hint { font-size: 12px; color: var(--muted); }
.provider-switch-empty { font-size: 12px; color: var(--muted); }
.provider-switch-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.provider-card {
  flex: 1 1 220px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.provider-card:hover:not([disabled]) { border-color: var(--brand, #b8860b); }
.provider-card.is-active {
  border-color: var(--brand, #b8860b);
  box-shadow: 0 0 0 1px var(--brand, #b8860b) inset;
}
.provider-card[disabled] { cursor: default; opacity: .65; }
.provider-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.provider-card small { color: var(--muted); font-size: 11px; word-break: break-all; }
.provider-badge {
  font-size: 11px;
  border-radius: 999px;
  padding: 1px 9px;
  background: var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.provider-badge-active { background: var(--brand, #b8860b); color: #fff; }
.provider-badge-off { background: transparent; border: 1px solid var(--line); }
.provider-switch-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--brand, #b8860b);
  min-height: 16px;
}

/* ═══ 演员表演工作台板块 2026-06-16 ═══
   复用自由运镜板块的 fc-hero / fc-mode-card / fc-rail / fc-judge 通用结构，
   仅把 hero 主题色从红线橙改为表演玫红（呼应"情绪/演技"）。整层可回滚。 */
.ap-hero .fc-path {
  stroke: #b5446e;
  opacity: 0.42;
}
body.theme-dark .ap-hero .fc-path {
  stroke: #d97ba8;
  opacity: 0.5;
}
.ap-hero .fc-hero-eyebrow {
  color: #b5446e;
}
body.theme-dark .ap-hero .fc-hero-eyebrow {
  color: #d97ba8;
}

/* 视频 prompt 浮动窗口（演员表演工作台）— 从输出抽取「表演视频 prompt」单独可拖拽 + 一键复制 */
.ap-video-float {
  position: fixed;
  right: 26px;
  bottom: 88px;
  z-index: 60;
  width: 380px;
  max-width: 44vw;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.ap-video-float.hidden { display: none; }
.ap-video-float.ap-vf-collapsed { width: auto; }
.ap-vf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: move;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  user-select: none;
}
.ap-vf-title { font-size: 12px; font-weight: 600; color: #b5446e; white-space: nowrap; }
body.theme-dark .ap-vf-title { color: #d97ba8; }
.ap-vf-actions { display: flex; gap: 6px; }
.ap-vf-copy,
.ap-vf-toggle {
  font-size: 11px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  line-height: 1.4;
}
.ap-vf-copy { color: #b5446e; font-weight: 600; }
body.theme-dark .ap-vf-copy { color: #d97ba8; }
.ap-vf-body {
  margin: 0;
  padding: 10px 12px;
  max-height: 46vh;
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
}
.ap-video-float.ap-vf-collapsed .ap-vf-body { display: none; }

/* 全站：文本输入栏「清除」按钮（标题右侧明显胶囊，仿图片「移除」）。
   仅由 JS 给加了按钮的标题 span 添加 .field-label-has-clear，不影响其它字段布局 */
.field-label-has-clear {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.field-clear-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 11px;
  border: 1px solid rgba(181, 68, 110, 0.38);
  border-radius: 999px;
  background: rgba(181, 68, 110, 0.10);
  color: #b5446e;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.5;
  transition: background .15s, color .15s, border-color .15s;
}
.field-clear-btn:hover {
  background: #b5446e;
  border-color: #b5446e;
  color: #fff;
}
.field-clear-x { font-size: 10px; opacity: 0.85; }
body.theme-dark .field-clear-btn {
  border-color: rgba(217, 123, 168, 0.42);
  background: rgba(217, 123, 168, 0.15);
  color: #d97ba8;
}
body.theme-dark .field-clear-btn:hover {
  background: #d97ba8;
  border-color: #d97ba8;
  color: #1a1410;
}


/* ═══ 电影感运镜导演工作台板块 2026-07-17 ═══
   复用自由运镜板块的 fc-hero / fc-mode-card / fc-judge 通用结构，
   hero 主题色用电影 teal 青蓝（呼应「电影感调色」）。整层可回滚。 */
.csd-hero .fc-path {
  stroke: #2e7f9f;
  opacity: 0.42;
}
body.theme-dark .csd-hero .fc-path {
  stroke: #63b7d4;
  opacity: 0.5;
}
.csd-hero .fc-hero-eyebrow {
  color: #2e7f9f;
}
body.theme-dark .csd-hero .fc-hero-eyebrow {
  color: #63b7d4;
}

/* JSON 平台直喂浮动窗口（电影感运镜导演工作台）— 从输出抽取 JSON 结构化字段，可拖拽 + 一键复制 */
.csd-json-float {
  position: fixed;
  right: 26px;
  bottom: 88px;
  z-index: 60;
  width: 380px;
  max-width: 44vw;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.csd-json-float.hidden { display: none; }
.csd-json-float.csd-jf-collapsed { width: auto; }
.csd-jf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: move;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  user-select: none;
}
.csd-jf-title { font-size: 12px; font-weight: 600; color: #2e7f9f; white-space: nowrap; }
body.theme-dark .csd-jf-title { color: #63b7d4; }
.csd-jf-actions { display: flex; gap: 6px; }
.csd-jf-copy,
.csd-jf-toggle {
  font-size: 11px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  line-height: 1.4;
}
.csd-jf-copy { color: #2e7f9f; font-weight: 600; }
body.theme-dark .csd-jf-copy { color: #63b7d4; }
.csd-jf-body {
  margin: 0;
  padding: 10px 12px;
  max-height: 46vh;
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
}
.csd-json-float.csd-jf-collapsed .csd-jf-body { display: none; }

/* ═══ 动作大片导演工作台板块 2026-07-17 ═══
   复用 fc-hero / fc-mode-card / fc-rail / fc-judge 通用结构，
   hero 主题色用动作火焰橙红（呼应「动作/打戏」）。整层可回滚。 */
.acd-hero .fc-path {
  stroke: #c2452e;
  opacity: 0.42;
}
body.theme-dark .acd-hero .fc-path {
  stroke: #e8836b;
  opacity: 0.5;
}
.acd-hero .fc-hero-eyebrow {
  color: #c2452e;
}
body.theme-dark .acd-hero .fc-hero-eyebrow {
  color: #e8836b;
}

/* i2v 视频 prompt 浮动窗口（动作大片导演工作台）— 从输出抽取视频段，可拖拽 + 一键复制 */
.acd-video-float {
  position: fixed;
  right: 26px;
  bottom: 88px;
  z-index: 60;
  width: 380px;
  max-width: 44vw;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.acd-video-float.hidden { display: none; }
.acd-video-float.acd-vf-collapsed { width: auto; }
.acd-vf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: move;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  user-select: none;
}
.acd-vf-title { font-size: 12px; font-weight: 600; color: #c2452e; white-space: nowrap; }
body.theme-dark .acd-vf-title { color: #e8836b; }
.acd-vf-actions { display: flex; gap: 6px; }
.acd-vf-copy,
.acd-vf-toggle {
  font-size: 11px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  line-height: 1.4;
}
.acd-vf-copy { color: #c2452e; font-weight: 600; }
body.theme-dark .acd-vf-copy { color: #e8836b; }
.acd-vf-body {
  margin: 0;
  padding: 10px 12px;
  max-height: 46vh;
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
}
.acd-video-float.acd-vf-collapsed .acd-vf-body { display: none; }

/* ═══ MiniMax H3导演工作台板块 2026-08-05 ═══
   复用 fc-hero / fc-mode-card / fc-judge 通用结构，
   hero 主题色用海螺深青（呼应「海螺/MiniMax」海洋意象）。整层可回滚。 */
.h3-hero .fc-path {
  stroke: #0e7a8a;
  opacity: 0.42;
}
body.theme-dark .h3-hero .fc-path {
  stroke: #5ecbd8;
  opacity: 0.5;
}
.h3-hero .fc-hero-eyebrow {
  color: #0e7a8a;
}
body.theme-dark .h3-hero .fc-hero-eyebrow {
  color: #5ecbd8;
}

/* ═══ Seedance 2.5 导演工作台板块 2026-08-19 ═══
   复用 fc-hero / fc-mode-card / fc-judge 通用结构（与 H3 板块同构），
   hero 主题色用即梦琥珀橙（区别于海螺深青）；三问合同行为参考图卡片新增小布局。整层可回滚。 *//* ── Seedance 2.5 用户实战案例折叠块（2026-08-29） ── */
.sd25-case {
  margin: 12px 0 4px;
  padding: 10px 16px;
  border-left: 4px solid #d08a2e;
}
.sd25-case > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: #b8741f;
  list-style: none;
}
.sd25-case > summary::-webkit-details-marker { display: none; }
.sd25-case[open] > summary { margin-bottom: 8px; }
.sd25-case-body ol {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.7;
}
.sd25-case-body li { margin: 4px 0; }
.sd25-case-body code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--panel-soft, rgba(0,0,0,.06));
}
.sd25-case-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
body.theme-dark .sd25-case { border-left-color: #e0a54a; }
body.theme-dark .sd25-case > summary { color: #e0b95e; }


.sd25-hero .fc-path {
  stroke: #c2620f;
  opacity: 0.42;
}
body.theme-dark .sd25-hero .fc-path {
  stroke: #f0a35a;
  opacity: 0.5;
}
.sd25-hero .fc-hero-eyebrow {
  color: #c2620f;
}
body.theme-dark .sd25-hero .fc-hero-eyebrow {
  color: #f0a35a;
}
.sd25-image-list .image-card .image-meta strong {
  color: #c2620f;
}
body.theme-dark .sd25-image-list .image-card .image-meta strong {
  color: #f0a35a;
}
.sd25-contract {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.sd25-contract label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
}
.sd25-contract input {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-soft);
  color: inherit;
}
.sd25-contract input.sd25-missing {
  border-color: #d97706;
}
.sd25-media-ref {
  margin-top: 4px;
}
@media (max-width: 720px) {
  .sd25-contract { grid-template-columns: 1fr; }
}

/* ── 后台管理 4 页签 + 用量报表（2026-07-24 adminreport） ── */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 4px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.admin-tab {
  border: none;
  background: none;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.admin-tab-page { margin-top: 14px; }

.report-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.report-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.report-presets button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  padding: 5px 13px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.5;
}
.report-presets button:hover { color: var(--ink); border-color: var(--accent); }
.report-presets button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.report-custom { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-custom input[type="date"] {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
}
.report-custom span { color: var(--muted); font-size: 13px; }
.report-filters {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.report-filters .field { margin: 0; min-width: 150px; }
.report-filters button { white-space: nowrap; }
.report-range-label {
  margin: 12px 2px 0;
  font-size: 12.5px;
  color: var(--muted);
}
.report-section-title { margin: 18px 2px 8px; font-size: 15px; }

.report-table { display: flex; flex-direction: column; gap: 6px; }
.report-table .report-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(120px, 1fr) 90px 130px 150px 96px;
  gap: 10px;
  align-items: center;
}
.report-row .report-share { align-self: center; }
.report-row .report-io { color: var(--muted); font-size: 12px; }
.report-user-detail { font-size: 12px; padding: 4px 10px; }
.report-detail-row {
  margin: -2px 0 4px;
  padding: 8px 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.report-detail-line {
  display: grid;
  grid-template-columns: 110px 90px 130px 1fr;
  gap: 10px;
  font-size: 12.5px;
  padding: 3px 0;
  color: var(--ink);
}
.report-detail-line span:first-child { color: var(--muted); }

.users-toolbar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.users-toolbar .users-filter { margin: 0; min-width: 200px; }

.audit-table { display: flex; flex-direction: column; gap: 6px; }
.audit-table .audit-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, 0.8fr) minmax(110px, 0.7fr) 2fr;
  gap: 10px;
  align-items: center;
}
.audit-detail {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

@media (max-width: 860px) {
  .report-table .report-row { grid-template-columns: 1fr 80px 110px; }
  .report-row .report-share, .report-row .report-io { display: none; }
  .audit-table .audit-row { grid-template-columns: 1fr 1fr; }
}

/* ── 邀请码注册 + ICP 备案页脚（2026-08-09） ── */
.icp-footer {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  z-index: 5;
}
.icp-footer a { color: var(--muted); text-decoration: none; opacity: 0.75; }
.icp-footer a:hover { opacity: 1; text-decoration: underline; }

.login-register-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0 0;
}
.login-register-link:hover { color: var(--text); text-decoration: underline; }

.register-agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
}
.register-agree input { margin-top: 3px; flex: none; }
.register-terms-link {
  background: none;
  border: none;
  color: var(--accent, #7cc4ff);
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}
.register-terms { text-align: left; font-size: 12px; color: var(--muted); }
.register-terms summary { cursor: pointer; }
.register-terms-body p { margin: 6px 0; line-height: 1.6; }

.invite-hint { font-size: 12px; color: var(--muted); flex: 1; min-width: 220px; }
.invite-created {
  border: 1px dashed var(--muted);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
  font-size: 13px;
}
.invite-created-codes {
  margin: 8px 0;
  padding: 8px;
  font-size: 14px;
  letter-spacing: 1px;
  user-select: all;
  white-space: pre-wrap;
}
.invite-row .invite-code-text { letter-spacing: 1px; }
.user-badge.badge-active-code { background: rgba(80, 200, 120, 0.18); color: #58c882; }

@media (max-width: 860px) {
  .icp-footer { position: static; padding: 10px 0; }
}

/* ── 会员兑换卡（2026-08-09 付费档） ── */
.redeem-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px dashed var(--muted);
  border-radius: 10px;
  font-size: 13px;
}
.redeem-card-label { color: var(--muted); flex: none; }
.redeem-card input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  padding: 6px 10px;
  letter-spacing: 1px;
}
.redeem-message { font-size: 13px; }
.redeem-message.redeem-ok { color: #58c882; }
.redeem-message.redeem-err { color: #e07a6a; }

/* ── 会员台账（2026-08-09） ── */
.ledger-row.ledger-expired { border-left: 3px solid #e07a6a; }
.ledger-row.ledger-expiring { border-left: 3px solid #e0b76a; }
.ledger-muted { font-size: 12px; color: var(--muted); }

/* ── 角色设定集 Novel Cast（2026-08-10）· 点缀色=铁锈红 #8a3324 ── */
.nc-hero {
  border-left: 4px solid #8a3324;
}

.nc-badge {
  background: #8a3324;
  color: #ffffff;
}

.nc-section {
  display: grid;
  gap: 14px;
}

.nc-primary {
  background: #8a3324;
}

.nc-primary:hover:not(:disabled) {
  background: #a03d2a;
}

.nc-input-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nc-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  padding: 8px 15px;
  border-radius: 8px;
}

.nc-file-btn input[type="file"] {
  display: none;
}

.nc-char-count {
  font-size: 12px;
  color: var(--muted);
}

.nc-char-count.nc-over {
  color: var(--danger);
  font-weight: 700;
}

.nc-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
}

.nc-message.nc-msg-error {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger);
}

.nc-message.nc-msg-warn {
  color: var(--warn);
  background: var(--warn-bg);
  border-color: var(--warn);
}

.nc-message.nc-msg-info {
  color: var(--muted);
  background: var(--panel-soft);
}

.nc-phase-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.nc-phase-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8a3324;
  box-shadow: 0 0 0 4px rgba(138, 51, 36, 0.15);
  animation: nc-pulse 1.6s ease-in-out infinite;
}

.nc-phase-dot.nc-idle {
  animation: none;
}

@keyframes nc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.nc-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.nc-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8a3324, #b0492f);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.nc-warn {
  margin: 0;
  font-size: 13px;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  border-radius: 8px;
  padding: 9px 12px;
}

.nc-summary {
  font-size: 13px;
  line-height: 1.7;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-left: 3px solid #8a3324;
  border-radius: 8px;
  padding: 12px 14px;
  white-space: pre-wrap;
}

.nc-roster {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.nc-roster-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}

.nc-roster-row:hover {
  border-color: #8a3324;
}

.nc-roster-row.nc-checked {
  border-color: #8a3324;
  background: rgba(138, 51, 36, 0.06);
}

.nc-roster-row input[type="checkbox"] {
  accent-color: #8a3324;
}

.nc-roster-name {
  font-weight: 700;
}

.nc-roster-alias,
.nc-roster-meta {
  font-size: 12px;
  color: var(--muted);
}

.nc-roster-preview {
  display: block;
  width: 100%;
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
}

.nc-select-bar,
.nc-done-bar {
  align-items: center;
}

.nc-selected-count {
  margin-right: auto;
  font-size: 13px;
  color: var(--muted);
}

.nc-selected-count.nc-full {
  color: #8a3324;
  font-weight: 700;
}

.nc-dl-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1.2;
}

.nc-warnings {
  display: grid;
  gap: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  border-radius: 8px;
  padding: 10px 12px;
}

.nc-error {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
  white-space: pre-wrap;
}

/* 2026-08-11：补扫提示 + 出图 QA 区 */
.nc-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-soft, #8a8f98);
}

.nc-qa {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line, #d8d3c8);
  display: grid;
  gap: 12px;
}

.nc-qa-title {
  margin: 0;
  font-size: 15px;
}

.nc-qa-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-soft, #8a8f98);
}

.nc-qa-upload {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.nc-qa-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nc-qa-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line, #d8d3c8);
  border-radius: 8px;
  overflow: hidden;
}

.nc-qa-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nc-qa-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  line-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.nc-recent-list {
  display: grid;
  gap: 8px;
}

.nc-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line, #d8d3c8);
  border-radius: 8px;
  background: var(--panel-soft, #faf8f4);
}

.nc-recent-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.nc-recent-info strong {
  font-size: 14px;
}

.nc-recent-info span {
  font-size: 12px;
  color: var(--text-soft, #8a8f98);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nc-qa-thread {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line, #d8d3c8);
  border-radius: 8px;
  background: var(--panel-soft, #faf8f4);
}

.nc-qa-msg {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.75;
}

.nc-qa-msg strong {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 4px;
}

.nc-qa-msg-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.nc-qa-msg-user {
  background: rgba(21, 101, 192, 0.06);
  border: 1px solid rgba(21, 101, 192, 0.18);
}

.nc-qa-msg-ai {
  background: #fff;
  border: 1px solid var(--line, #d8d3c8);
}

/* ═══ 静帧修复工作台板块 2026-08-21 ═══
   复用 fc-hero / fc-mode-card / fc-judge 通用结构（与 H3 / sd25 板块同构），
   hero 主题色用洁净青绿（区别于即梦琥珀橙、海螺深青）。整层可回滚。 */
.icr-hero .fc-path {
  stroke: #1f8a70;
  opacity: 0.42;
}
body.theme-dark .icr-hero .fc-path {
  stroke: #5fd1b2;
  opacity: 0.5;
}
.icr-hero .fc-hero-eyebrow {
  color: #1f8a70;
}
body.theme-dark .icr-hero .fc-hero-eyebrow {
  color: #5fd1b2;
}
.icr-image-list .image-card .image-meta strong {
  color: #1f8a70;
}
body.theme-dark .icr-image-list .image-card .image-meta strong {
  color: #5fd1b2;
}
.icr-note {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.icr-note span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}
.icr-note input {
  width: 100%;
  font-size: 12px;
}
.icr-tip p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.icr-dim {
  opacity: 0.55;
}

/* 多条提示词逐条复制菜单（2026-08-23） */
.prompt-only-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 4px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.prompt-only-menu .prompt-only-hint { font-size: 12px; opacity: 0.75; margin-right: 4px; }
.prompt-only-menu .prompt-only-close { margin-left: auto; opacity: 0.7; }

/* ═══ 运镜导演工作台板块 2026-08-23 ═══
   复用 fc-hero / fc-mode-card / fc-judge 通用结构（与 icr / sd25 / H3 同构），
   hero 主题色用靛蓝（区别于静帧青绿、即梦琥珀橙、海螺深青）。整层可回滚。 */
.cmv-hero .fc-path {
  stroke: #3b5bdb;
  opacity: 0.42;
}
body.theme-dark .cmv-hero .fc-path {
  stroke: #8aa4ff;
  opacity: 0.5;
}
.cmv-hero .fc-hero-eyebrow {
  color: #3b5bdb;
}
body.theme-dark .cmv-hero .fc-hero-eyebrow {
  color: #8aa4ff;
}
.cmv-image-list .image-card .image-meta strong {
  color: #3b5bdb;
}
body.theme-dark .cmv-image-list .image-card .image-meta strong {
  color: #8aa4ff;
}
.cmv-note {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.cmv-note span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}
.cmv-note input {
  width: 100%;
  font-size: 12px;
}
.cmv-tip p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* ═══ 音乐导演工作台板块 2026-08-29 ═══
   复用 fc-hero / fc-mode-card / fc-judge 通用结构（与 cmv / icr / sd25 / H3 同构），
   hero 主题色用酒红（区别于运镜靛蓝、静帧青绿、即梦琥珀橙、海螺深青）。整层可回滚。 */
.msc-hero .fc-path {
  stroke: #9c3a26;
  opacity: 0.42;
}
body.theme-dark .msc-hero .fc-path {
  stroke: #e08a76;
  opacity: 0.5;
}
.msc-hero .fc-hero-eyebrow {
  color: #9c3a26;
}
body.theme-dark .msc-hero .fc-hero-eyebrow {
  color: #e08a76;
}
.msc-image-list .image-card .image-meta strong {
  color: #9c3a26;
}
body.theme-dark .msc-image-list .image-card .image-meta strong {
  color: #e08a76;
}
.msc-note {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.msc-note span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}
.msc-note input {
  width: 100%;
  font-size: 12px;
}
.msc-tip p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.msc-dim {
  opacity: 0.55;
}
.msc-console-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 10px 0 12px;
  padding: 14px 16px;
  border: 1px solid #c9a44a;
  border-left: 5px solid #9c3a26;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(201, 164, 74, 0.18), rgba(201, 164, 74, 0.04));
}
body.theme-dark .msc-console-cta {
  border-color: #a8842c;
  border-left-color: #e08a76;
  background: linear-gradient(90deg, rgba(201, 164, 74, 0.24), rgba(201, 164, 74, 0.06));
}
.msc-console-cta-text {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.msc-console-cta-text strong {
  font-size: 15px;
}
.msc-console-cta-text span {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}
.msc-console-cta-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.msc-doc-block .drop-zone {
  border-color: #c9a44a;
  background: linear-gradient(90deg, rgba(201, 164, 74, 0.12), rgba(201, 164, 74, 0.02));
}
body.theme-dark .msc-doc-block .drop-zone {
  border-color: #a8842c;
}
.msc-doc-block .drop-zone strong {
  color: #9c3a26;
}
body.theme-dark .msc-doc-block .drop-zone strong {
  color: #e0b95e;
}
.msc-console-btn {
  border-color: #c9a44a !important;
  color: #9c3a26 !important;
  font-weight: 600;
}
body.theme-dark .msc-console-btn {
  color: #e0b95e !important;
}

/* ── 会员档位弹窗（2026-08-23） ── */
.pricing-overlay { z-index: 920; }
.pricing-drawer { width: min(860px, 94vw); }
.pricing-body { padding: 4px 18px 18px; overflow: auto; font-size: 14px; }
.pricing-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 6px; }
@media (max-width: 700px) { .pricing-tiers { grid-template-columns: 1fr; } }
.pricing-tier { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.pricing-tier-hot { border-color: #c9a24a; box-shadow: 0 0 0 1px rgba(201,162,74,.35) inset; }
.pricing-tier-name { font-weight: 600; margin: 0 0 4px; }
.pricing-tier-price { font-size: 26px; font-weight: 700; margin: 0 0 8px; }
.pricing-tier-price small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.pricing-tier ul { margin: 0; padding-left: 18px; line-height: 1.7; }
.pricing-note, .pricing-fine { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
.pricing-howto { margin-top: 14px; padding: 12px 16px; border: 1px dashed var(--muted); border-radius: 10px; }
.pricing-howto h4 { margin: 0 0 6px; }
.pricing-howto ol { margin: 0; padding-left: 20px; line-height: 1.8; }
.pricing-qr-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 14px; }
.pricing-qr { margin: 0; text-align: center; position: relative; min-width: 180px; }
.pricing-qr img { width: 180px; height: 180px; object-fit: contain; border-radius: 10px; background: #fff; display: block; margin: 0 auto; }
.pricing-qr figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }
.pricing-qr .pricing-qr-missing { display: none; }
.pricing-qr.qr-missing img { visibility: hidden; }
.pricing-qr.qr-missing .pricing-qr-missing {
  display: flex; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 180px; height: 180px; align-items: center; justify-content: center;
  border: 1px dashed var(--muted); border-radius: 10px; font-size: 12px; color: var(--muted); padding: 12px; text-align: center;
}
.redeem-card [data-open-pricing] { margin-left: auto; }

/* ===== 强制改密遮罩（2026-08-28） ===== */
.force-pw-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 14, 10, 0.72);
  backdrop-filter: blur(6px);
}
.force-pw-overlay.hidden { display: none; }
body.force-pw-locked { overflow: hidden; }
.force-pw-card {
  width: min(420px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  border-radius: 16px;
  background: var(--panel-bg, #fffdf8);
  border: 1px solid var(--panel-border, rgba(140, 100, 40, 0.28));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}
.force-pw-card h2 { margin: 4px 0 10px; }
.force-pw-hint {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.78;
}
.force-pw-card .field { display: block; margin-bottom: 14px; }
.force-pw-card .field span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}
.force-pw-card .field input { width: 100%; }
.force-pw-card button[type="submit"] { width: 100%; margin-top: 4px; }
