:root {
  color-scheme: dark;
  --bg: #0a0a0f;
  --bg-soft: #11131b;
  --panel: rgba(18, 21, 32, 0.78);
  --panel-strong: rgba(24, 28, 42, 0.92);
  --panel-muted: rgba(14, 17, 28, 0.72);
  --border: rgba(141, 155, 196, 0.16);
  --border-strong: rgba(143, 245, 255, 0.28);
  --text: #f5f7ff;
  --text-soft: #aeb8d3;
  --text-dim: #7c86a3;
  --primary: #8ff5ff;
  --primary-strong: #00deec;
  --secondary: #c47fff;
  --accent: #ffd86f;
  --danger: #ff7b8d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(143, 245, 255, 0.14), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(196, 127, 255, 0.16), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(0, 222, 236, 0.10), transparent 30%),
    linear-gradient(180deg, #0a0a0f 0%, #0b0d14 45%, #090a10 100%);
  color: var(--text);
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(10, 12, 20, 0.88);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(143, 245, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(143, 245, 255, 0.08);
}

textarea {
  min-height: 132px;
  resize: vertical;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  pointer-events: none;
  filter: blur(70px);
  opacity: 0.55;
  z-index: 0;
}

.ambient-a {
  width: 320px;
  height: 320px;
  background: rgba(143, 245, 255, 0.22);
  top: -80px;
  left: -70px;
}

.ambient-b {
  width: 380px;
  height: 380px;
  background: rgba(196, 127, 255, 0.20);
  top: 8%;
  right: -120px;
}

.ambient-c {
  width: 320px;
  height: 320px;
  background: rgba(255, 216, 111, 0.10);
  bottom: -120px;
  left: 25%;
}

.status-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  max-width: min(460px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(143, 245, 255, 0.24);
  border-radius: 16px;
  background: rgba(12, 15, 24, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 14px;
  pointer-events: none;
}

.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 700;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 13px;
}

.subtle-text {
  color: var(--text-dim);
  font-size: 13px;
}

.primary-btn,
.ghost-btn {
  border-radius: 14px;
  padding: 12px 16px;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #03252a;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 222, 236, 0.24);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 222, 236, 0.28);
}

.ghost-btn {
  background: rgba(20, 24, 38, 0.72);
  color: var(--text);
  border-color: var(--border);
}

.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 245, 255, 0.28);
  background: rgba(24, 28, 44, 0.9);
}

.compact-btn {
  width: auto;
  padding-inline: 14px;
}

.surface-card {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(24, 28, 42, 0.88), rgba(14, 16, 25, 0.88));
  backdrop-filter: blur(22px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.login-hero,
.login-panel {
  padding: 56px 64px;
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.login-hero h1 {
  margin: 0;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.94;
  letter-spacing: -0.04em;
  max-width: 620px;
}

.login-hero p {
  margin: 0;
  max-width: 620px;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1.8;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 860px;
}

.hero-metrics article {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(143, 245, 255, 0.12);
  background: rgba(15, 17, 27, 0.45);
  backdrop-filter: blur(14px);
}

.hero-metrics strong,
.hero-metrics span {
  display: block;
}

.hero-metrics strong {
  margin-bottom: 10px;
  font-size: 15px;
}

.hero-metrics span {
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 13px;
}

.login-panel {
  display: grid;
  place-items: center;
}

.login-card {
  width: min(480px, 100%);
  padding: 36px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(22, 26, 40, 0.92), rgba(12, 15, 24, 0.96));
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.login-card h2 {
  margin: 10px 0 12px;
  font-size: 34px;
}

.card-desc {
  margin: 0 0 24px;
  color: var(--text-soft);
  line-height: 1.75;
}

.login-card small {
  display: block;
  margin-top: 14px;
  color: var(--text-dim);
}

.login-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 14px 0 18px;
}

.session-note {
  color: var(--text-dim);
  font-size: 13px;
}

.system-badge,
.status-pill,
.model-chip,
.save-state {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.system-badge,
.save-state {
  color: var(--primary);
  background: rgba(143, 245, 255, 0.08);
  border: 1px solid rgba(143, 245, 255, 0.16);
}

.admin-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 26px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(11, 14, 22, 0.86);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(143, 245, 255, 0.18), rgba(196, 127, 255, 0.2));
  border: 1px solid rgba(143, 245, 255, 0.2);
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand span {
  color: var(--text-dim);
  margin-top: 4px;
  font-size: 13px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
}

.nav-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.nav-item.active-accent {
  background: rgba(143, 245, 255, 0.08);
  border-color: rgba(143, 245, 255, 0.18);
  color: var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-note {
  padding: 16px;
  border-radius: 18px;
  background: rgba(18, 22, 36, 0.84);
  border: 1px solid var(--border);
}

.sidebar-note span,
.sidebar-note strong {
  display: block;
}

.sidebar-note span {
  color: var(--text-dim);
  margin-bottom: 8px;
  font-size: 12px;
}

.workspace {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.workspace-view {
  min-height: 0;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.workspace-header h1 {
  margin: 8px 0 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

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

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(620px, 1.38fr);
  gap: 24px;
  min-height: 0;
}

.creature-list-mode {
  display: block;
}

.creature-list-mode .editor-panel {
  display: none;
}

.creature-list-mode .left-stack {
  display: block;
}

.creature-detail-mode {
  display: block;
}

.creature-detail-mode .left-stack {
  display: none;
}

.creature-detail-mode .editor-panel {
  max-width: 1160px;
  margin: 0 auto;
}

.left-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
}

.list-panel,
.ai-panel,
.editor-panel {
  padding: 22px;
}

.list-panel {
  min-height: 0;
}

.section-head,
.editor-top,
.history-head,
.media-intro {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.section-head h2,
.editor-top h2,
.media-intro h3 {
  margin: 8px 0 0;
}

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

.toolbar-grid {
  margin-top: 18px;
}

.editor-grid {
  margin-top: 22px;
}

.field-block {
  min-width: 0;
}

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

.toolbar-actions {
  display: flex;
  justify-content: flex-end;
  margin: 14px 0 10px;
}

.creature-list,
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.creature-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.creature-list-mode .creature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
  margin-top: 20px;
}

.creature-item,
.history-item,
.image-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(10, 13, 21, 0.7);
}

.creature-item {
  padding: 16px;
  min-height: 132px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.creature-item:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 245, 255, 0.2);
}

.creature-item.active {
  border-color: rgba(143, 245, 255, 0.38);
  background: rgba(143, 245, 255, 0.08);
}

.creature-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.creature-name {
  font-size: 16px;
  font-weight: 700;
}

.creature-meta {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.65;
}

.creature-list-mode .creature-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.creature-list-mode .creature-item.active {
  border-color: var(--border);
  background: rgba(10, 13, 21, 0.7);
}

.creature-list-mode .creature-item.active:hover,
.creature-list-mode .creature-item:hover {
  border-color: rgba(143, 245, 255, 0.34);
  background: rgba(143, 245, 255, 0.07);
}

.status-pill {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.status-pill.published {
  color: var(--primary);
  border-color: rgba(143, 245, 255, 0.2);
  background: rgba(143, 245, 255, 0.08);
}

.status-pill.draft {
  color: var(--accent);
  border-color: rgba(255, 216, 111, 0.2);
  background: rgba(255, 216, 111, 0.08);
}

.status-pill.empty {
  color: var(--text-dim);
}

.model-chip {
  color: var(--secondary);
  background: rgba(196, 127, 255, 0.1);
  border: 1px solid rgba(196, 127, 255, 0.16);
}

.prompt-input {
  min-height: 180px;
}

.ai-actions {
  margin-top: 14px;
}

.history-head {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.history-item {
  padding: 14px 16px;
}

.history-item strong,
.history-item span,
.history-item small {
  display: block;
}

.history-item strong {
  margin-bottom: 6px;
}

.history-item span {
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 13px;
}

.history-item small {
  margin-top: 8px;
  color: var(--text-dim);
}

.history-item.success {
  border-color: rgba(143, 245, 255, 0.16);
}

.history-item.failed {
  border-color: rgba(255, 123, 141, 0.25);
}

.history-item.running {
  border-color: rgba(196, 127, 255, 0.25);
}

.editor-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.tab-bar {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
  width: auto;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  background: transparent;
  color: var(--text-dim);
}

.tab-btn.active {
  color: var(--primary);
  background: rgba(143, 245, 255, 0.08);
  border-color: rgba(143, 245, 255, 0.16);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.media-intro {
  margin-top: 22px;
}

.media-intro p {
  margin: 0;
  max-width: 420px;
  color: var(--text-soft);
  line-height: 1.7;
}

.media-add {
  display: grid;
  grid-template-columns: auto;
  justify-content: start;
  gap: 12px;
  margin-top: 18px;
}

.style-image-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(143, 245, 255, 0.12);
  border-radius: 22px;
  background: rgba(10, 13, 21, 0.55);
}

.embedded-ai-panel {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(196, 127, 255, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(143, 245, 255, 0.08), rgba(196, 127, 255, 0.08)),
    rgba(10, 13, 21, 0.66);
}

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

.embedded-ai-head h3 {
  margin: 8px 0 0;
}

.mock-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--secondary);
  border: 1px solid rgba(196, 127, 255, 0.24);
  background: rgba(196, 127, 255, 0.10);
  font-size: 12px;
  font-weight: 700;
}

.ai-mode-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

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

.compact-textarea {
  min-height: 104px;
}

.ai-field-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.field-chip {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(10, 13, 21, 0.8);
  color: var(--text-soft);
}

.field-chip.active {
  color: var(--primary);
  border-color: rgba(143, 245, 255, 0.24);
  background: rgba(143, 245, 255, 0.09);
}

.ai-inline-field {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 10, 18, 0.78);
}

.ai-inline-field strong,
.ai-inline-field p,
.ai-inline-field .ai-suggestion-text {
  display: block;
}

.ai-inline-field p {
  margin: 8px 0 0;
  color: var(--text-dim);
  line-height: 1.65;
  font-size: 13px;
}

.ai-suggestion-card {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(143, 245, 255, 0.14);
  border-left: 3px solid var(--primary);
  background: rgba(143, 245, 255, 0.08);
}

.ai-suggestion-slot:empty {
  display: none;
}

.ai-suggestion-text {
  color: #bffaff;
  line-height: 1.65;
  font-size: 13px;
}

.ai-suggestion-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(143, 245, 255, 0.10);
  font-size: 12px;
  font-weight: 700;
}

.ai-suggestion-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.ai-suggestion-actions .ghost-btn {
  min-height: 34px;
  padding: 8px 12px;
}

.ai-suggestion-card.applied {
  border-color: rgba(97, 226, 167, 0.20);
  border-left-color: #61e2a7;
  background: rgba(97, 226, 167, 0.08);
}

.ai-suggestion-card.applied .ai-suggestion-status {
  color: #bdf8d8;
  background: rgba(97, 226, 167, 0.12);
}

.ai-suggestion-card.ignored {
  border-color: rgba(255, 216, 111, 0.18);
  border-left-color: var(--accent);
  background: rgba(255, 216, 111, 0.06);
}

.ai-suggestion-card.ignored .ai-suggestion-status {
  color: var(--accent);
  background: rgba(255, 216, 111, 0.10);
}

.ai-suggestion-card.stale {
  border-color: rgba(255, 123, 141, 0.18);
  border-left-color: var(--danger);
  background: rgba(255, 123, 141, 0.06);
}

.ai-suggestion-card.stale .ai-suggestion-status {
  color: #ffc5ce;
  background: rgba(255, 123, 141, 0.10);
}

.mock-suggestion {
  margin-top: 10px;
}

.mock-suggestion.muted {
  display: none;
}

.ai-region-inline {
  align-self: stretch;
}

.embedded-ai-actions {
  gap: 10px;
}

.region-ai-mock {
  margin-top: 18px;
}

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

.info-box,
.prompt-preview {
  margin: 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 10, 18, 0.88);
  color: var(--text-soft);
}

.info-box {
  min-height: 48px;
  padding: 12px 14px;
  line-height: 1.7;
  font-size: 13px;
}

.prompt-preview {
  min-height: 180px;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.75;
  font-size: 13px;
  overflow: auto;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.image-card {
  padding: 14px;
}

.image-preview {
  height: 140px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background:
    linear-gradient(180deg, rgba(143, 245, 255, 0.08), rgba(196, 127, 255, 0.04)),
    rgba(10, 13, 21, 0.92);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  text-align: center;
  padding: 12px;
  line-height: 1.6;
  font-size: 12px;
}

.image-card strong,
.image-card small {
  display: block;
}

.image-card strong {
  margin-top: 12px;
  font-size: 14px;
}

.image-slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(143, 245, 255, 0.16);
  background: rgba(143, 245, 255, 0.08);
  color: var(--primary);
  font-size: 12px;
}

.image-card small {
  margin-top: 6px;
  color: var(--text-dim);
  line-height: 1.5;
  word-break: break-all;
}

.image-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.image-actions button {
  width: auto;
  flex: 1;
}

.image-actions .danger-btn {
  color: #ffc5ce;
  border-color: rgba(255, 123, 141, 0.24);
}

.empty-state {
  padding: 22px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.7;
}

.region-manager {
  padding: 22px;
}

.region-form-grid {
  margin-top: 20px;
}

.region-actions {
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.region-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.region-ai-references {
  margin-top: 4px;
  line-height: 1.7;
}

.region-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(10, 13, 21, 0.7);
  padding: 16px;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.region-card:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 245, 255, 0.26);
}

.region-card.active {
  border-color: rgba(143, 245, 255, 0.32);
  background: rgba(143, 245, 255, 0.08);
}

.region-card strong,
.region-card small,
.region-card span {
  display: block;
}

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

.region-card small {
  margin-top: 8px;
  color: var(--primary);
}

.region-card span {
  margin-top: 10px;
  color: var(--text-dim);
  line-height: 1.7;
  white-space: pre-line;
}

.ai-studio-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ai-studio-intro,
.ai-studio-card {
  padding: 22px;
}

.mode-switch {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-bottom: 6px;
}

.mode-switch .tab-btn {
  width: auto;
}

.ai-studio-grid {
  margin-top: 8px;
}

.preview-pane {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(10, 13, 21, 0.62);
}

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

.preview-block {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 10, 17, 0.9);
  color: var(--text-soft);
  line-height: 1.75;
  white-space: pre-wrap;
}

.preview-block-accent {
  border-color: rgba(143, 245, 255, 0.2);
  background: rgba(143, 245, 255, 0.05);
}

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

.preview-label {
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.field-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(10, 13, 21, 0.74);
}

.field-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.field-preview-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.field-preview-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(10, 13, 21, 0.74);
  padding: 14px 16px;
}

.field-preview-card.active {
  border-color: rgba(143, 245, 255, 0.26);
}

.field-preview-card strong,
.field-preview-card small,
.field-preview-card span {
  display: block;
}

.field-preview-card small {
  margin-top: 6px;
  color: var(--text-dim);
}

.field-preview-card .preview-inline {
  margin-top: 10px;
  color: var(--text-soft);
  white-space: pre-wrap;
  line-height: 1.7;
}

.preview-block mark,
.field-preview-card mark {
  padding: 0 2px;
  border-radius: 6px;
}

.diff-added {
  background: rgba(97, 226, 167, 0.22);
  color: #dfffee;
}

.diff-removed {
  background: rgba(255, 164, 164, 0.18);
  color: #ffe1e1;
}

.field-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

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

  .editor-meta {
    align-items: flex-start;
  }
}

@media (max-width: 1080px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-hero {
    padding-bottom: 0;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
}

@media (max-width: 780px) {
  .login-hero,
  .login-panel,
  .workspace {
    padding: 24px;
  }

  .workspace-header,
  .section-head,
  .editor-top,
  .media-intro,
  .history-head,
  .login-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-grid,
  .editor-grid,
  .embedded-ai-grid,
  .media-add,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .header-actions {
    justify-content: flex-start;
  }
}
