:root {
  --bg: #050816;
  --surface: rgba(12, 18, 36, 0.78);
  --surface-soft: rgba(255, 255, 255, 0.07);
  --surface-strong: #0b1022;
  --ink: #eef6ff;
  --muted: #93a4bd;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(111, 231, 255, 0.36);
  --accent: #22d3ee;
  --accent-strong: #0ea5c7;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --gold: #f5b85b;
  --success: #34d399;
  --warning: #f5b85b;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --shadow-tight: 0 12px 34px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(34, 211, 238, 0.24), transparent 28%),
    radial-gradient(circle at 88% 3%, rgba(139, 92, 246, 0.32), transparent 26%),
    radial-gradient(circle at 72% 88%, rgba(236, 72, 153, 0.14), transparent 34%),
    linear-gradient(135deg, #050816 0%, #080d1f 50%, #020617 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 78px 78px;
  mask-image: linear-gradient(180deg, #000, transparent 86%);
}

/* Layout-only refinements (color tokens defined in :root, applied in core blocks below) */
.nav {
  justify-content: flex-start;
  overflow-x: auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  min-height: 220px;
}

.dashboard-hero h3 {
  margin: 8px 0;
  font-size: 30px;
}

.eyebrow {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-actions,
.quick-flow,
.toolbar-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.metric-grid div {
  padding: 14px;
  border-radius: 10px;
}

.metric-grid span {
  display: block;
  font-size: 12px;
}

.metric-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.quick-flow button {
  display: grid;
  min-width: 126px;
  padding: 14px;
  text-align: left;
  border-radius: 10px;
}

.quick-flow strong {
  font-size: 22px;
}

.knowledge-list,
.topic-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.knowledge-card,
.topic-card {
  padding: 16px;
  border-radius: 10px;
  text-align: left;
}

.knowledge-card header,
.knowledge-card footer,
.topic-card,
.compact-job {
  display: grid;
  gap: 8px;
}

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

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

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

.ops-grid h4 {
  margin: 0 0 10px;
}

.compact-check,
.compact-empty {
  min-height: 36px;
}

.compact-list .job-item {
  padding: 10px 12px;
}

@media (max-width: 980px) {
  .dashboard-grid,
  .dashboard-hero,
  .ops-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    grid-template-columns: 1fr;
  }
}

/* Generic button reset (kept from earlier polish, color comes from .primary/.secondary blocks) */
button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

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

.admin-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 24px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.2), transparent 42%),
    linear-gradient(155deg, rgba(2, 6, 23, 0.98), rgba(8, 13, 31, 0.96));
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.22);
}

.sidebar .brand {
  margin-bottom: 28px;
}

.sidebar .nav,
.sidebar .nav-actions {
  display: grid;
  justify-content: stretch;
}

.sidebar .nav {
  gap: 8px;
}

.sidebar .nav-link {
  justify-content: flex-start;
}

.sidebar .nav-link.active::after {
  display: none;
}

.sidebar .nav-actions {
  margin-top: 24px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding: 12px clamp(18px, 4vw, 46px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--violet), var(--pink));
  box-shadow: 0 0 34px rgba(34, 211, 238, 0.28);
  color: #fff;
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3 {
  margin: 0;
}

.brand h1 {
  background: linear-gradient(90deg, #67e8f9, #c4b5fd, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 22px;
  font-weight: 820;
  letter-spacing: 0;
}

.brand p {
  margin-top: 2px;
  color: #c4b5fd;
  font-size: 11px;
  letter-spacing: 0.12em;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 22px);
  min-width: 0;
}

.nav-item,
.nav-link {
  position: relative;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  text-decoration: none;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 650;
}

.nav-item:hover,
.nav-link:hover,
.nav-item.active,
.nav-link.active {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.17), rgba(34, 211, 238, 0.12));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), 0 0 24px rgba(139, 92, 246, 0.14);
}

.nav-item.active::after,
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -10px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--violet), var(--pink));
}

html[data-route-view] .nav-item.active {
  border-color: transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  box-shadow: none;
}

html[data-route-view] .nav-item.active::after {
  content: none;
}

html[data-route-view="character"] .nav-item[data-view="character"],
html[data-route-view="copywriting"] .nav-item[data-view="copywriting"],
html[data-route-view="storyboard"] .nav-item[data-view="storyboard"],
html[data-route-view="compliance"] .nav-item[data-view="compliance"],
html[data-route-view="jobs"] .nav-item[data-view="jobs"] {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.17), rgba(34, 211, 238, 0.12));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), 0 0 24px rgba(139, 92, 246, 0.14);
}

html[data-route-view="character"] .nav-item[data-view="character"]::after,
html[data-route-view="copywriting"] .nav-item[data-view="copywriting"]::after,
html[data-route-view="storyboard"] .nav-item[data-view="storyboard"]::after,
html[data-route-view="compliance"] .nav-item[data-view="compliance"]::after,
html[data-route-view="jobs"] .nav-item[data-view="jobs"]::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -10px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--violet), var(--pink));
}

.nav-actions,
.topbar-actions,
.toolbar-inline,
.form-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-actions {
  justify-content: flex-end;
}

.workspace {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100vw - 36px));
  min-width: 0;
  margin: 0 auto;
  padding: 30px 0 46px;
}

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

.topbar h2 {
  color: #fff;
  font-size: 28px;
  font-weight: 820;
}

.topbar p {
  margin-top: 7px;
  color: var(--muted);
}

.user-badge,
.model-pill {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  padding: 0 12px;
  box-shadow: var(--shadow-tight);
  font-size: 13px;
  backdrop-filter: blur(14px);
}

.model-pill {
  gap: 8px;
  padding-right: 6px;
}

.model-pill span {
  color: #c4b5fd;
  font-size: 12px;
}

.model-pill select {
  min-width: 136px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  color: #fff;
  padding: 0 10px;
}

.nav-button {
  min-height: 38px;
  border-radius: 999px;
}

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

.auth-panel[hidden],
[hidden] {
  display: none !important;
}

html[data-auth="logged-in"] #authPanel {
  display: none !important;
}

html[data-auth="guest"] #logoutBtn {
  display: none !important;
}

.notice {
  margin-bottom: 14px;
  border: 1px solid rgba(245, 184, 91, 0.32);
  border-radius: 10px;
  background: rgba(245, 184, 91, 0.12);
  color: #ffe1ad;
  padding: 10px 12px;
  box-shadow: 0 12px 26px rgba(245, 184, 91, 0.08);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

html[data-route-view] .view.active {
  display: none;
}

html[data-route-view="character"] .view[data-view="character"],
html[data-route-view="copywriting"] .view[data-view="copywriting"],
html[data-route-view="storyboard"] .view[data-view="storyboard"],
html[data-route-view="compliance"] .view[data-view="compliance"],
html[data-route-view="jobs"] .view[data-view="jobs"] {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.92fr);
  gap: 16px;
}

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

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.065)),
    var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(20px);
}

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

.panel h3 {
  color: #f8fbff;
  font-size: 17px;
  font-weight: 760;
}

.panel-desc {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

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

.field span,
.check-field span {
  color: #d7e3f4;
  font-size: 13px;
  font-weight: 680;
}

.field.compact {
  min-width: 112px;
}

.field.compact select {
  min-width: 150px;
}

.span-2 {
  grid-column: 1 / -1;
}

.check-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 0 10px;
}

.check-field input {
  width: auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.42);
  color: #f8fbff;
  outline: none;
  padding: 10px 11px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(213, 225, 242, 0.46);
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
  background: rgba(2, 6, 23, 0.62);
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--violet), var(--pink));
  color: #fff;
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.24);
}

.primary:hover {
  box-shadow: 0 18px 42px rgba(34, 211, 238, 0.22);
}

.secondary {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
}

.secondary:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.12);
}

.danger-button {
  color: #fecdd3;
}

.result-panel {
  align-self: start;
}

.character-library-panel {
  margin-top: 16px;
}

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

.character-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% 0%, rgba(34, 211, 238, 0.13), transparent 30%),
    rgba(255, 255, 255, 0.06);
  padding: 14px;
  box-shadow: var(--shadow-tight);
}

.character-card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.character-card strong {
  color: #fff;
  font-size: 16px;
}

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

.character-preview {
  min-height: 54px;
  color: #d8e8fb;
  line-height: 1.65;
}

.character-edit {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.compact-empty {
  min-height: 96px;
}

.ai-progress {
  min-height: 190px;
  display: grid;
  gap: 14px;
  align-content: start;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 14px;
  background:
    radial-gradient(circle at 16% 14%, rgba(34, 211, 238, 0.14), transparent 30%),
    rgba(2, 6, 23, 0.38);
  padding: 16px;
  overflow: hidden;
}

.ai-progress-head {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #eaffff;
  font-weight: 760;
}

.ai-orbit {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-top-color: #22d3ee;
  border-radius: 999px;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.3);
  animation: spin 1s linear infinite;
}

.ai-progress-list {
  max-height: 230px;
  display: grid;
  gap: 8px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 84%, transparent 100%);
  animation: progressRoll calc(max(var(--progress-count), 4) * 1.25s) linear infinite;
}

.ai-progress-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.ai-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--violet), var(--pink));
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.34);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-progress-item {
  position: relative;
  padding: 10px 12px 10px 28px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #dcefff;
  line-height: 1.6;
}

.ai-progress-item::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 18px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.5);
}

.friendly-result {
  display: grid;
  gap: 12px;
  color: #e8f2ff;
}

.result-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(34, 211, 238, 0.26);
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% 10%, rgba(34, 211, 238, 0.2), transparent 32%),
    linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(236, 72, 153, 0.12)),
    rgba(255, 255, 255, 0.06);
  padding: 14px;
  box-shadow: 0 18px 42px rgba(34, 211, 238, 0.1);
}

.result-hero span {
  display: inline-flex;
  margin-bottom: 8px;
  border: 1px solid rgba(52, 211, 153, 0.32);
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.13);
  color: var(--success);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.result-hero strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-size: 18px;
}

.friendly-section {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
}

.friendly-section strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes progressRoll {
  0%,
  18% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(calc(-1 * max(var(--progress-count) - 4, 0) * 58px));
  }
}

.empty-state,
.result-block {
  min-height: 160px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.28);
  color: var(--muted);
  padding: 14px;
}

.json-view {
  overflow: auto;
  max-height: 620px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #dce8f8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.choice {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.065);
  color: #eaf3ff;
  text-align: left;
  white-space: normal;
  line-height: 1.45;
}

.choice:hover,
.choice.selected {
  border-color: rgba(34, 211, 238, 0.68);
  background: rgba(34, 211, 238, 0.12);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.copy-body {
  display: grid;
  gap: 10px;
  color: #e8f2ff;
  line-height: 1.75;
}

.copy-body h4 {
  margin: 0;
  font-size: 18px;
}

.copy-body p {
  margin: 0;
  white-space: pre-wrap;
}

.jobs-list,
.admin-users {
  display: grid;
  gap: 10px;
}

.admin-user,
.job-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
  padding: 12px;
}

.admin-user {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1.2fr);
  gap: 12px;
  align-items: center;
}

.admin-user strong,
.job-item strong {
  color: #fff;
}

.admin-actions {
  display: grid;
  grid-template-columns: 120px minmax(160px, 1fr) 110px auto auto;
  gap: 8px;
  align-items: center;
}

.job-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.job-error {
  margin-top: 8px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.status {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.1);
  color: #d7e3f4;
  font-size: 12px;
}

.status.completed {
  border-color: rgba(52, 211, 153, 0.26);
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}

.status.running,
.status.pending {
  border-color: rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.13);
  color: #67e8f9;
}

.status.failed {
  border-color: rgba(251, 113, 133, 0.25);
  background: rgba(251, 113, 133, 0.13);
  color: var(--danger);
}

.admin-config-list {
  margin-top: 14px;
}

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

.inline-edit-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px 110px auto auto;
  gap: 8px;
  align-items: end;
}

@media (max-width: 1120px) {
  .site-nav {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brand,
  .nav,
  .nav-actions {
    justify-content: center;
  }

  .nav {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 4px;
  }
}

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

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

  .topbar,
  .topbar-actions,
  .split,
  .auth-panel,
  .character-card-head,
  .admin-user,
  .admin-actions,
  .toolbar-inline,
  .inline-edit-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace {
    width: min(100vw - 24px, 1280px);
    padding: 18px 0 32px;
  }

  .form-grid,
  .choice-grid,
  .job-item {
    grid-template-columns: 1fr;
  }

  .site-nav {
    padding: 12px;
  }

  .nav-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .model-pill,
  .user-badge {
    grid-column: 1 / -1;
    justify-content: center;
  }
}

/* ============== v2: 重构布局 ============== */

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.topbar h2 {
  font-size: 22px;
  font-weight: 800;
  color: #f8fbff;
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.panel-head {
  align-items: start;
}

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

/* ---- 算力标签 ---- */

.cost-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 3px 9px;
  border: 1px solid rgba(245, 184, 91, 0.32);
  border-radius: 999px;
  background: rgba(245, 184, 91, 0.12);
  color: #ffd692;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.modal-footer .cost-tag {
  margin: 0 auto 0 0;
}

button .cost-tag {
  margin-left: 8px;
}

/* ---- 人设卡片（重写） ---- */

.character-library-panel {
  margin-top: 0;
}

.character-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.character-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 211, 238, 0.12), transparent 32%),
    rgba(255, 255, 255, 0.05);
  padding: 16px;
  box-shadow: var(--shadow-tight);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.character-card:hover {
  border-color: rgba(34, 211, 238, 0.42);
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(34, 211, 238, 0.14);
}

.character-card.active {
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2), 0 18px 38px rgba(52, 211, 153, 0.16);
}

.character-card-head {
  display: flex !important;
  grid-template-columns: unset;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.character-card-title strong {
  font-size: 16px;
  color: #fff;
}

.badge-active {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.16);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
}

.character-card-meta {
  display: flex;
  gap: 6px 12px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.character-card-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 10px;
  color: rgba(255, 255, 255, 0.18);
}

.character-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.character-card-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.character-card-preview {
  margin: 0;
  color: #d7e6fb;
  line-height: 1.65;
  font-size: 13.5px;
}

.character-card-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.danger-button {
  color: #fecdd3;
}

.empty-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  text-align: center;
}

.empty-card strong {
  display: block;
  color: #fff;
  margin-bottom: 4px;
}

/* ---- 模态 / 抽屉 ---- */

.modal,
.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(6px);
}

.modal-dialog {
  position: relative;
  width: min(720px, calc(100vw - 32px));
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 0%, rgba(34, 211, 238, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(12, 18, 36, 0.96), rgba(8, 13, 31, 0.96));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 760;
  color: #fff;
}

.icon-button {
  min-height: 32px;
  width: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer {
  justify-content: flex-end;
}

.drawer-dialog {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(12, 18, 36, 0.96), rgba(2, 6, 23, 0.98));
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
}

.drawer-dialog.asset-drawer {
  width: min(680px, calc(100vw - 32px));
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}

.asset-list {
  display: grid;
  gap: 12px;
}

.asset-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
}

.asset-card.active {
  border-color: rgba(52, 211, 153, 0.44);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.1), rgba(255, 255, 255, 0.055));
}

.asset-card header,
.asset-card footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.asset-card header strong {
  color: #fff;
  font-size: 17px;
}

.asset-card header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.asset-card footer {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.asset-card footer button {
  min-height: 32px;
}

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

.asset-kv {
  display: grid;
  gap: 5px;
}

.asset-kv span,
.asset-section h4 {
  margin: 0;
  color: #9fb1ca;
  font-size: 12px;
  font-weight: 760;
}

.asset-kv strong,
.asset-kv p,
.asset-section p {
  margin: 0;
  color: #e8f2ff;
  line-height: 1.65;
  font-size: 13.5px;
}

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

.tag-row span {
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  color: #b8f3ff;
  padding: 4px 9px;
  font-size: 12px;
}

.asset-section {
  display: grid;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

/* ---- 违规检测 ---- */

.compliance-panel textarea[name="content"] {
  min-height: 180px;
}

.compliance-result {
  display: grid;
  gap: 14px;
}

.compliance-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
}

.compliance-score div {
  display: grid;
  gap: 5px;
}

.compliance-score span {
  color: #9fb1ca;
  font-size: 12px;
  font-weight: 760;
}

.compliance-score strong {
  color: #fff;
  font-size: 24px;
}

.compliance-score.risk-pass {
  border-color: rgba(52, 211, 153, 0.36);
  background: rgba(52, 211, 153, 0.09);
}

.compliance-score.risk-low {
  border-color: rgba(34, 211, 238, 0.36);
  background: rgba(34, 211, 238, 0.08);
}

.compliance-score.risk-mid {
  border-color: rgba(245, 184, 91, 0.42);
  background: rgba(245, 184, 91, 0.1);
}

.compliance-score.risk-high {
  border-color: rgba(251, 113, 133, 0.48);
  background: rgba(251, 113, 133, 0.1);
}

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

.diff-compare article {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(280px, auto);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.34);
}

.diff-compare article header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
  padding: 10px 12px;
}

.diff-compare article header strong {
  color: #fff;
}

.diff-compare article header span {
  color: #9fb1ca;
  font-size: 12px;
}

.diff-text {
  min-height: 280px;
  overflow: auto;
  padding: 14px;
  color: #dbeafe;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Microsoft YaHei Mono", monospace;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.diff-text del,
.diff-text ins {
  display: inline;
  border-radius: 4px;
  padding: 1px 3px;
  text-decoration: none;
}

.diff-text del {
  background: rgba(251, 113, 133, 0.26);
  color: #ffe4e9;
  box-shadow: inset 0 -1px 0 rgba(251, 113, 133, 0.62);
}

.diff-text ins {
  background: rgba(52, 211, 153, 0.22);
  color: #d9fff0;
  box-shadow: inset 0 -1px 0 rgba(52, 211, 153, 0.58);
}

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

.revision-list h5 {
  margin: 0;
  color: #fff;
  font-size: 14px;
}

.revision-list article {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.28);
  padding: 12px;
}

.revision-list article header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.revision-list article header strong {
  color: #fff;
}

.revision-list article header span {
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #d7e6fb;
  font-size: 12px;
  font-weight: 760;
}

.revision-list article p {
  margin: 0;
  color: #dbeafe;
  line-height: 1.7;
}

.revision-list article.risk-high {
  border-color: rgba(251, 113, 133, 0.42);
}

.revision-list article.risk-mid {
  border-color: rgba(245, 184, 91, 0.38);
}

.revision-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.revision-pair del,
.revision-pair ins {
  border-radius: 8px;
  padding: 9px 10px;
  line-height: 1.6;
  text-decoration: none;
}

.revision-pair del {
  border: 1px solid rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.12);
  color: #ffdce4;
}

.revision-pair ins {
  border: 1px solid rgba(52, 211, 153, 0.26);
  background: rgba(52, 211, 153, 0.1);
  color: #d8ffef;
}

/* ---- 灵感爆棚 stepper ---- */

.copy-flow-panel {
  display: grid;
  gap: 18px;
}

.copy-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.copy-flow-character {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-flow-label {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.05em;
}

.character-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.08);
  color: #eafdff;
  font-weight: 700;
}

.character-pill strong {
  color: #fff;
}

.character-pill span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12.5px;
  font-weight: 500;
}

.copy-flow-tools {
  display: flex;
  gap: 8px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.step .step-no {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 800;
}

.step.done {
  color: #c4f3d5;
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}

.step.done .step-no {
  background: rgba(52, 211, 153, 0.25);
  color: #d6ffe6;
}

.step.active {
  color: #fff;
  border-color: rgba(34, 211, 238, 0.45);
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.16));
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.15);
}

.step.active .step-no {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
}

.copy-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.copy-summary-pill {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.copy-summary-pill span {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.copy-summary-pill strong {
  color: #fff;
  line-height: 1.5;
}

.step-panel {
  display: grid;
  gap: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 14px;
}

.step-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.step-header h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}

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

.step-result {
  display: grid;
  gap: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}

.step-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-result-head h4 {
  margin: 0;
  font-size: 15px;
  color: #fff;
}

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.step-nav button {
  min-width: 120px;
}

/* ---- 类别按钮网格 ---- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.category-chip {
  display: grid;
  gap: 4px;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #eaf3ff;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.category-chip strong {
  color: #fff;
  font-weight: 700;
}

.category-chip span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.category-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.46);
  background: rgba(34, 211, 238, 0.08);
}

.category-chip.selected {
  border-color: rgba(34, 211, 238, 0.7);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(139, 92, 246, 0.14));
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.16);
}

/* ---- 文案结果 ---- */

.copy-result {
  display: grid;
  gap: 14px;
}

.copy-result .copy-body {
  display: grid;
  gap: 8px;
  color: #eaf3ff;
  line-height: 1.85;
}

.copy-result .copy-body p {
  margin: 0;
}

.copy-meta-block {
  border-left: 2px solid rgba(34, 211, 238, 0.6);
  background: rgba(34, 211, 238, 0.05);
  border-radius: 8px;
  padding: 10px 14px;
}

.copy-meta-block h5 {
  margin: 0 0 6px;
  color: #c8eefb;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.copy-meta-block ul,
.copy-meta-block ol {
  margin: 0;
  padding-left: 18px;
  color: #d7e6fb;
  line-height: 1.7;
}

.video-download-block {
  display: grid;
  gap: 10px;
}

.viral-cover {
  width: min(220px, 100%);
  aspect-ratio: 9 / 12;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.inline-download {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  text-decoration: none;
}

.copy-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button.copied {
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

/* ---- 分镜结果表 ---- */

.storyboard-result {
  display: grid;
  gap: 14px;
}

.shot-table {
  display: grid;
  gap: 8px;
}

.shot-table header,
.shot-table article {
  display: grid;
  grid-template-columns: 64px 80px minmax(160px, 1.2fr) minmax(140px, 1fr) minmax(140px, 1fr);
  gap: 10px;
  align-items: start;
}

.shot-table header {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.shot-table article {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #e4f0ff;
  line-height: 1.55;
}

.shot-table strong {
  color: #fff;
}

.shot-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

/* ---- 历史记录卡 ---- */

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

.history-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #e4f0ff;
}

.history-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-card header strong {
  color: #fff;
}

.history-card header span {
  color: var(--muted);
  font-size: 12.5px;
}

.history-card p {
  margin: 0;
  font-size: 13px;
  color: #cdd9ec;
}

.history-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12.5px;
}

.history-card footer button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
}

.notice-progress {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.notice-progress::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #ffd692;
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

.ai-progress-title {
  font-size: 15px;
  color: #f8fbff;
}

.result-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.result-editor textarea {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.78);
  color: var(--ink);
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.55;
}

/* ---- 响应式微调 ---- */

@media (max-width: 980px) {
  .diff-compare,
  .revision-pair {
    grid-template-columns: 1fr;
  }

  .step {
    flex: 1 1 100%;
  }

  .stepper {
    flex-direction: column;
    align-items: stretch;
  }

  .shot-table header {
    display: none;
  }

  .shot-table article {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ============== 用户前台视觉补救 ============== */

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 6%, rgba(34, 211, 238, 0.24), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(139, 92, 246, 0.34), transparent 28%),
    radial-gradient(circle at 76% 84%, rgba(236, 72, 153, 0.16), transparent 34%),
    linear-gradient(135deg, #050816 0%, #081124 46%, #020617 100%);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.036) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 86%);
}

body::after {
  content: "";
  position: fixed;
  inset: auto -12% -28% -12%;
  z-index: 0;
  height: 46vh;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(34, 211, 238, 0.16), transparent 64%);
  filter: blur(18px);
}

.app-shell,
.workspace {
  background: transparent;
}

.site-nav {
  background:
    linear-gradient(90deg, rgba(8, 13, 31, 0.9), rgba(12, 18, 36, 0.72)),
    rgba(2, 6, 23, 0.66);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.26);
}

.brand-mark {
  background: linear-gradient(135deg, var(--accent), var(--violet), var(--pink));
  box-shadow: 0 0 34px rgba(34, 211, 238, 0.28);
}

.brand h1 {
  background: linear-gradient(90deg, #67e8f9, #c4b5fd, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand p {
  color: #c4b5fd;
}

.topbar h2,
.panel h3,
.panel h4,
.panel h5,
.character-card strong,
.asset-card strong,
.history-card strong,
.job-item strong,
.step-header h3 {
  color: #f8fbff;
}

.topbar p,
.panel-desc,
.job-meta,
.asset-kv span,
.copy-flow-label {
  color: var(--muted);
}

.panel,
.auth-card,
.modal-dialog,
.drawer-dialog,
.result-block,
.result-editor {
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.115), rgba(255, 255, 255, 0.066)),
    rgba(12, 18, 36, 0.78);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(20px);
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 12%, rgba(34, 211, 238, 0.22), transparent 34%),
    radial-gradient(circle at 92% 18%, rgba(139, 92, 246, 0.24), transparent 36%),
    linear-gradient(135deg, rgba(12, 18, 36, 0.9), rgba(8, 13, 31, 0.72));
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -110px;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.22), transparent 66%);
  pointer-events: none;
}

.nav-item,
.nav-link,
.secondary,
.nav-button {
  color: rgba(255, 255, 255, 0.86);
}

.nav-item:hover,
.nav-link:hover,
.nav-item.active,
.nav-link.active,
html[data-route-view="dashboard"] .nav-item[data-view="dashboard"],
html[data-route-view="character"] .nav-item[data-view="character"],
html[data-route-view="inspiration"] .nav-item[data-view="inspiration"],
html[data-route-view="copywriting"] .nav-item[data-view="copywriting"],
html[data-route-view="knowledge"] .nav-item[data-view="knowledge"],
html[data-route-view="viral"] .nav-item[data-view="viral"],
html[data-route-view="storyboard"] .nav-item[data-view="storyboard"],
html[data-route-view="compliance"] .nav-item[data-view="compliance"],
html[data-route-view="jobs"] .nav-item[data-view="jobs"] {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.18), rgba(34, 211, 238, 0.13));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), 0 0 24px rgba(139, 92, 246, 0.14);
}

html[data-route-view="dashboard"] .nav-item[data-view="dashboard"]::after,
html[data-route-view="character"] .nav-item[data-view="character"]::after,
html[data-route-view="inspiration"] .nav-item[data-view="inspiration"]::after,
html[data-route-view="copywriting"] .nav-item[data-view="copywriting"]::after,
html[data-route-view="knowledge"] .nav-item[data-view="knowledge"]::after,
html[data-route-view="viral"] .nav-item[data-view="viral"]::after,
html[data-route-view="storyboard"] .nav-item[data-view="storyboard"]::after,
html[data-route-view="compliance"] .nav-item[data-view="compliance"]::after,
html[data-route-view="jobs"] .nav-item[data-view="jobs"]::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -10px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--violet), var(--pink));
}

html[data-route-view="dashboard"] .view[data-view="dashboard"],
html[data-route-view="character"] .view[data-view="character"],
html[data-route-view="inspiration"] .view[data-view="inspiration"],
html[data-route-view="copywriting"] .view[data-view="copywriting"],
html[data-route-view="knowledge"] .view[data-view="knowledge"],
html[data-route-view="viral"] .view[data-view="viral"],
html[data-route-view="storyboard"] .view[data-view="storyboard"],
html[data-route-view="compliance"] .view[data-view="compliance"],
html[data-route-view="jobs"] .view[data-view="jobs"] {
  display: block;
}

.user-badge,
.model-pill {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
}

.model-pill select,
input,
select,
textarea,
.result-editor textarea {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(2, 6, 23, 0.48);
  color: #f8fbff;
}

input::placeholder,
textarea::placeholder {
  color: rgba(213, 225, 242, 0.46);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
  background: rgba(2, 6, 23, 0.66);
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--violet), var(--pink));
  color: #fff;
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.24);
}

.secondary {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
}

.metric-grid div,
.quick-flow button,
.knowledge-card,
.topic-card,
.character-card,
.asset-card,
.history-card,
.job-item,
.category-chip,
.copy-summary-pill,
.step,
.shot-table article {
  border-color: rgba(255, 255, 255, 0.11);
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 211, 238, 0.1), transparent 30%),
    rgba(255, 255, 255, 0.055);
  color: #e8f2ff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.empty-state,
.result-block {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(2, 6, 23, 0.28);
  color: var(--muted);
}

.notice {
  border-color: rgba(245, 184, 91, 0.32);
  background: rgba(245, 184, 91, 0.12);
  color: #ffe1ad;
}

@media (max-width: 640px) {
  .site-nav {
    background: rgba(2, 6, 23, 0.82);
  }
}

/* ============== v3: 顶栏重构 + demo 风背景 ============== */

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(84, 214, 182, 0.16), transparent 30rem),
    radial-gradient(circle at 88% 14%, rgba(243, 195, 91, 0.12), transparent 32rem),
    radial-gradient(circle at 78% 92%, rgba(167, 139, 250, 0.14), transparent 30rem),
    #0c0e14;
  color: var(--ink);
}

body::before,
body::after {
  display: none;
}

.app-shell,
.workspace {
  background: transparent;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: clamp(14px, 2.4vw, 32px);
  width: 100%;
  min-height: 64px;
  padding: 10px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(10, 12, 20, 0.72), rgba(10, 12, 20, 0.46)),
    rgba(10, 12, 20, 0.36);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  grid-template-columns: unset;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, #22d3ee, #a78bfa, #f472b6);
  box-shadow: 0 0 24px rgba(167, 139, 250, 0.32);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.brand h1 {
  font-size: 19px;
  font-weight: 800;
  background: linear-gradient(90deg, #67e8f9, #c4b5fd, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand p {
  margin-top: 2px;
  color: #c4b5fd;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(10px, 2vw, 28px);
  min-width: 0;
  overflow: visible;
}

.nav > .nav-item,
.nav .nav-group-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 0;
  padding: 8px 2px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
  transition: color 0.18s ease;
  min-height: 36px;
  cursor: pointer;
}

.nav > .nav-item:hover,
.nav .nav-group-trigger:hover {
  color: #c4b5fd;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.nav > .nav-item.active,
html[data-route-view] .nav > .nav-item.active {
  color: #ffffff;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  border-radius: 0;
}

.nav > .nav-item.active::after,
html[data-route-view] .nav > .nav-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #a78bfa, #f472b6);
}

/* override earlier per-route pill backgrounds: keep only underline */
html[data-route-view="dashboard"] .nav > .nav-item[data-view="dashboard"],
html[data-route-view="character"] .nav > .nav-item[data-view="character"],
html[data-route-view="inspiration"] .nav > .nav-item[data-view="inspiration"],
html[data-route-view="copywriting"] .nav > .nav-item[data-view="copywriting"],
html[data-route-view="knowledge"] .nav > .nav-item[data-view="knowledge"],
html[data-route-view="viral"] .nav > .nav-item[data-view="viral"],
html[data-route-view="storyboard"] .nav > .nav-item[data-view="storyboard"],
html[data-route-view="compliance"] .nav > .nav-item[data-view="compliance"],
html[data-route-view="jobs"] .nav > .nav-item[data-view="jobs"] {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  border-radius: 0;
  color: #ffffff;
}

/* ---- dropdown 折叠分组 ---- */

.nav-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-group-trigger svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.nav-group.open .nav-group-trigger,
.nav-group:hover .nav-group-trigger {
  color: #c4b5fd;
}

.nav-group.open .nav-group-trigger svg {
  transform: rotate(180deg);
}

.nav-group-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translate(-50%, -6px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 60;
}

.nav-group.open .nav-group-menu {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.nav-group-menu::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 0;
  border-bottom: 0;
  background: rgba(15, 23, 42, 0.96);
  transform: rotate(45deg);
}

.nav-group-menu .nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.84);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.nav-group-menu .nav-item:hover {
  background: rgba(167, 139, 250, 0.16);
  color: #fff;
  transform: none;
  box-shadow: none;
}

.nav-group-menu .nav-item.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(167, 139, 250, 0.22));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.26);
}

html[data-route-view] .nav-group-menu .nav-item.active::after,
.nav-group-menu .nav-item::after {
  content: none;
}

/* trigger underline reflects active child route */
html[data-route-view="inspiration"] .nav-group[data-group="copywriting"] .nav-group-trigger,
html[data-route-view="copywriting"] .nav-group[data-group="copywriting"] .nav-group-trigger,
html[data-route-view="viral"] .nav-group[data-group="copywriting"] .nav-group-trigger,
html[data-route-view="storyboard"] .nav-group[data-group="production"] .nav-group-trigger,
html[data-route-view="compliance"] .nav-group[data-group="production"] .nav-group-trigger {
  color: #ffffff;
}

html[data-route-view="inspiration"] .nav-group[data-group="copywriting"] .nav-group-trigger::after,
html[data-route-view="copywriting"] .nav-group[data-group="copywriting"] .nav-group-trigger::after,
html[data-route-view="viral"] .nav-group[data-group="copywriting"] .nav-group-trigger::after,
html[data-route-view="storyboard"] .nav-group[data-group="production"] .nav-group-trigger::after,
html[data-route-view="compliance"] .nav-group[data-group="production"] .nav-group-trigger::after {
  content: "";
  position: absolute;
  left: 0;
  right: 20px;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #a78bfa, #f472b6);
}

/* ---- 右侧动作区 ---- */

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

.model-pill {
  min-height: 36px;
  padding: 0 6px 0 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.model-pill span {
  color: #a5b4fc;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.model-pill select {
  min-width: 124px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.7);
  color: #fff;
  padding: 0 10px;
  font-size: 12.5px;
}

.user-badge {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: rgba(167, 139, 250, 0.14);
  color: #ddd6fe;
  border-radius: 999px;
}

.nav-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 999px;
}

/* ---- 汉堡按钮 ---- */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #f8fbff;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-nav.menu-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-nav.menu-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-nav.menu-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---- 响应式：折叠成抽屉 ---- */

@media (max-width: 1180px) {
  .nav {
    gap: 14px;
    overflow: visible;
  }
  .nav > .nav-item,
  .nav .nav-group-trigger {
    font-size: 13.5px;
  }
  .brand p {
    display: none;
  }
  .model-pill span {
    display: none;
  }
}

@media (max-width: 980px) {
  .site-nav {
    flex-wrap: wrap;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .nav,
  .nav-actions {
    flex: 1 1 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 0 6px;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow: visible;
  }
  .site-nav.menu-open .nav,
  .site-nav.menu-open .nav-actions {
    display: flex;
  }
  .nav > .nav-item,
  .nav .nav-group-trigger {
    justify-content: flex-start;
    width: 100%;
    padding: 10px 10px;
    min-height: 42px;
    border-radius: 10px;
  }
  .nav > .nav-item:hover,
  .nav .nav-group-trigger:hover,
  .nav > .nav-item.active,
  html[data-route-view] .nav > .nav-item.active {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
  }
  .nav > .nav-item.active::after,
  html[data-route-view] .nav > .nav-item.active::after {
    left: 10px;
    right: auto;
    bottom: 6px;
    width: 18px;
    height: 2px;
  }
  .nav-group {
    display: block;
    width: 100%;
  }
  .nav-group-trigger {
    justify-content: space-between;
  }
  .nav-group-menu {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 4px 0 4px 18px;
    min-width: 0;
    display: none;
  }
  .nav-group-menu::before {
    display: none;
  }
  .nav-group.open .nav-group-menu {
    display: flex;
    transform: none;
  }
  .nav-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .model-pill,
  .user-badge {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ============== v4: AI 生成过程精修 ============== */

.ai-progress {
  position: relative;
  min-height: 220px;
  display: grid;
  gap: 16px;
  align-content: start;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at 14% 12%, rgba(34, 211, 238, 0.13), transparent 38%),
    radial-gradient(circle at 86% 88%, rgba(236, 72, 153, 0.10), transparent 40%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.66), rgba(2, 6, 23, 0.40));
  padding: 18px 20px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.32);
}

.ai-progress::before {
  content: "";
  position: absolute;
  inset: -25%;
  z-index: -1;
  background:
    radial-gradient(circle at 28% 32%, rgba(167, 139, 250, 0.18), transparent 36%),
    radial-gradient(circle at 78% 64%, rgba(34, 211, 238, 0.16), transparent 38%);
  filter: blur(38px);
  animation: aiBreathe 9s ease-in-out infinite;
  pointer-events: none;
}

@keyframes aiBreathe {
  0%, 100% { transform: translate(-2%, -2%) scale(1); opacity: 0.88; }
  50% { transform: translate(4%, 5%) scale(1.06); opacity: 1; }
}

.ai-progress-head {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
}

.ai-progress-meta {
  min-width: 0;
}

.ai-progress-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fbff;
  letter-spacing: 0.01em;
}

.ai-progress-subtitle {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(232, 242, 255, 0.62);
  font-size: 12.5px;
  font-weight: 500;
}

.ai-progress-subtitle .percent {
  color: #c4b5fd;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  transition: color 0.4s ease;
}

/* 极光环 + 内核呼吸 */
.ai-orbit {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}

.ai-orbit::before,
.ai-orbit::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  top: 0;
  left: 0;
}

.ai-orbit::before {
  width: 100%;
  height: 100%;
  background: conic-gradient(
    from 0deg,
    rgba(34, 211, 238, 0) 0deg,
    rgba(34, 211, 238, 0.78) 200deg,
    rgba(167, 139, 250, 0.95) 280deg,
    rgba(244, 114, 182, 0.92) 360deg
  );
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%);
  mask: radial-gradient(circle, transparent 55%, #000 57%);
  animation: orbitSpin 1.8s cubic-bezier(0.6, 0, 0.4, 1) infinite;
}

.ai-orbit::after {
  top: 11px;
  left: 11px;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, #22d3ee, #a78bfa, #f472b6);
  box-shadow: 0 0 18px rgba(167, 139, 250, 0.6);
  animation: orbitPulse 1.9s ease-in-out infinite;
}

@keyframes orbitSpin {
  to { transform: rotate(360deg); }
}

@keyframes orbitPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.88; }
  50% { transform: scale(1.06); opacity: 1; }
}

/* 进度条：丝滑过渡 + 高亮扫光 */
.ai-progress-bar {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.ai-progress-bar span {
  display: block;
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #a78bfa, #f472b6);
  box-shadow: 0 0 18px rgba(167, 139, 250, 0.55);
  overflow: hidden;
  transition: width 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-progress-bar span::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%);
  animation: barShimmer 2.4s linear infinite;
}

@keyframes barShimmer {
  to { transform: translateX(100%); }
}

/* 步骤列表：完成对勾 / 当前呼吸 / 待办静止 */
.ai-progress-steps {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-progress-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: rgba(232, 242, 255, 0.55);
  font-size: 13.5px;
  line-height: 1.55;
  transition:
    background 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-progress-step .step-icon {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  transition:
    background 0.4s ease,
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.ai-progress-step .step-text {
  flex: 1;
  min-width: 0;
}

.ai-progress-step.done {
  color: rgba(232, 242, 255, 0.85);
}

.ai-progress-step.done .step-icon {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.16);
}

.ai-progress-step.done .step-icon::after {
  content: "";
  width: 4px;
  height: 7px;
  border-right: 1.8px solid #6ee7b7;
  border-bottom: 1.8px solid #6ee7b7;
  transform: rotate(45deg) translate(-1px, -1px);
}

.ai-progress-step.active {
  color: #f8fbff;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.10), rgba(167, 139, 250, 0.10));
  border-color: rgba(167, 139, 250, 0.26);
}

.ai-progress-step.active .step-icon {
  border-color: rgba(167, 139, 250, 0.66);
  background: rgba(167, 139, 250, 0.22);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.08);
}

.ai-progress-step.active .step-icon::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #67e8f9, #a78bfa);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.9);
  animation: stepPulse 1.4s ease-in-out infinite;
}

@keyframes stepPulse {
  0%, 100% { transform: scale(0.82); opacity: 0.72; }
  50% { transform: scale(1.18); opacity: 1; }
}

.ai-progress-step.pending {
  opacity: 0.58;
}

/* 实时流式预览：从模型 partial_text 抽出来的最新片段 */
.ai-progress-live {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
}

.ai-progress-live[hidden] {
  display: none !important;
}

.ai-progress-live::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #67e8f9, #f472b6);
  box-shadow: 0 0 10px rgba(244, 114, 182, 0.7);
  animation: stepPulse 1.4s ease-in-out infinite;
}

.ai-progress-live .live-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(
    90deg,
    rgba(232, 242, 255, 0.55) 0%,
    #ffffff 32%,
    rgba(232, 242, 255, 0.55) 64%
  );
  background-size: 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: liveShimmer 3.2s linear infinite;
}

@keyframes liveShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* 尊重 reduced-motion 偏好 */
@media (prefers-reduced-motion: reduce) {
  .ai-progress::before,
  .ai-orbit::before,
  .ai-orbit::after,
  .ai-progress-bar span::after,
  .ai-progress-step.active .step-icon::before,
  .ai-progress-live::before,
  .ai-progress-live .live-text {
    animation: none;
  }
  .ai-progress-bar span {
    transition: none;
  }
}

/* ============== v4: 全站任务进度挂件 ============== */

.global-progress {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.global-progress[hidden] {
  display: none !important;
}

.global-progress > * {
  pointer-events: auto;
}

.global-progress-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.32);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #f8fbff;
  cursor: pointer;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: left;
  transition:
    transform 0.18s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.global-progress-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.orbit-mini {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-block;
}

.orbit-mini::before,
.orbit-mini::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  top: 0;
  left: 0;
}

.orbit-mini::before {
  width: 100%;
  height: 100%;
  background: conic-gradient(
    from 0deg,
    rgba(34, 211, 238, 0) 0deg,
    rgba(167, 139, 250, 0.9) 240deg,
    rgba(244, 114, 182, 0.92) 360deg
  );
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%);
  mask: radial-gradient(circle, transparent 55%, #000 57%);
  animation: orbitSpin 1.6s linear infinite;
}

.orbit-mini::after {
  top: 8px;
  left: 8px;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #22d3ee, #f472b6);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.7);
  animation: orbitPulse 1.8s ease-in-out infinite;
}

.global-progress-summary {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.global-progress-summary .title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fbff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-progress-summary .meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(232, 242, 255, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-progress-summary .meta .percent {
  color: #c4b5fd;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.global-progress-summary .meta .dot {
  color: rgba(232, 242, 255, 0.3);
}

.global-progress-summary .meta .state {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-progress-toggle .chevron {
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
  transform: rotate(45deg);
  transition: transform 0.22s ease;
  flex: 0 0 9px;
  margin-right: 2px;
}

.global-progress.expanded .global-progress-toggle .chevron {
  transform: rotate(-135deg);
}

.global-progress-panel {
  max-height: min(560px, 70vh);
  overflow-y: auto;
  border-radius: 16px;
  animation: globalPanelIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.global-progress-panel[hidden] {
  display: none !important;
}

@keyframes globalPanelIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 全站挂件里的 ai-progress 卡片：去掉外阴影避免叠层（panel 自己已经有阴影感） */
.global-progress-panel .ai-progress {
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.46);
}

/* 任务完成时的庆祝闪烁：绿色 + 停转 */
.global-progress.completed .global-progress-toggle {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 22px 56px rgba(52, 211, 153, 0.22);
}

.global-progress.completed .orbit-mini::before {
  animation: none;
  background: conic-gradient(from 0deg, rgba(52, 211, 153, 0.75), rgba(110, 231, 183, 0.95));
}

.global-progress.completed .orbit-mini::after {
  animation: none;
  background: linear-gradient(135deg, #34d399, #6ee7b7);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
}

.global-progress.completed .global-progress-summary .meta .percent {
  color: #6ee7b7;
}

@media (max-width: 640px) {
  .global-progress {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orbit-mini::before,
  .orbit-mini::after,
  .global-progress-panel {
    animation: none;
  }
}

/* v5: 生成记录详情弹窗（前端不再直接显示 JSON） */

.detail-modal .modal-dialog.modal-lg {
  width: min(960px, calc(100vw - 36px));
  max-width: 100%;
  max-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(10, 14, 28, 0.96), rgba(5, 8, 18, 0.94)),
    radial-gradient(120% 80% at 0% 0%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(120% 80% at 100% 100%, rgba(56, 189, 248, 0.14), transparent 60%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.6);
}

.detail-modal .modal-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-modal .detail-head-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.detail-modal .detail-head-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(165, 180, 252, 0.75);
  text-transform: uppercase;
}

.detail-modal .detail-head-text h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #f5f7ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-modal .detail-head-meta {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.6);
}

.detail-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 8px;
  display: grid;
  gap: 14px;
}

.detail-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(56, 189, 248, 0.1));
  border: 1px solid rgba(165, 180, 252, 0.22);
  color: #f5f7ff;
  flex-wrap: wrap;
}

.detail-hero strong {
  font-size: 16px;
  font-weight: 600;
}

.detail-hero span {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.72);
}

.detail-hero.risk-high {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(244, 114, 182, 0.12));
  border-color: rgba(248, 113, 113, 0.35);
}

.detail-hero.risk-mid {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.18), rgba(249, 115, 22, 0.12));
  border-color: rgba(250, 204, 21, 0.35);
}

.detail-hero.risk-low,
.detail-hero.risk-pass {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(56, 189, 248, 0.1));
  border-color: rgba(74, 222, 128, 0.32);
}

.detail-section {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-section h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(196, 211, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section h4::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #818cf8, #38bdf8);
}

.detail-section > p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(241, 245, 249, 0.92);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: rgba(226, 232, 240, 0.92);
  font-size: 13.5px;
  line-height: 1.6;
}

.detail-list li {
  word-break: break-word;
}

.detail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.detail-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.92);
  word-break: break-word;
}

.detail-card strong {
  font-size: 13.5px;
  color: #f5f7ff;
}

.detail-card span {
  font-size: 11.5px;
  color: rgba(148, 163, 184, 0.9);
}

.detail-card p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.detail-card p b {
  color: rgba(196, 211, 255, 0.85);
  font-weight: 600;
  margin-right: 4px;
}

.detail-kv {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  font-size: 13.5px;
}

.detail-kv dt {
  color: rgba(196, 211, 255, 0.8);
  font-weight: 600;
}

.detail-kv dd {
  margin: 0;
  color: rgba(241, 245, 249, 0.92);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-kv dd > p:first-child,
.detail-kv dd > ul:first-child,
.detail-kv dd > dl:first-child {
  margin-top: 0;
}

.detail-shots {
  display: grid;
  gap: 10px;
}

.detail-shot {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 6px;
  font-size: 13.5px;
}

.detail-shot header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #c7d2fe;
}

.detail-shot p {
  margin: 0;
  line-height: 1.6;
}

.detail-shot p b {
  color: rgba(196, 211, 255, 0.85);
  margin-right: 6px;
}

.detail-issues {
  display: grid;
  gap: 8px;
}

.detail-issues article {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 6px;
  font-size: 13.5px;
}

.detail-issues article header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-issues .revision-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.detail-issues .revision-pair del {
  color: #fda4af;
  background: rgba(244, 63, 94, 0.12);
  border-radius: 6px;
  padding: 2px 6px;
  text-decoration: line-through;
}

.detail-issues .revision-pair ins {
  color: #bef264;
  background: rgba(34, 197, 94, 0.12);
  border-radius: 6px;
  padding: 2px 6px;
  text-decoration: none;
}

.detail-empty {
  padding: 32px 16px;
  text-align: center;
  color: rgba(148, 163, 184, 0.7);
  font-size: 13px;
}

@media (max-width: 640px) {
  .detail-modal .modal-dialog.modal-lg {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 24px);
  }
  .detail-modal .modal-head,
  .detail-modal-body,
  .detail-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .detail-cards {
    grid-template-columns: 1fr;
  }
  .detail-kv {
    grid-template-columns: 1fr;
  }
}

/* ============== v5: 页面呼吸感与模块间距统一 ============== */
.workspace {
  padding-bottom: 56px;
}

.workflow,
.view.active,
html[data-route-view] .view[data-view] {
  gap: 22px;
}

.view.active,
html[data-route-view="dashboard"] .view[data-view="dashboard"],
html[data-route-view="character"] .view[data-view="character"],
html[data-route-view="inspiration"] .view[data-view="inspiration"],
html[data-route-view="copywriting"] .view[data-view="copywriting"],
html[data-route-view="knowledge"] .view[data-view="knowledge"],
html[data-route-view="viral"] .view[data-view="viral"],
html[data-route-view="storyboard"] .view[data-view="storyboard"],
html[data-route-view="compliance"] .view[data-view="compliance"],
html[data-route-view="jobs"] .view[data-view="jobs"] {
  row-gap: 22px;
}

.split,
.dashboard-grid {
  gap: 22px;
}

.panel,
.auth-card {
  border-radius: 12px;
  padding: 24px;
}

.panel + .panel,
.result-block + .panel,
.panel + .result-block {
  margin-top: 22px;
}

.panel-head {
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.panel-head > div:first-child {
  min-width: 0;
}

.panel-head-actions,
.copy-flow-tools,
.toolbar-inline,
.dashboard-actions,
.form-actions,
.copy-result-actions,
.character-card-actions,
.config-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.form-grid {
  gap: 18px;
}

.field {
  gap: 8px;
}

.field span,
.check-field span {
  color: #d0dcef;
}

input,
select,
textarea {
  min-height: 42px;
}

textarea {
  line-height: 1.7;
}

button,
.primary,
.secondary {
  min-height: 40px;
  border-radius: 8px;
}

.primary,
.secondary,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: normal;
}

.form-actions .primary,
.form-actions .secondary,
.copy-result-actions .primary,
.copy-result-actions .secondary {
  flex: 0 1 auto;
}

.result-block {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(8, 13, 31, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.16);
  color: #eef6ff;
  box-shadow: 0 22px 52px rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(14px);
}

.result-block.empty-state,
.result-block.empty-result,
.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: rgba(220, 232, 248, 0.6);
  background: rgba(8, 13, 31, 0.5);
  border: 1px dashed rgba(148, 163, 184, 0.28);
}

.result-hero {
  border-radius: 14px;
  padding: 20px;
  background:
    radial-gradient(circle at 8% 0%, rgba(34, 211, 238, 0.18), transparent 36%),
    radial-gradient(circle at 88% 12%, rgba(139, 92, 246, 0.18), transparent 38%),
    linear-gradient(140deg, rgba(15, 23, 42, 0.88), rgba(10, 14, 28, 0.92));
  border: 1px solid rgba(125, 211, 252, 0.24);
  display: grid;
  gap: 8px;
  box-shadow: 0 18px 40px rgba(8, 13, 31, 0.32);
}

.result-hero span {
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-hero strong {
  color: #f8fbff;
  font-size: 20px;
}

.result-hero div {
  color: #d0dcef;
  line-height: 1.7;
}

.copy-meta-block {
  display: grid;
  gap: 8px;
  border-left: 0;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(8, 13, 31, 0.55);
  border-radius: 10px;
  padding: 16px;
  color: #d0dcef;
}

.copy-meta-block h5 {
  margin: 0;
  color: #7dd3fc;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.copy-meta-block p,
.copy-meta-block ul,
.copy-meta-block ol {
  margin-top: 0;
  margin-bottom: 0;
  color: #d0dcef;
}

.topic-card-grid,
.knowledge-list,
.asset-list,
.history-list,
.jobs-list,
.admin-users {
  gap: 16px;
}

.topic-card,
.knowledge-card,
.asset-card,
.character-card,
.history-card,
.job-item,
.detail-card {
  border-radius: 10px;
  padding: 18px;
}

.character-card,
.asset-card,
.history-card,
.job-item {
  display: grid;
  gap: 14px;
}

.character-card-head,
.asset-card header,
.history-card header,
.job-item {
  gap: 12px;
}

.category-grid,
.choice-grid {
  gap: 12px;
}

.category-chip,
.choice {
  min-height: 54px;
  padding: 12px 14px;
  border-radius: 10px;
}

.step-panel {
  display: grid;
  gap: 18px;
}

.step-panel[hidden] {
  display: none !important;
}

.stepper {
  margin-bottom: 22px;
}

.video-download-block {
  align-items: start;
}

.viral-cover {
  width: min(260px, 100%);
}

.ai-progress {
  min-height: 240px;
  gap: 18px;
  border-radius: 14px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  background:
    radial-gradient(circle at 10% 0%, rgba(34, 211, 238, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(8, 13, 31, 0.86), rgba(2, 6, 23, 0.92));
  box-shadow: 0 22px 56px rgba(2, 6, 23, 0.46);
}

.ai-progress::before {
  opacity: 0.7;
}

.ai-progress-title {
  color: #f8fbff;
}

.ai-progress-subtitle {
  color: rgba(226, 232, 240, 0.78);
}

.ai-progress-subtitle .percent {
  color: #67e8f9;
}

.ai-progress-bar {
  background: rgba(226, 232, 240, 0.16);
}

.ai-progress-step {
  color: rgba(226, 232, 240, 0.6);
  border-radius: 10px;
}

.ai-progress-step.done,
.ai-progress-step.active {
  color: #f8fbff;
}

.ai-progress-step.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), rgba(168, 85, 247, 0.16));
  border-color: rgba(125, 211, 252, 0.32);
}

.ai-progress-live {
  color: #dbeafe;
  background: rgba(2, 6, 23, 0.55);
  border-color: rgba(148, 163, 184, 0.2);
}

.ai-progress-live .live-text {
  background: linear-gradient(90deg, rgba(219, 234, 254, 0.7), #ffffff, rgba(219, 234, 254, 0.7));
  background-size: 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@media (max-width: 900px) {
  .panel,
  .auth-card,
  .result-block {
    padding: 18px;
  }

  .split,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
  }

  .form-actions .primary,
  .form-actions .secondary,
  .copy-result-actions .primary,
  .copy-result-actions .secondary,
  .panel-head-actions .primary,
  .panel-head-actions .secondary {
    flex: 1 1 180px;
  }
}

/* ============== v6: 深色生成面板与失败态修正 ============== */
.form-grid + .result-block,
.form-grid + .ai-progress,
form + .result-block,
form + .ai-progress {
  margin-top: 24px;
}

.ai-progress {
  min-height: 236px;
  gap: 18px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background:
    radial-gradient(circle at 12% 8%, rgba(34, 211, 238, 0.18), transparent 35%),
    radial-gradient(circle at 78% 5%, rgba(168, 85, 247, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.90));
  box-shadow: 0 20px 56px rgba(2, 6, 23, 0.24);
}

.ai-progress::before {
  opacity: 0.72;
}

.ai-progress-title {
  color: #f8fbff;
}

.ai-progress-subtitle {
  color: rgba(226, 232, 240, 0.72);
}

.ai-progress-subtitle .percent {
  color: #67e8f9;
}

.ai-progress-bar {
  background: rgba(226, 232, 240, 0.16);
}

.ai-progress-step {
  color: rgba(226, 232, 240, 0.62);
}

.ai-progress-step.done,
.ai-progress-step.active {
  color: #f8fbff;
}

.ai-progress-step.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(168, 85, 247, 0.14));
  border-color: rgba(125, 211, 252, 0.28);
}

.ai-progress-live {
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.58);
  border-color: rgba(148, 163, 184, 0.18);
}

.ai-progress-live .live-text {
  background: linear-gradient(90deg, rgba(219, 234, 254, 0.7), #ffffff, rgba(219, 234, 254, 0.7));
  background-size: 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.job-failure-block {
  border-color: rgba(251, 113, 133, 0.28);
}

.failure-hero {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.12), rgba(15, 23, 42, 0.04));
  border-color: rgba(251, 113, 133, 0.30);
}

.failure-hero span {
  color: #e11d48;
}

/* ============== v7: 深色结果区文字可读性修正 ============== */
.result-block,
.result-block p,
.result-block li,
.result-block dd,
.result-block small,
.copy-result,
.copy-result .copy-body,
.copy-result .copy-body p,
.copy-body,
.copy-body p {
  color: #eaf2ff;
}

.copy-result .copy-body {
  font-weight: 520;
}

.copy-result .copy-body p,
.copy-body p {
  color: #dbe6f7;
}

.copy-result .copy-body p strong,
.copy-body strong {
  color: #ffffff;
}

.copy-meta-block,
.copy-meta-block p,
.copy-meta-block li,
.copy-meta-block dd {
  color: #d0dcef;
}

.copy-meta-block h5 {
  color: #7dd3fc;
}

.result-block .job-meta,
.result-block .job-meta span {
  color: rgba(220, 232, 248, 0.66);
}

.detail-modal-body,
.detail-section,
.detail-section > p,
.detail-list,
.detail-card,
.detail-card p,
.detail-kv,
.detail-kv dd {
  color: #dbe6f7;
}

.detail-section h4,
.detail-card p b,
.detail-shot p b {
  color: #7dd3fc;
}

.detail-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(8, 13, 31, 0.6);
  border-color: rgba(125, 211, 252, 0.18);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.32);
}

.detail-card strong {
  color: #ffffff;
}

.detail-card span {
  color: rgba(220, 232, 248, 0.7);
}

/* ============== v8: 灵感枯竭选题卡片修正（深色科技风） ============== */
.inspiration-result {
  overflow: hidden;
}

.inspiration-result .topic-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.inspiration-result .topic-card {
  width: 100%;
  min-height: 168px;
  height: auto;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  align-items: start;
  gap: 10px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(8, 13, 31, 0.65);
  color: #eef6ff;
  text-align: left;
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.38);
  overflow: hidden;
  white-space: normal;
  line-height: 1.55;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.inspiration-result .topic-card:hover {
  border-color: rgba(125, 211, 252, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(34, 211, 238, 0.14);
}

.inspiration-result .topic-card.selected {
  border-color: rgba(34, 211, 238, 0.7);
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.22), transparent 36%),
    linear-gradient(180deg, rgba(34, 211, 238, 0.1), rgba(139, 92, 246, 0.1)),
    rgba(8, 13, 31, 0.7);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.22), 0 18px 40px rgba(34, 211, 238, 0.18);
}

.inspiration-result .topic-card strong,
.inspiration-result .topic-card span,
.inspiration-result .topic-card p {
  position: static;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  text-overflow: unset;
}

.inspiration-result .topic-card strong {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.inspiration-result .topic-card span {
  width: fit-content;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.16);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(125, 211, 252, 0.32);
}

.inspiration-result .topic-card p {
  color: #d0dcef;
  font-size: 13.5px;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .inspiration-result .topic-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ============== Admin console: paged workspace ============== */
body.admin-body {
  background: #f3f6fb;
  color: #172033;
}

body.admin-body::before,
body.admin-body::after {
  display: none;
}

.admin-shell {
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  background: #f3f6fb;
}

.admin-shell .sidebar {
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid #dde4ef;
  background: #ffffff;
  box-shadow: 8px 0 28px rgba(21, 31, 49, 0.06);
}

.admin-shell .brand {
  min-width: 0;
  padding: 2px 4px 18px;
  border-bottom: 1px solid #edf1f7;
}

.admin-shell .brand-mark {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: #1d4ed8;
  box-shadow: none;
}

.admin-shell .brand h1 {
  background: none;
  color: #101828;
  font-size: 18px;
  letter-spacing: 0;
}

.admin-shell .brand p {
  color: #667085;
  letter-spacing: 0.08em;
}

.admin-shell .sidebar .nav {
  gap: 4px;
  margin-top: 18px;
}

.admin-shell .sidebar .nav-link {
  min-height: 42px;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #344054;
  padding: 0 12px;
  font-weight: 650;
}

.admin-shell .sidebar .nav-link:hover {
  background: #f5f8ff;
  border-color: #dbe7ff;
  color: #1d4ed8;
  box-shadow: none;
}

.admin-shell .sidebar .nav-link.active {
  background: #eef4ff;
  border-color: #c7d7fe;
  color: #1d4ed8;
  box-shadow: inset 3px 0 0 #2563eb;
}

.admin-shell .sidebar .nav-link.active::after {
  display: none;
}

.admin-shell .nav-actions {
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid #edf1f7;
}

.admin-shell .user-badge {
  min-height: 36px;
  justify-content: center;
  border-color: #d0d5dd;
  background: #f8fafc;
  color: #344054;
  box-shadow: none;
}

.admin-shell .nav-button {
  width: 100%;
  border-radius: 8px;
}

.admin-shell .workspace {
  width: min(1440px, calc(100vw - 264px));
  margin: 0;
  padding: 28px clamp(20px, 3vw, 40px) 48px;
  background: #f3f6fb;
}

.admin-shell .topbar {
  align-items: center;
  min-height: 72px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #dde4ef;
}

.admin-shell .topbar h2 {
  color: #101828;
  font-size: 26px;
  font-weight: 800;
}

.admin-shell .topbar p {
  color: #667085;
  font-size: 14px;
}

.admin-shell .notice {
  border-color: #fedf89;
  background: #fffaeb;
  color: #93370d;
  box-shadow: none;
}

.admin-shell .auth-panel {
  grid-template-columns: minmax(320px, 520px);
}

.admin-shell #adminMain {
  display: grid;
  grid-template-columns: minmax(360px, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
  gap: 18px;
}

.admin-shell .admin-page-panel:not([data-admin-page="users"]) {
  grid-column: 1 / -1;
}

.admin-shell .panel,
.admin-shell .auth-card {
  border: 1px solid #dde4ef;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  box-shadow: 0 10px 28px rgba(21, 31, 49, 0.06);
  padding: 18px;
  backdrop-filter: none;
}

.admin-shell .panel-head {
  align-items: center;
  min-height: 42px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf1f7;
}

.admin-shell .panel h3,
.admin-shell .panel h4 {
  color: #101828;
  font-size: 16px;
  font-weight: 760;
}

.admin-shell .panel-desc,
.admin-shell .job-meta,
.admin-shell .field span,
.admin-shell .check-field span {
  color: #667085;
}

.admin-shell input,
.admin-shell select,
.admin-shell textarea {
  border-color: #d0d5dd;
  background: #ffffff;
  color: #172033;
}

.admin-shell input::placeholder,
.admin-shell textarea::placeholder {
  color: #98a2b3;
}

.admin-shell input:focus,
.admin-shell select:focus,
.admin-shell textarea:focus {
  border-color: #84adff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.admin-shell .check-field {
  border-color: #e4e7ec;
  background: #f8fafc;
}

.admin-shell .primary {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.18);
}

.admin-shell .secondary {
  border-color: #d0d5dd;
  background: #ffffff;
  color: #344054;
  box-shadow: none;
}

.admin-shell button:hover {
  transform: none;
}

.admin-shell .admin-users,
.admin-shell .jobs-list {
  gap: 12px;
}

.admin-shell .admin-user,
.admin-shell .job-item,
.admin-shell .ops-grid article {
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  box-shadow: none;
}

.admin-shell .admin-user strong,
.admin-shell .job-item strong {
  color: #101828;
}

.admin-shell .admin-actions,
.admin-shell .inline-edit-grid {
  align-items: center;
}

.admin-shell .empty-state {
  min-height: 120px;
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #667085;
}

.admin-shell .status {
  background: #f2f4f7;
  color: #475467;
}

.admin-shell .status.completed {
  border-color: #abefc6;
  background: #ecfdf3;
  color: #067647;
}

.admin-shell .status.running,
.admin-shell .status.pending {
  border-color: #b2ddff;
  background: #eff8ff;
  color: #175cd3;
}

.admin-shell .status.failed {
  border-color: #fecdd3;
  background: #fff1f3;
  color: #be123c;
}

.admin-shell .job-error {
  color: #be123c;
}

.admin-shell .neutral-note {
  background: #f8fafc;
  color: #475467;
}

/* ============== v9: 结果区操作按钮可见性修正（深色科技风） ============== */
.result-block .copy-result-actions {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.result-block .copy-result-actions .primary,
.result-block .inline-download.primary {
  border: 1px solid rgba(125, 211, 252, 0.5);
  background: linear-gradient(135deg, var(--accent), var(--violet), var(--pink));
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(139, 92, 246, 0.32);
}

.result-block .copy-result-actions .primary:hover,
.result-block .inline-download.primary:hover {
  box-shadow: 0 18px 40px rgba(34, 211, 238, 0.32);
}

.result-block .copy-result-actions .secondary {
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(255, 255, 255, 0.06);
  color: #eaf2ff;
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.32);
}

.result-block .copy-result-actions .secondary:hover {
  border-color: rgba(125, 211, 252, 0.55);
  background: rgba(34, 211, 238, 0.12);
  color: #7dd3fc;
}

.result-block .copy-result-actions button:disabled {
  opacity: 0.45;
  color: rgba(220, 232, 248, 0.6);
  background: rgba(255, 255, 255, 0.04);
}

.admin-shell .ops-grid article {
  padding: 14px;
}

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

  .admin-shell .admin-page-panel {
    grid-column: 1 / -1;
  }
}

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

  .admin-shell .sidebar {
    position: static;
    height: auto;
  }

  .admin-shell .workspace {
    width: 100%;
  }
}

/* ============== v10: 用户前端深色科技风统一兜底（admin 后台除外） ============== */

/* 基础排印对比度增强：在深色背景下让说明文字更易读 */
body:not(.admin-body) .panel-desc,
body:not(.admin-body) .topbar p,
body:not(.admin-body) .job-meta,
body:not(.admin-body) .asset-kv span,
body:not(.admin-body) .copy-flow-label,
body:not(.admin-body) .brand p {
  color: #aabbd6;
}

body:not(.admin-body) .topbar h2,
body:not(.admin-body) .panel h3,
body:not(.admin-body) .panel h4,
body:not(.admin-body) .panel h5,
body:not(.admin-body) .character-card strong,
body:not(.admin-body) .asset-card strong,
body:not(.admin-body) .history-card strong,
body:not(.admin-body) .job-item strong,
body:not(.admin-body) .step-header h3,
body:not(.admin-body) .modal-head h3,
body:not(.admin-body) .drawer-dialog h3 {
  color: #f8fbff;
}

body:not(.admin-body) .field span,
body:not(.admin-body) .check-field span {
  color: #d0dcef;
  font-weight: 680;
}

/* 输入控件回归半透明深色玻璃 */
body:not(.admin-body) input,
body:not(.admin-body) select,
body:not(.admin-body) textarea {
  background: rgba(2, 6, 23, 0.45);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f8fbff;
}

body:not(.admin-body) input::placeholder,
body:not(.admin-body) textarea::placeholder {
  color: rgba(213, 225, 242, 0.46);
}

body:not(.admin-body) input:focus,
body:not(.admin-body) select:focus,
body:not(.admin-body) textarea:focus {
  border-color: rgba(34, 211, 238, 0.72);
  background: rgba(2, 6, 23, 0.66);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

body:not(.admin-body) select option {
  background: #0b1022;
  color: #f8fbff;
}

/* 工作台 / 面板背景回归玻璃质感 */
body:not(.admin-body) .panel,
body:not(.admin-body) .auth-card,
body:not(.admin-body) .modal-dialog,
body:not(.admin-body) .drawer-dialog {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(12, 18, 36, 0.78);
  border: 1px solid rgba(125, 211, 252, 0.14);
  color: #eef6ff;
  box-shadow: 0 28px 70px rgba(2, 6, 23, 0.46);
  backdrop-filter: blur(20px);
}

/* 工作台仪表盘 metric 卡片 */
body:not(.admin-body) .metric-grid div {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(8, 13, 31, 0.58);
  border: 1px solid rgba(125, 211, 252, 0.16);
  color: #eef6ff;
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.32);
}

body:not(.admin-body) .metric-grid span {
  color: #aabbd6;
}

body:not(.admin-body) .metric-grid strong {
  color: #ffffff;
}

/* 快捷流程按钮 */
body:not(.admin-body) .quick-flow button {
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(8, 13, 31, 0.6);
  border: 1px solid rgba(125, 211, 252, 0.18);
  color: #eef6ff;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.32);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

body:not(.admin-body) .quick-flow button:hover {
  border-color: rgba(125, 211, 252, 0.5);
  box-shadow: 0 22px 42px rgba(34, 211, 238, 0.18);
}

body:not(.admin-body) .quick-flow strong {
  color: #7dd3fc;
  font-size: 22px;
  font-weight: 820;
}

body:not(.admin-body) .quick-flow span {
  color: #d0dcef;
}

/* 各类卡片回归深色玻璃 */
body:not(.admin-body) .knowledge-card,
body:not(.admin-body) .topic-card,
body:not(.admin-body) .asset-card,
body:not(.admin-body) .history-card,
body:not(.admin-body) .job-item {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(8, 13, 31, 0.6);
  border: 1px solid rgba(125, 211, 252, 0.14);
  color: #eef6ff;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.32);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

body:not(.admin-body) .knowledge-card:hover,
body:not(.admin-body) .topic-card:hover,
body:not(.admin-body) .asset-card:hover,
body:not(.admin-body) .history-card:hover,
body:not(.admin-body) .job-item:hover {
  border-color: rgba(125, 211, 252, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 22px 38px rgba(34, 211, 238, 0.14);
}

body:not(.admin-body) .topic-card.selected {
  border-color: rgba(34, 211, 238, 0.7);
  background:
    radial-gradient(circle at 12% 0%, rgba(34, 211, 238, 0.22), transparent 36%),
    linear-gradient(180deg, rgba(34, 211, 238, 0.1), rgba(139, 92, 246, 0.1)),
    rgba(8, 13, 31, 0.7);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.22), 0 18px 40px rgba(34, 211, 238, 0.18);
}

/* knowledge-card 内部文字调亮 */
body:not(.admin-body) .knowledge-card strong,
body:not(.admin-body) .knowledge-card h4 {
  color: #ffffff;
}

body:not(.admin-body) .knowledge-card p,
body:not(.admin-body) .knowledge-card span:not(.muted-badge) {
  color: #d0dcef;
}

/* 类别选择 chip / choice 复选项的深色统一 */
body:not(.admin-body) .category-chip,
body:not(.admin-body) .choice,
body:not(.admin-body) .check-field {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #eaf2ff;
}

body:not(.admin-body) .category-chip:hover,
body:not(.admin-body) .choice:hover {
  border-color: rgba(125, 211, 252, 0.4);
  background: rgba(34, 211, 238, 0.08);
}

body:not(.admin-body) .category-chip.selected,
body:not(.admin-body) .choice.selected {
  border-color: rgba(34, 211, 238, 0.6);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.16));
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.18);
}

/* 中性提示色块 / 标签 */
body:not(.admin-body) .neutral-note {
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(125, 211, 252, 0.2);
  color: #cfe4ff;
}

body:not(.admin-body) .muted-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d0dcef;
}

body:not(.admin-body) .cost-tag {
  color: #cfe4ff;
}

/* 复制流程顶部人设条 */
body:not(.admin-body) .character-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(125, 211, 252, 0.22);
  color: #f8fbff;
}

body:not(.admin-body) .character-pill strong {
  color: #ffffff;
}

body:not(.admin-body) .character-pill span {
  color: #aabbd6;
}

/* 复制流程顶部总结条 */
body:not(.admin-body) .copy-summary,
body:not(.admin-body) .copy-summary-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(125, 211, 252, 0.18);
  color: #eef6ff;
}

body:not(.admin-body) .copy-summary-pill strong {
  color: #ffffff;
}

body:not(.admin-body) .copy-summary-pill span {
  color: #aabbd6;
}

/* Stepper 步骤指示 */
body:not(.admin-body) .stepper .step {
  color: #aabbd6;
}

body:not(.admin-body) .stepper .step.active {
  color: #ffffff;
}

body:not(.admin-body) .stepper .step .step-no {
  border-color: rgba(125, 211, 252, 0.32);
  background: rgba(34, 211, 238, 0.08);
  color: #7dd3fc;
}

body:not(.admin-body) .stepper .step.active .step-no {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18);
}

/* secondary 按钮在深色背景上的可见性 */
body:not(.admin-body) .secondary,
body:not(.admin-body) .nav-button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #eaf2ff;
}

body:not(.admin-body) .secondary:hover,
body:not(.admin-body) .nav-button:hover {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(125, 211, 252, 0.4);
  color: #7dd3fc;
}

/* 通知条 / notice */
body:not(.admin-body) .notice {
  background: rgba(245, 184, 91, 0.08);
  border: 1px solid rgba(245, 184, 91, 0.32);
  color: #fde68a;
}

/* 模态头部 / 抽屉头部分隔线深色化 */
body:not(.admin-body) .modal-head,
body:not(.admin-body) .modal-footer {
  border-color: rgba(255, 255, 255, 0.08);
}

body:not(.admin-body) .icon-button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #eef6ff;
}

body:not(.admin-body) .icon-button:hover {
  background: rgba(251, 113, 133, 0.16);
  border-color: rgba(251, 113, 133, 0.4);
  color: #fb7185;
}

/* 头像/用户徽章 */
body:not(.admin-body) .user-badge {
  color: #eaf2ff;
}

/* 任务记录 / 历史记录 详情字段 */
body:not(.admin-body) .detail-modal-body,
body:not(.admin-body) .detail-section,
body:not(.admin-body) .detail-section > p,
body:not(.admin-body) .detail-list,
body:not(.admin-body) .detail-kv,
body:not(.admin-body) .detail-kv dd {
  color: #dbe6f7;
}

body:not(.admin-body) .detail-head-eyebrow {
  color: #7dd3fc;
}

body:not(.admin-body) .detail-head-meta {
  color: #aabbd6;
}

/* Empty-state（空态）字够亮 */
body:not(.admin-body) .empty-state {
  color: rgba(220, 232, 248, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    rgba(8, 13, 31, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.3);
}

/* 滚动条美化（深色） */
body:not(.admin-body) ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body:not(.admin-body) ::-webkit-scrollbar-track {
  background: rgba(2, 6, 23, 0.4);
}

body:not(.admin-body) ::-webkit-scrollbar-thumb {
  background: rgba(125, 211, 252, 0.22);
  border-radius: 999px;
  border: 2px solid rgba(2, 6, 23, 0.4);
}

body:not(.admin-body) ::-webkit-scrollbar-thumb:hover {
  background: rgba(125, 211, 252, 0.4);
}

/* 检测违规结果对照表格 */
body:not(.admin-body) .compliance-diff,
body:not(.admin-body) .compliance-row,
body:not(.admin-body) .compliance-original,
body:not(.admin-body) .compliance-revised {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(8, 13, 31, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #eaf2ff;
}

body:not(.admin-body) .compliance-violation,
body:not(.admin-body) mark.violation {
  background: rgba(251, 113, 133, 0.22);
  color: #fecaca;
  border-radius: 4px;
  padding: 0 3px;
}

/* 分镜表格在深色背景下的可见 */
body:not(.admin-body) .storyboard-table,
body:not(.admin-body) .storyboard-shot,
body:not(.admin-body) .shot-row {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(8, 13, 31, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #eaf2ff;
}

body:not(.admin-body) .storyboard-shot strong,
body:not(.admin-body) .shot-row strong {
  color: #7dd3fc;
}

/* 全局任务进度条贴片配色（已是深色，统一一下文字） */
body:not(.admin-body) .global-progress-summary .title,
body:not(.admin-body) .global-progress-summary .meta .state {
  color: #f8fbff;
}

body:not(.admin-body) .global-progress-summary .meta .percent {
  color: #67e8f9;
}

/* ============== Admin v2: 用户管理单列 + 行式表格 + 浅色弹窗 ============== */

/* 后台主区改为单列布局，所有面板自然占满 */
.admin-shell #adminMain {
  grid-template-columns: 1fr;
  gap: 16px;
}

.admin-shell .admin-page-panel,
.admin-shell .admin-page-panel:not([data-admin-page="users"]) {
  grid-column: 1 / -1;
}

/* 用户列表行式表格 */
.admin-shell .admin-user-table {
  display: grid;
  gap: 0;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.admin-shell .admin-user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) 96px 88px 110px 160px 150px minmax(180px, 0.9fr);
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #edf1f7;
  font-size: 13.5px;
  color: #344054;
}

.admin-shell .admin-user-row:last-child {
  border-bottom: 0;
}

.admin-shell .admin-user-row-head {
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #667085;
  text-transform: uppercase;
  padding: 10px 16px;
}

.admin-shell .admin-user-row:not(.admin-user-row-head):hover {
  background: #f8fbff;
}

.admin-shell .admin-user-name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-shell .admin-user-name strong {
  color: #101828;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-shell .admin-user-name small {
  color: #98a2b3;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.admin-shell .admin-user-power strong {
  color: #101828;
  font-weight: 700;
  margin-right: 4px;
}

.admin-shell .admin-user-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-shell .admin-user-row-actions .primary,
.admin-shell .admin-user-row-actions .secondary {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 650;
}

/* 用户状态徽章浅色版本 */
.admin-shell .user-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid transparent;
}

.admin-shell .user-status-active {
  background: #ecfdf3;
  border-color: #abefc6;
  color: #067647;
}

.admin-shell .user-status-disabled {
  background: #f2f4f7;
  border-color: #d0d5dd;
  color: #475467;
}

.admin-shell .user-status-expired {
  background: #fff1f3;
  border-color: #fecdd3;
  color: #be123c;
}

.admin-shell .user-status-frozen {
  background: #eff8ff;
  border-color: #b2ddff;
  color: #175cd3;
}

/* admin 模态 浅色覆盖（仅在 .admin-body 内生效，前台模态保持深色） */
.admin-body .modal-backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.admin-body .modal-dialog {
  border: 1px solid #dde4ef;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 36px 80px rgba(15, 23, 42, 0.22);
  color: #172033;
}

.admin-body .modal-head {
  padding: 16px 22px;
  border-bottom: 1px solid #edf1f7;
}

.admin-body .modal-head h3 {
  color: #101828;
  font-weight: 760;
  font-size: 17px;
}

.admin-body .modal-body {
  padding: 22px;
  color: #172033;
}

.admin-body .modal-footer {
  border-top: 1px solid #edf1f7;
  padding: 16px 22px 0;
}

.admin-body .modal-body .field span,
.admin-body .modal-body .check-field span {
  color: #344054;
}

.admin-body .modal-body input,
.admin-body .modal-body select,
.admin-body .modal-body textarea {
  background: #ffffff;
  border: 1px solid #d0d5dd;
  color: #172033;
}

.admin-body .modal-body input:focus,
.admin-body .modal-body select:focus,
.admin-body .modal-body textarea:focus {
  border-color: #84adff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #ffffff;
}

.admin-body .modal-body input::placeholder,
.admin-body .modal-body textarea::placeholder {
  color: #98a2b3;
}

.admin-body .modal-body input:disabled,
.admin-body .modal-body input[readonly] {
  background: #f2f4f7;
  color: #667085;
  cursor: not-allowed;
}

.admin-body .modal-body .recharge-user-summary {
  background: #eff6ff;
  border: 1px solid #b2ddff;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-body .modal-body .recharge-user-summary span {
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-body .modal-body .recharge-user-summary strong {
  color: #101828;
  font-size: 16px;
}

.admin-body .icon-button {
  background: #f2f4f7;
  border: 1px solid #d0d5dd;
  color: #475467;
}

.admin-body .icon-button:hover {
  background: #fee4e2;
  border-color: #fecdca;
  color: #b42318;
}

.admin-body .modal-footer .primary {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.18);
}

.admin-body .modal-footer .secondary {
  background: #ffffff;
  border: 1px solid #d0d5dd;
  color: #344054;
}

.admin-body .modal-footer .secondary:hover {
  background: #f8fafc;
  border-color: #98a2b3;
}

/* admin 面板 panel-head-actions 紧凑 */
.admin-shell .panel-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-shell .panel-head-actions .field.compact {
  margin: 0;
}

/* 防止 body 滚动当弹窗打开 */
body.admin-body.modal-open {
  overflow: hidden;
}

/* 窄屏：用户表格降级为卡片 */
@media (max-width: 1080px) {
  .admin-shell .admin-user-row,
  .admin-shell .admin-user-row-head {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    padding: 14px 16px;
  }

  .admin-shell .admin-user-row-head {
    display: none;
  }

  .admin-shell .admin-user-row:not(.admin-user-row-head) {
    position: relative;
    gap: 8px 16px;
  }

  .admin-shell .admin-user-row .admin-user-name {
    grid-column: 1 / -1;
  }

  .admin-shell .admin-user-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 6px;
    border-top: 1px dashed #edf1f7;
  }
}

/* =====================================================================
   v11 · 落地首页 / Landing Page
   作用：当 data-route-view="landing" 时占据整屏，呈现产品介绍。
   仅对用户前端生效（admin-body 由专属浅色样式接管）。
   ===================================================================== */

/* SSR fallback：根据 data-route-view 强制可见性，避免首屏闪烁默认工作台 */
html[data-route-view="landing"] body:not(.admin-body) #view-dashboard,
html[data-route-view="landing"] body:not(.admin-body) .view:not(#view-landing),
html[data-route-view="login"] body:not(.admin-body) #view-dashboard,
html[data-route-view="login"] body:not(.admin-body) .view:not(#view-login) {
  display: none !important;
}
html[data-route-view="landing"] body:not(.admin-body) #view-landing {
  display: block !important;
}
html[data-route-view="login"] body:not(.admin-body) #view-login {
  display: block !important;
}
html[data-route-view="landing"] body:not(.admin-body) .topbar,
html[data-route-view="landing"] body:not(.admin-body) #notice,
html[data-route-view="login"] body:not(.admin-body) .topbar,
html[data-route-view="login"] body:not(.admin-body) #notice,
html[data-route-view="login"] body:not(.admin-body) .site-nav {
  display: none !important;
}
html[data-route-view="landing"] body:not(.admin-body) .workspace,
html[data-route-view="login"] body:not(.admin-body) .workspace {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
html[data-route-view="login"] body:not(.admin-body) .app-shell {
  padding: 0 !important;
  background: transparent !important;
}

/* landing 主容器 */
body:not(.admin-body) #view-landing {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

body:not(.admin-body) .landing {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 24px 56px 80px;
  color: var(--ink);
  overflow: hidden;
}

/* 背景装饰：浮动光晕 + 极细网格 */
body:not(.admin-body) .landing-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body:not(.admin-body) .landing-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  animation: landingBlobFloat 14s ease-in-out infinite;
}

body:not(.admin-body) .landing-blob-a {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.7), transparent 70%);
}

body:not(.admin-body) .landing-blob-b {
  width: 580px;
  height: 580px;
  top: -80px;
  right: -180px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.65), transparent 70%);
  animation-delay: -5s;
}

body:not(.admin-body) .landing-blob-c {
  width: 640px;
  height: 640px;
  bottom: -240px;
  left: 30%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.45), transparent 70%);
  animation-delay: -9s;
}

@keyframes landingBlobFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(30px, -22px, 0) scale(1.08); }
}

body:not(.admin-body) .landing-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 75%);
}

/* eyebrow */
body:not(.admin-body) .landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c0d4f5;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

body:not(.admin-body) .landing-eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

/* Hero */
body:not(.admin-body) .landing-hero {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 80px 24px 120px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

body:not(.admin-body) .landing-title {
  margin: 0;
  font-size: clamp(38px, 5.4vw, 72px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #f4f8ff;
  text-shadow: 0 8px 60px rgba(34, 211, 238, 0.18);
}

body:not(.admin-body) .landing-title em {
  font-style: normal;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ffffff 0%, #b9c7ff 60%, #88f4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body:not(.admin-body) .landing-gradient {
  display: inline-block;
  background: linear-gradient(120deg, #22d3ee 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 18px rgba(139, 92, 246, 0.35));
}

body:not(.admin-body) .landing-subtitle {
  margin: 0;
  max-width: 720px;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.75;
  color: #b8c5db;
}

/* CTA */
body:not(.admin-body) .landing-cta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

body:not(.admin-body) .landing-cta-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-size: 15px;
  font-weight: 600;
  color: #04101f;
  background: linear-gradient(135deg, #6ff0ff 0%, #22d3ee 40%, #8b5cf6 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 36px rgba(34, 211, 238, 0.42), 0 4px 14px rgba(139, 92, 246, 0.36);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body:not(.admin-body) .landing-cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(34, 211, 238, 0.55), 0 8px 24px rgba(139, 92, 246, 0.46);
}

body:not(.admin-body) .landing-cta-primary svg {
  transition: transform 0.18s ease;
}

body:not(.admin-body) .landing-cta-primary:hover svg {
  transform: translateX(3px);
}

body:not(.admin-body) .landing-cta-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 500;
  color: #e7ecf3;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

body:not(.admin-body) .landing-cta-ghost:hover {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.45);
  transform: translateY(-1px);
}

/* Hero 数据条 */
body:not(.admin-body) .landing-hero-stats {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 920px;
}

body:not(.admin-body) .landing-hero-stats > div {
  padding: 20px 18px;
  background: rgba(12, 18, 36, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  text-align: center;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

body:not(.admin-body) .landing-hero-stats > div::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.5), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

body:not(.admin-body) .landing-hero-stats strong {
  display: block;
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6ff0ff, #c8b6ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body:not(.admin-body) .landing-hero-stats span {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: #97a4bb;
  letter-spacing: 0.04em;
}

/* 区块通用容器 */
body:not(.admin-body) .landing-section {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 80px 24px;
}

body:not(.admin-body) .landing-section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  margin-bottom: 48px;
}

body:not(.admin-body) .landing-section-head h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  color: #f4f8ff;
  letter-spacing: -0.01em;
}

body:not(.admin-body) .landing-section-head p {
  margin: 0;
  max-width: 680px;
  color: #9ba8c0;
  font-size: 15px;
  line-height: 1.7;
}

/* Feature 卡片 */
body:not(.admin-body) .landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

body:not(.admin-body) .landing-feature-card {
  position: relative;
  padding: 28px 26px 26px;
  background: linear-gradient(160deg, rgba(18, 24, 46, 0.85), rgba(8, 12, 28, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

body:not(.admin-body) .landing-feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 0%, var(--lf-glow, rgba(34, 211, 238, 0.18)), transparent 55%);
  opacity: 0.85;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

body:not(.admin-body) .landing-feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--lf-border, rgba(34, 211, 238, 0.45));
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--lf-border, rgba(34, 211, 238, 0.28));
}

body:not(.admin-body) .landing-feature-card:hover::before {
  opacity: 1;
}

body:not(.admin-body) .landing-feature-card[data-tone="cyan"]    { --lf-glow: rgba(34, 211, 238, 0.22); --lf-border: rgba(34, 211, 238, 0.45); --lf-text: #6ff0ff; }
body:not(.admin-body) .landing-feature-card[data-tone="violet"]  { --lf-glow: rgba(139, 92, 246, 0.24); --lf-border: rgba(139, 92, 246, 0.5);  --lf-text: #c4b5fd; }
body:not(.admin-body) .landing-feature-card[data-tone="emerald"] { --lf-glow: rgba(52, 211, 153, 0.22); --lf-border: rgba(52, 211, 153, 0.45); --lf-text: #6ee7b7; }
body:not(.admin-body) .landing-feature-card[data-tone="amber"]   { --lf-glow: rgba(245, 184, 91, 0.22); --lf-border: rgba(245, 184, 91, 0.5);  --lf-text: #fcd38b; }
body:not(.admin-body) .landing-feature-card[data-tone="rose"]    { --lf-glow: rgba(236, 72, 153, 0.22); --lf-border: rgba(236, 72, 153, 0.5);  --lf-text: #fda4af; }
body:not(.admin-body) .landing-feature-card[data-tone="sky"]     { --lf-glow: rgba(56, 189, 248, 0.22); --lf-border: rgba(56, 189, 248, 0.5);  --lf-text: #7dd3fc; }
body:not(.admin-body) .landing-feature-card[data-tone="lime"]    { --lf-glow: rgba(132, 204, 22, 0.22); --lf-border: rgba(132, 204, 22, 0.5);  --lf-text: #bef264; }
body:not(.admin-body) .landing-feature-card[data-tone="indigo"]  { --lf-glow: rgba(99, 102, 241, 0.25); --lf-border: rgba(99, 102, 241, 0.55); --lf-text: #a5b4fc; }
body:not(.admin-body) .landing-feature-card[data-tone="pink"]    { --lf-glow: rgba(244, 114, 182, 0.22); --lf-border: rgba(244, 114, 182, 0.5); --lf-text: #f9a8d4; }

body:not(.admin-body) .landing-feature-card > * {
  position: relative;
  z-index: 1;
}

body:not(.admin-body) .landing-feature-card .lf-num {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--lf-text, #6ff0ff);
  margin-bottom: 14px;
}

body:not(.admin-body) .landing-feature-card h3 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 600;
  color: #f4f8ff;
}

body:not(.admin-body) .landing-feature-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: #aab8d0;
}

body:not(.admin-body) .landing-feature-card .lf-tag {
  display: inline-block;
  margin-top: 18px;
  padding: 5px 12px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--lf-text, #6ff0ff);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

/* Workflow 流程 */
body:not(.admin-body) .landing-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  counter-reset: lflow;
  position: relative;
}

body:not(.admin-body) .landing-flow::before {
  content: "";
  position: absolute;
  top: 36px;
  left: 6%;
  right: 6%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.5), rgba(139, 92, 246, 0.5), rgba(236, 72, 153, 0.5), transparent);
  z-index: 0;
}

body:not(.admin-body) .landing-flow li {
  position: relative;
  padding: 18px 16px 22px;
  background: linear-gradient(160deg, rgba(18, 24, 46, 0.9), rgba(8, 12, 28, 0.75));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

body:not(.admin-body) .landing-flow li:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.4);
}

body:not(.admin-body) .landing-flow .lf-step {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #04101f;
  background: linear-gradient(135deg, #6ff0ff, #8b5cf6);
  box-shadow: 0 8px 22px rgba(34, 211, 238, 0.35);
  position: relative;
  z-index: 1;
}

body:not(.admin-body) .landing-flow h4 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #f4f8ff;
  font-weight: 600;
}

body:not(.admin-body) .landing-flow p {
  margin: 0;
  font-size: 12.5px;
  color: #92a0b8;
  line-height: 1.55;
}

/* Why 矩阵 */
body:not(.admin-body) .landing-why-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

body:not(.admin-body) .landing-why-grid article {
  position: relative;
  padding: 28px 22px 24px;
  background: rgba(12, 18, 36, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(8px);
}

body:not(.admin-body) .landing-why-grid .lw-mark {
  width: 28px;
  height: 28px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.35);
  position: relative;
}

body:not(.admin-body) .landing-why-grid .lw-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 4px;
  background: rgba(5, 8, 22, 0.7);
}

body:not(.admin-body) .landing-why-grid h4 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: #f4f8ff;
}

body:not(.admin-body) .landing-why-grid p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: #a3b1c8;
}

/* Final CTA */
body:not(.admin-body) .landing-final {
  padding-top: 40px;
  padding-bottom: 40px;
}

body:not(.admin-body) .landing-final-card {
  position: relative;
  padding: 60px 36px 56px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 0%, rgba(34, 211, 238, 0.18), transparent 55%),
    radial-gradient(circle at 80% 100%, rgba(139, 92, 246, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(18, 24, 46, 0.95), rgba(8, 12, 28, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

body:not(.admin-body) .landing-final-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  padding: 2px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.5), rgba(139, 92, 246, 0.45), rgba(236, 72, 153, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.55;
}

body:not(.admin-body) .landing-final-card h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.25;
  color: #f4f8ff;
}

body:not(.admin-body) .landing-final-card p {
  margin: 0;
  max-width: 540px;
  color: #b1bed5;
  font-size: 15px;
  line-height: 1.7;
}

body:not(.admin-body) .landing-foot {
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #7c8aa3;
  letter-spacing: 0.04em;
  flex-wrap: wrap;
  gap: 8px;
}

/* 响应式 */
@media (max-width: 1100px) {
  body:not(.admin-body) .landing { padding: 18px 28px 60px; }
  body:not(.admin-body) .landing-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body:not(.admin-body) .landing-why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body:not(.admin-body) .landing-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
  body:not(.admin-body) .landing-flow::before { display: none; }
}

@media (max-width: 720px) {
  body:not(.admin-body) .landing { padding: 12px 16px 60px; }
  body:not(.admin-body) .landing-hero { padding: 40px 8px 80px; gap: 22px; }
  body:not(.admin-body) .landing-section { padding: 56px 8px; }
  body:not(.admin-body) .landing-feature-grid { grid-template-columns: 1fr; }
  body:not(.admin-body) .landing-why-grid { grid-template-columns: 1fr; }
  body:not(.admin-body) .landing-flow {
    grid-template-columns: 1fr;
  }
  body:not(.admin-body) .landing-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body:not(.admin-body) .landing-final-card { padding: 42px 22px 40px; }
  body:not(.admin-body) .landing-foot { justify-content: center; text-align: center; }
}

/* =====================================================================
   v12 · 独立登录 / 注册页
   仅当 data-route-view="login" 时占据整屏；仍仅对用户前端生效。
   ===================================================================== */

body:not(.admin-body) #view-login {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

body:not(.admin-body) .login-page {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 32px;
  color: var(--ink);
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 18%, rgba(34, 211, 238, 0.22), transparent 40%),
    radial-gradient(circle at 85% 12%, rgba(139, 92, 246, 0.28), transparent 40%),
    radial-gradient(circle at 60% 100%, rgba(236, 72, 153, 0.22), transparent 45%),
    linear-gradient(180deg, #050816 0%, #060a1c 60%, #050816 100%);
}

body:not(.admin-body) .login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body:not(.admin-body) .login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.55;
  animation: loginBlobFloat 16s ease-in-out infinite;
}

body:not(.admin-body) .login-blob-a {
  width: 480px;
  height: 480px;
  top: -120px;
  left: -80px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.7), transparent 70%);
}

body:not(.admin-body) .login-blob-b {
  width: 520px;
  height: 520px;
  top: -100px;
  right: -120px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.7), transparent 70%);
  animation-delay: -6s;
}

body:not(.admin-body) .login-blob-c {
  width: 560px;
  height: 560px;
  bottom: -200px;
  left: 35%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.5), transparent 70%);
  animation-delay: -10s;
}

@keyframes loginBlobFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(28px, -22px, 0) scale(1.07); }
}

body:not(.admin-body) .login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 35%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 35%, transparent 75%);
}

/* 内容区两栏 */
body:not(.admin-body) .login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

/* 左侧品牌区 */
body:not(.admin-body) .login-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-right: 12px;
}

body:not(.admin-body) .login-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  width: fit-content;
}

body:not(.admin-body) .login-brand-mark {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: #04101f;
  background: linear-gradient(135deg, #6ff0ff, #8b5cf6);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(34, 211, 238, 0.35);
}

body:not(.admin-body) .login-brand h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f4f8ff;
}

body:not(.admin-body) .login-brand p {
  margin: 2px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: #7c8aa3;
}

body:not(.admin-body) .login-headline {
  margin: 16px 0 0;
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 700;
  line-height: 1.18;
  color: #f4f8ff;
  letter-spacing: -0.01em;
}

body:not(.admin-body) .login-headline span {
  background: linear-gradient(120deg, #22d3ee, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 16px rgba(139, 92, 246, 0.3));
}

body:not(.admin-body) .login-tagline {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: #b6c3da;
  max-width: 480px;
}

body:not(.admin-body) .login-bullets {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body:not(.admin-body) .login-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(12, 18, 36, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}

body:not(.admin-body) .login-bullets li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #04101f;
  background: linear-gradient(135deg, #6ff0ff, #c4b5fd);
  flex-shrink: 0;
}

body:not(.admin-body) .login-bullets li strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #eef3ff;
  margin-bottom: 2px;
}

body:not(.admin-body) .login-bullets li em {
  font-style: normal;
  display: block;
  font-size: 12.5px;
  color: #93a0b7;
  letter-spacing: 0.02em;
}

body:not(.admin-body) .login-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: #c0d0ea;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  width: fit-content;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

body:not(.admin-body) .login-back:hover {
  color: #fff;
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.4);
  transform: translateX(-2px);
}

/* 右侧表单卡片 */
body:not(.admin-body) .login-card {
  position: relative;
  padding: 36px 36px 32px;
  background: linear-gradient(160deg, rgba(20, 26, 50, 0.85), rgba(8, 12, 28, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(34, 211, 238, 0.06) inset;
  backdrop-filter: blur(18px);
  overflow: hidden;
}

body:not(.admin-body) .login-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: 25px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.5), rgba(139, 92, 246, 0.5) 55%, rgba(236, 72, 153, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

body:not(.admin-body) .login-card > * {
  position: relative;
  z-index: 1;
}

/* 顶部 tabs */
body:not(.admin-body) .login-tabs {
  position: relative;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(8, 12, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  margin-bottom: 24px;
}

body:not(.admin-body) .login-tab {
  position: relative;
  z-index: 1;
  padding: 9px 22px;
  font-size: 13.5px;
  font-weight: 500;
  color: #97a4bb;
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.22s ease;
}

body:not(.admin-body) .login-tab.active {
  color: #04101f;
}

body:not(.admin-body) .login-tab-indicator {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: linear-gradient(135deg, #6ff0ff, #c4b5fd);
  box-shadow: 0 6px 16px rgba(34, 211, 238, 0.35);
  transition: transform 0.28s cubic-bezier(0.4, 0.2, 0.2, 1);
}

body:not(.admin-body) .login-tab-indicator[data-active="register"] {
  transform: translateX(100%);
}

/* 表单 */
body:not(.admin-body) .login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

body:not(.admin-body) .login-form[hidden] {
  display: none;
}

body:not(.admin-body) .login-form-head h3 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  color: #f4f8ff;
}

body:not(.admin-body) .login-form-head p {
  margin: 0;
  font-size: 13.5px;
  color: #93a4bb;
}

body:not(.admin-body) .login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body:not(.admin-body) .login-field > span {
  font-size: 12.5px;
  color: #aab8d0;
  letter-spacing: 0.04em;
}

body:not(.admin-body) .login-field input {
  width: 100%;
  padding: 13px 16px;
  font-size: 14px;
  color: #f0f4ff;
  background: rgba(8, 12, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

body:not(.admin-body) .login-field input::placeholder {
  color: rgba(150, 165, 190, 0.55);
}

body:not(.admin-body) .login-field input:focus {
  border-color: rgba(34, 211, 238, 0.6);
  background: rgba(12, 18, 36, 0.85);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.15);
}

body:not(.admin-body) .login-submit {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  color: #04101f;
  background: linear-gradient(135deg, #6ff0ff 0%, #22d3ee 40%, #8b5cf6 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 16px 32px rgba(34, 211, 238, 0.35), 0 4px 12px rgba(139, 92, 246, 0.32);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body:not(.admin-body) .login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(34, 211, 238, 0.5), 0 8px 22px rgba(139, 92, 246, 0.45);
}

body:not(.admin-body) .login-submit svg {
  transition: transform 0.18s ease;
}

body:not(.admin-body) .login-submit:hover svg {
  transform: translateX(3px);
}

body:not(.admin-body) .login-switch {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: #93a4bb;
}

body:not(.admin-body) .login-switch a {
  color: #6ff0ff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.18s ease;
}

body:not(.admin-body) .login-switch a:hover {
  color: #c4b5fd;
}

/* 响应式 */
@media (max-width: 980px) {
  body:not(.admin-body) .login-wrap {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  body:not(.admin-body) .login-side {
    padding-right: 0;
    text-align: center;
    align-items: center;
  }
  body:not(.admin-body) .login-brand,
  body:not(.admin-body) .login-back {
    align-self: center;
  }
  body:not(.admin-body) .login-tagline,
  body:not(.admin-body) .login-bullets {
    text-align: left;
  }
  body:not(.admin-body) .login-bullets {
    width: 100%;
    max-width: 460px;
  }
}

@media (max-width: 560px) {
  body:not(.admin-body) .login-page { padding: 32px 16px; }
  body:not(.admin-body) .login-card { padding: 28px 22px 24px; }
  body:not(.admin-body) .login-tab { padding: 8px 18px; font-size: 13px; }
  body:not(.admin-body) .login-headline { font-size: 28px; }
}
