:root {
  --ink: #08111f;
  --ink-2: #111827;
  --ink-3: #1d2939;
  --ivory: #f7f2e8;
  --paper: #fbf8f1;
  --muted: #756d62;
  --line: #d8d0c2;
  --line-dark: rgba(247, 242, 232, 0.18);
  --gold: #c6a15b;
  --gold-dark: #98743a;
  --jade: #236b63;
  --jade-soft: #e4f0ed;
  --shadow: 0 24px 70px rgba(8, 17, 31, 0.16);
  --radius: 8px;
  --max: 1200px;
}

/* Phase 1 UI refresh: shared visual system and core workbench polish. */
:root {
  --ink: #0c1720;
  --ink-2: #14212b;
  --ink-3: #2b3b45;
  --ivory: #f7faf8;
  --paper: #ffffff;
  --muted: #65736f;
  --line: #dbe3e0;
  --line-dark: rgba(247, 250, 248, 0.16);
  --gold: #d4a247;
  --gold-dark: #8c6417;
  --jade: #0f766e;
  --jade-soft: #e7f4f1;
  --info: #2d628f;
  --info-soft: #eaf2f8;
  --danger: #a53a2e;
  --danger-soft: #fff1ef;
  --shadow: 0 18px 48px rgba(12, 23, 32, 0.1);
  --shadow-soft: 0 8px 24px rgba(12, 23, 32, 0.07);
  --radius: 8px;
  --max: 1200px;
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7faf8 0%, #eef3f1 46%, #f7f5ee 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

.site-header,
.studio-topbar {
  border-bottom-color: rgba(219, 227, 224, 0.92);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 28px rgba(12, 23, 32, 0.05);
}

.brand {
  min-width: 0;
}

.brand-mark {
  color: #14212b;
  border-color: rgba(212, 162, 71, 0.58);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 42%),
    linear-gradient(135deg, #f4d27d, var(--gold));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 8px 18px rgba(141, 101, 25, 0.16);
}

.brand strong {
  color: var(--ink);
  font-weight: 850;
}

.brand small,
.top-nav,
.workspace-header .eyebrow,
.result-panel .eyebrow {
  color: var(--muted);
}

.top-nav a {
  position: relative;
  padding: 8px 0;
}

.top-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--jade);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}

.top-nav a:hover::after {
  transform: scaleX(1);
}

.btn,
.user-badge,
.tab,
.studio-section-link,
.side-link,
.text-link,
.dashboard-tool-card,
.history-item,
.run-record-item,
.image-history-card {
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.btn {
  min-height: 42px;
  gap: 8px;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: none;
}

.btn:hover,
.user-badge:hover,
.tab:hover,
.studio-section-link:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: #111827;
  border-color: rgba(212, 162, 71, 0.76);
  background: linear-gradient(135deg, #f5d889, var(--gold));
  box-shadow: 0 12px 24px rgba(148, 106, 24, 0.18);
}

.btn-primary:hover {
  border-color: rgba(140, 100, 23, 0.6);
  box-shadow: 0 16px 30px rgba(148, 106, 24, 0.22);
}

.btn-secondary,
.user-badge,
.tab,
.studio-section-link {
  color: var(--ink);
  border-color: rgba(219, 227, 224, 0.96);
  background: rgba(255, 255, 255, 0.78);
}

.btn-secondary:hover,
.user-badge:hover {
  border-color: rgba(15, 118, 110, 0.28);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  color: var(--ivory);
  border-color: rgba(247, 250, 248, 0.18);
  background: rgba(247, 250, 248, 0.08);
}

.site-header .btn-ghost {
  color: #ffffff;
  border-color: var(--ink);
  background: linear-gradient(135deg, var(--ink), #243641);
}

#runWorkflowButton {
  min-height: 44px;
  margin-top: 4px;
}

#runWorkflowButton[data-state="running"] {
  color: var(--ink);
  border-color: rgba(15, 118, 110, 0.34);
  background: linear-gradient(135deg, #dff1ee, #f1d38c);
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.14);
}

.studio-view {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 240px),
    #eef3f1;
}

.studio-topbar {
  min-height: 70px;
  padding: 12px 28px;
}

.studio-section-nav {
  gap: 4px;
  padding: 4px;
  border-color: rgba(219, 227, 224, 0.95);
  border-radius: var(--radius);
  background: rgba(242, 246, 244, 0.86);
}

.studio-section-link {
  min-height: 36px;
  padding: 0 16px;
  color: var(--muted);
  font-weight: 800;
}

.studio-section-link.active,
.tab.active {
  color: var(--jade);
  border-color: rgba(15, 118, 110, 0.28);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.studio-body {
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: calc(100vh - 70px);
}

.sidebar {
  top: 70px;
  height: calc(100vh - 70px);
  padding: 22px 18px;
  color: #f7faf8;
  border-right: 1px solid rgba(247, 250, 248, 0.08);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.16), rgba(212, 162, 71, 0.08) 42%, rgba(0, 0, 0, 0) 74%),
    #111820;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar-panel-title {
  gap: 6px;
  margin-bottom: 24px;
  padding: 0 6px 18px;
  border-bottom-color: rgba(247, 250, 248, 0.12);
}

.sidebar-panel-title strong {
  color: #ffffff;
  font-weight: 900;
}

.sidebar-panel-title small,
.side-link,
.sidebar-note p {
  color: rgba(247, 250, 248, 0.68);
}

.side-nav {
  gap: 22px;
}

.side-group {
  gap: 6px;
}

.side-group-title {
  margin: 0 0 6px;
  padding: 0 8px;
  color: rgba(247, 250, 248, 0.5);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.side-link {
  min-height: 42px;
  padding: 0 12px;
  border-color: transparent;
  font-weight: 760;
}

.side-link:hover {
  color: #ffffff;
  background: rgba(247, 250, 248, 0.08);
}

.side-link.active {
  color: #ffffff;
  border-color: rgba(247, 250, 248, 0.14);
  background: rgba(247, 250, 248, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.side-link.active::before {
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--jade));
}

.side-link.utility {
  color: rgba(247, 250, 248, 0.82);
  border-color: rgba(247, 250, 248, 0.14);
  background: rgba(247, 250, 248, 0.04);
}

.sidebar-actions {
  border-top-color: rgba(247, 250, 248, 0.12);
}

.sidebar-note {
  padding: 14px;
  border-color: rgba(247, 250, 248, 0.12);
  background: rgba(247, 250, 248, 0.06);
}

.workspace {
  padding: 30px;
}

.workspace-header {
  align-items: center;
  width: min(100%, 1220px);
  margin-bottom: 22px;
}

.workspace-header h1 {
  color: var(--ink);
  font-size: 34px;
  font-weight: 900;
  line-height: 42px;
}

.user-cluster {
  gap: 8px;
}

.chip,
.user-badge,
.body-word-count,
.history-meta-row span,
.favorite-pill,
.retention-pill,
.history-revision-pill,
.history-content-pill,
.history-feedback-pill {
  border-radius: 999px;
}

.chip,
.user-badge {
  min-height: 34px;
  font-weight: 750;
  background: rgba(255, 255, 255, 0.72);
}

.chip.jade {
  color: var(--jade);
  border-color: rgba(15, 118, 110, 0.2);
  background: var(--jade-soft);
}

.workspace-grid {
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 18px;
  width: min(100%, 1220px);
}

.tool-card,
.form-card,
.result-card,
.login-card,
.dashboard-hero,
.dashboard-recent,
.dashboard-running,
.history-item,
.history-detail-card,
.run-record-item,
.tool-config-card,
.knowledge-upload-card,
.knowledge-list-card,
.knowledge-detail-card,
.account-settings-card,
.user-management-card,
.image-policy-card,
.image-asset-card,
.image-usage-card,
.run-status-card,
.feedback-card,
.moments-agent-card,
.shortvideo-visual-panel,
.wechat-linked-images,
.ocr-quality-card,
.ocr-preview-card,
.ocr-trace-card {
  border-color: rgba(219, 227, 224, 0.95);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.form-card,
.result-card {
  padding: 24px;
}

.form-card {
  align-self: start;
}

.result-card {
  min-width: 0;
}

.card-heading {
  margin-bottom: 22px;
}

.card-heading h2,
.history-header h2,
.dashboard-hero h2 {
  color: var(--ink);
  font-weight: 900;
}

.card-heading span,
.dashboard-card-icon,
.body-word-count {
  color: var(--gold-dark);
  border-color: rgba(212, 162, 71, 0.34);
  background: rgba(255, 248, 232, 0.84);
}

label {
  gap: 8px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 820;
}

input,
select,
textarea {
  color: var(--ink);
  border-color: rgba(200, 211, 207, 0.96);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 2px rgba(12, 23, 32, 0.03);
}

input::placeholder,
textarea::placeholder {
  color: #7d8b87;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 94px;
  padding: 12px 13px;
  line-height: 23px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(15, 118, 110, 0.28);
}

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

.field-grid {
  gap: 0 14px;
}

.file-input-panel,
.uw-appeal-helper,
.uw-privacy-note,
.uw-sop-card {
  border-color: rgba(200, 211, 207, 0.95);
  background: rgba(247, 250, 248, 0.76);
}

.file-input-panel input[type="file"] {
  background: #ffffff;
}

.switch-row {
  align-items: center;
  padding: 8px 0;
}

.switch-row input {
  accent-color: var(--jade);
}

.tabs {
  gap: 6px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid rgba(219, 227, 224, 0.96);
  border-radius: var(--radius);
  background: rgba(242, 246, 244, 0.82);
}

.tab {
  min-height: 36px;
  padding: 0 14px;
  font-weight: 850;
}

.result-panel {
  color: var(--ink-3);
}

.result-panel h2 {
  color: var(--ink);
  font-weight: 900;
}

.result-panel h3 {
  color: var(--ink);
}

.result-body,
.result-table-wrap,
.submitted-input-card,
.history-detail-grid div,
.revision-compare-panel {
  border-color: rgba(219, 227, 224, 0.95);
  background: rgba(247, 250, 248, 0.8);
}

.result-body {
  max-width: none;
  padding: 18px;
  line-height: 25px;
}

.wechat-result-body {
  padding: 22px;
  color: var(--ink);
  line-height: 1.86;
}

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

.wechat-result-heading {
  margin: 22px 0 12px;
  color: var(--ink);
  font-weight: 900;
}

.wechat-result-heading:first-child {
  margin-top: 0;
}

.wechat-result-body h3.wechat-result-heading {
  font-size: 20px;
  line-height: 30px;
}

.wechat-result-body h4.wechat-result-heading {
  font-size: 16px;
  line-height: 26px;
}

.wechat-result-body strong {
  color: #6f3a20;
  font-weight: 900;
}

.wechat-result-space {
  height: 14px;
}

.wechat-result-callout,
.wechat-result-emphasis {
  margin: 14px 0;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 28px;
  border-left: 4px solid rgba(198, 151, 73, 0.84);
  background: rgba(255, 248, 232, 0.68);
}

.wechat-result-listline {
  position: relative;
  padding-left: 18px;
}

.wechat-result-listline::before {
  position: absolute;
  left: 2px;
  color: var(--gold-dark);
  content: "•";
}

.copy-actions,
.shortvideo-next-actions,
.shortvideo-image-actions,
.wechat-image-actions,
.run-status-actions {
  gap: 9px;
}

.login-error {
  color: var(--danger);
}

.login-error[data-state="success"] {
  color: var(--jade);
}

.dashboard-panel {
  gap: 22px;
}

.dashboard-hero {
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(231, 244, 241, 0.92), rgba(255, 248, 232, 0.72)),
    #ffffff;
}

.dashboard-hero h2 {
  font-size: 30px;
  line-height: 38px;
}

.dashboard-card-meta span {
  color: var(--jade);
  border-color: rgba(15, 118, 110, 0.18);
  background: rgba(231, 244, 241, 0.84);
  font-weight: 780;
}

.dashboard-tool-grid {
  gap: 14px;
}

.dashboard-tool-card {
  min-height: 156px;
  padding: 18px;
  border-color: rgba(219, 227, 224, 0.95);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
}

.dashboard-tool-card:hover {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: var(--shadow);
}

.dashboard-tool-card.primary {
  border-color: rgba(212, 162, 71, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 248, 232, 0.92), rgba(255, 255, 255, 0.86));
}

.dashboard-tool-card strong {
  color: var(--ink);
  font-weight: 900;
}

.dashboard-tool-card small,
.dashboard-recent-item span,
.dashboard-running-item span,
.dashboard-running-item small,
.history-meta,
.history-empty-note {
  color: var(--muted);
}

.dashboard-recent,
.dashboard-running {
  padding: 20px;
}

.dashboard-recent-item,
.dashboard-running-item,
.history-item,
.run-record-item,
.audit-log-item,
.knowledge-source-item,
.backup-item,
.image-history-card {
  border-color: rgba(219, 227, 224, 0.92);
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-recent-item:hover,
.history-item:hover,
.run-record-item:hover,
.audit-log-item:hover,
.knowledge-source-item:hover {
  border-color: rgba(15, 118, 110, 0.24);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.history-filter-bar,
.audit-log-filters,
.history-bulk-bar {
  border-color: rgba(219, 227, 224, 0.95);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.history-item.selected {
  border-color: rgba(212, 162, 71, 0.52);
  background: rgba(255, 248, 232, 0.78);
}

.history-detail-layout {
  gap: 18px;
}

.history-detail-card {
  padding: 18px;
}

.history-detail-collapsible {
  padding: 0;
}

.history-detail-collapsible summary {
  min-height: 58px;
}

.favorite-pill.active,
.retention-pill.favorite,
.history-revision-pill.active,
.history-feedback-pill {
  color: var(--gold-dark);
  border-color: rgba(212, 162, 71, 0.38) !important;
  background: rgba(255, 248, 232, 0.88) !important;
}

.history-revision-pill,
.history-content-pill {
  color: var(--info);
  border-color: rgba(45, 98, 143, 0.22) !important;
  background: var(--info-soft) !important;
}

.retention-pill.expired,
.btn.danger {
  color: var(--danger);
  border-color: rgba(165, 58, 46, 0.24);
  background: var(--danger-soft);
}

.login-dialog {
  border-radius: var(--radius);
}

.login-dialog::backdrop {
  background: rgba(12, 23, 32, 0.68);
}

.login-card {
  padding: 34px;
  border-top: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(12, 23, 32, 0.24);
}

.dialog-close {
  border-color: rgba(219, 227, 224, 0.95);
  background: #ffffff;
}

.image-chat-modal {
  border-color: rgba(219, 227, 224, 0.92);
  background: #ffffff;
  box-shadow: 0 28px 90px rgba(12, 23, 32, 0.28);
}

.image-chat-header,
.image-chat-tabs,
.image-chat-console {
  background: rgba(255, 255, 255, 0.94);
}

@media (max-width: 1180px) {
  .workspace-grid {
    grid-template-columns: minmax(330px, 400px) minmax(0, 1fr);
  }

  .dashboard-tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .site-header {
    width: 100%;
  }

  .studio-body,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .studio-topbar {
    position: sticky;
    align-items: center;
    flex-direction: row;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .side-nav {
    gap: 14px;
  }

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

  .side-group-title {
    grid-column: 1 / -1;
  }

  .workspace {
    padding: 24px 18px;
  }

  .workspace-header {
    display: grid;
  }

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

@media (max-width: 640px) {
  .studio-topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .studio-section-nav,
  .tabs {
    width: 100%;
  }

  .studio-section-link,
  .tab {
    flex: 1;
  }

  .workspace-header h1 {
    font-size: 28px;
    line-height: 36px;
  }

  .user-cluster {
    justify-content: flex-start;
  }

  .side-group,
  .portal-grid,
  .dashboard-tool-grid,
  .history-detail-grid {
    grid-template-columns: 1fr;
  }

  .form-card,
  .result-card,
  .dashboard-hero,
  .dashboard-recent,
  .dashboard-running,
  .login-card {
    padding: 18px;
  }

  .dashboard-hero,
  .dashboard-running-item,
  .dashboard-recent-item,
  .history-item-head {
    display: grid;
  }

  .history-item-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .history-item-head .favorite-pill {
    grid-column: 1 / -1;
    width: fit-content;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.form-trap {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--ivory);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

html.route-workbench-boot .site-header,
html.route-workbench-boot #publicView {
  display: none !important;
}

#home,
#tools,
#profile {
  scroll-margin-top: 112px;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 80px;
  margin: 0;
  padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  color: var(--ink);
  border-bottom: 1px solid rgba(216, 208, 194, 0.78);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
  font-weight: 800;
  border: 1px solid rgba(198, 161, 91, 0.62);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f4d994, var(--gold));
}

.brand strong {
  display: block;
  font-size: 16px;
  line-height: 22px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.top-nav {
  display: flex;
  gap: 24px;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 700;
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-actions .btn {
  white-space: nowrap;
}

.site-actions .btn-secondary.light {
  color: var(--ink);
  border-color: rgba(198, 161, 91, 0.48);
  background: rgba(255, 248, 232, 0.86);
}

.site-header .btn-ghost {
  color: var(--ivory);
  border-color: var(--ink);
  background: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

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

.btn:disabled {
  cursor: progress;
  opacity: 0.68;
  transform: none;
}

.btn-primary {
  color: var(--ink);
  border-color: rgba(198, 161, 91, 0.7);
  background: linear-gradient(135deg, #ead097, var(--gold));
  box-shadow: 0 10px 24px rgba(198, 161, 91, 0.26);
}

#runWorkflowButton[data-state="running"] {
  border-color: rgba(35, 107, 99, 0.38);
  background: linear-gradient(135deg, rgba(228, 240, 237, 0.96), rgba(198, 161, 91, 0.64));
  box-shadow: none;
}

.btn-ghost {
  color: var(--ivory);
  border-color: var(--line-dark);
  background: rgba(247, 242, 232, 0.06);
}

.btn-ghost.light {
  color: var(--ivory);
}

.btn-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.62);
}

.full {
  width: 100%;
}

.hero-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  min-height: calc(100vh - 80px);
  padding: 96px max(24px, calc((100vw - var(--max)) / 2)) 64px;
  overflow: hidden;
  color: var(--ink);
  background: #eee6d8;
}

.hero-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-ink-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.01);
  filter: saturate(0.96) contrast(1.03);
}

.hero-background::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(246, 241, 231, 0.82) 0%, rgba(246, 241, 231, 0.68) 30%, rgba(246, 241, 231, 0.18) 62%, rgba(8, 17, 31, 0.12) 100%),
    linear-gradient(180deg, rgba(246, 241, 231, 0.1), rgba(246, 241, 231, 0.4) 82%, rgba(246, 241, 231, 0.68));
}

.hero-background::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -12% -8%;
  opacity: 0.24;
  background:
    radial-gradient(ellipse at 72% 30%, rgba(8, 17, 31, 0.3), transparent 34%),
    radial-gradient(ellipse at 58% 74%, rgba(35, 107, 99, 0.18), transparent 31%);
  filter: blur(22px);
  transform: translate3d(-2%, 0, 0) scale(1.04);
}

.ink-motion-layer,
.water-ripple-layer,
.harbour-glow {
  display: none;
}

.hero-copy,
.hero-panel {
  position: relative;
  z-index: 1;
}

.hero-copy {
  align-self: center;
  justify-self: start;
  width: min(860px, 100%);
  max-width: 860px;
  text-align: left;
}

.eyebrow {
  margin: 0 0 12px;
  color: rgba(234, 208, 151, 0.9);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--gold-dark);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-copy h1 {
  max-width: 860px;
  margin-bottom: 24px;
  font-size: 52px;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 780px;
  margin: 0 0 28px;
  color: rgba(8, 17, 31, 0.72);
  font-size: 18px;
  line-height: 30px;
}

.profile-details {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  max-width: 610px;
  margin: 0;
  padding: 16px;
  color: rgba(8, 17, 31, 0.76);
  text-align: left;
  border: 1px solid rgba(198, 161, 91, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(115deg, rgba(246, 241, 231, 0.32), rgba(255, 255, 255, 0.16)),
    rgba(246, 241, 231, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    0 14px 36px rgba(8, 17, 31, 0.035);
  backdrop-filter: blur(6px);
}

.profile-details-body {
  order: 2;
  padding: 0;
}

.profile-kicker {
  margin-bottom: 8px;
  color: rgba(151, 111, 43, 0.68);
  font-size: 12px;
  font-weight: 850;
  line-height: 18px;
  text-transform: uppercase;
}

.profile-details-body h2 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 30px;
}

.profile-details-body p {
  margin-bottom: 0;
  color: rgba(50, 60, 64, 0.74);
  font-size: 15px;
  line-height: 25px;
}

.profile-photo-frame {
  position: relative;
  order: 1;
  align-self: end;
  width: 78px;
  min-height: 112px;
  overflow: hidden;
  border: 1px solid rgba(198, 161, 91, 0.16);
  border-radius: 6px;
  background:
    linear-gradient(145deg, rgba(246, 241, 231, 0.16), rgba(255, 255, 255, 0.22)),
    radial-gradient(circle at 62% 28%, rgba(8, 17, 31, 0.08), transparent 34%),
    radial-gradient(circle at 35% 74%, rgba(198, 161, 91, 0.1), transparent 42%);
  opacity: 0.58;
}

.profile-photo-frame::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(8, 17, 31, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(246, 241, 231, 0.04)),
    radial-gradient(ellipse at 50% 34%, rgba(8, 17, 31, 0.08), transparent 32%),
    radial-gradient(ellipse at 50% 88%, rgba(8, 17, 31, 0.07), transparent 28%);
}

.profile-photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 34%, rgba(8, 17, 31, 0.05)),
    repeating-linear-gradient(0deg, rgba(8, 17, 31, 0.025) 0 1px, transparent 1px 7px);
  mix-blend-mode: soft-light;
}

@keyframes inkDrift {
  from {
    transform: translate3d(-2%, 0, 0) scale(1.04);
  }
  to {
    transform: translate3d(2%, -2%, 0) scale(1.08);
  }
}

@keyframes heroInkFloat {
  from {
    transform: translate3d(-0.4%, 0, 0) scale(1.018);
  }
  to {
    transform: translate3d(0.6%, -0.5%, 0) scale(1.034);
  }
}

@keyframes inkWash {
  from {
    transform: translateX(-6%);
    opacity: 0.2;
  }
  to {
    transform: translateX(6%);
    opacity: 0.32;
  }
}

@keyframes waterRipple {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 80px 18px, -60px 34px;
  }
}

@keyframes harbourPulse {
  from {
    opacity: 0.66;
  }
  to {
    opacity: 0.92;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ink-image,
  .hero-background::after,
  .ink-motion-layer,
  .water-ripple-layer,
  .harbour-glow {
    animation: none;
  }
}

.hero-panel {
  justify-self: center;
  width: min(100%, 640px);
  padding: 24px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: rgba(8, 17, 31, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.market-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-dark);
}

.market-row span {
  color: rgba(247, 242, 232, 0.7);
}

.market-row strong {
  color: var(--gold);
  font-size: 24px;
  line-height: 32px;
}

.hero-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.hero-metric-grid div {
  padding: 16px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
}

.hero-metric-grid span {
  display: block;
  color: rgba(247, 242, 232, 0.66);
  font-size: 12px;
  line-height: 18px;
}

.hero-metric-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 32px;
}

.signal-card,
.sidebar-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: rgba(247, 242, 232, 0.78);
  font-size: 14px;
  line-height: 22px;
}

.signal-card p,
.sidebar-note p {
  margin: 0;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 4px rgba(35, 107, 99, 0.18);
}

.section-wrap {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  padding: 80px 0;
}

.section-heading {
  display: grid;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.section-heading h2,
.profile-band h2 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 40px;
}

.section-heading p:last-child,
.profile-band p {
  color: var(--muted);
  font-size: 16px;
  line-height: 26px;
}

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

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.portal-card {
  min-height: 250px;
}

body[data-app-route="content-workbench"] [data-open-insurance-workbench],
body[data-app-route="content-workbench"] [data-open-image-workbench] {
  display: none;
}

.sidebar [data-portal-link] {
  display: none;
}

.tool-card,
.form-card,
.result-card,
.login-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 12px 36px rgba(8, 17, 31, 0.08);
}

.tool-card {
  min-height: 228px;
  padding: 24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(8, 17, 31, 0.12);
}

.tool-card.featured {
  border-color: rgba(198, 161, 91, 0.64);
}

.tool-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 24px;
  color: var(--ink);
  font-weight: 800;
  border: 1px solid rgba(198, 161, 91, 0.5);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff6de, #ead097);
}

.tool-card h3 {
  margin-bottom: 12px;
  font-size: 20px;
  line-height: 28px;
}

.tool-card p {
  min-height: 88px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.text-link {
  padding: 0;
  color: var(--jade);
  border: 0;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.profile-band {
  width: 100%;
  margin: 0;
  padding: 64px max(24px, calc((100vw - var(--max)) / 2));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fffbf3;
}

.profile-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 48px;
}

.profile-copy {
  display: grid;
  gap: 16px;
}

.profile-copy p {
  margin: 0;
}

.profile-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.profile-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.profile-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 22px;
}

.profile-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 21px;
}

.studio-view {
  min-height: 100vh;
  background: #f2eee6;
}

.studio-topbar {
  position: sticky;
  top: 0;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(216, 208, 194, 0.82);
  background: rgba(255, 251, 243, 0.96);
  backdrop-filter: blur(16px);
}

.studio-topbar-brand small {
  color: var(--muted);
}

.studio-section-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.studio-section-link {
  min-height: 36px;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.studio-section-link.active {
  color: var(--ink);
  border-color: rgba(198, 161, 91, 0.5);
  background: #fff8e8;
}

.studio-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
  transition: grid-template-columns 0.18s ease;
}

.studio-body.sidebar-collapsed {
  grid-template-columns: 56px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 72px);
  padding: 24px;
  overflow-y: auto;
  color: var(--ivory);
  background: linear-gradient(180deg, #07101d, #111827);
  transition: padding 0.18s ease;
}

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

.sidebar-panel-title {
  display: grid;
  gap: 4px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-dark);
}

.sidebar-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-bottom: 8px;
  padding: 0 10px;
  color: var(--ivory);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: rgba(247, 242, 232, 0.06);
  cursor: pointer;
}

.sidebar-panel-title strong {
  font-size: 18px;
  line-height: 26px;
}

.sidebar-panel-title small {
  color: rgba(247, 242, 232, 0.58);
  font-size: 12px;
}

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

.studio-body.sidebar-collapsed .sidebar {
  padding: 12px 8px;
}

.studio-body.sidebar-collapsed .sidebar-panel-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.studio-body.sidebar-collapsed .sidebar-panel-title strong,
.studio-body.sidebar-collapsed .sidebar-panel-title small,
.studio-body.sidebar-collapsed .side-nav,
.studio-body.sidebar-collapsed .sidebar-api-panel,
.studio-body.sidebar-collapsed .sidebar-actions,
.studio-body.sidebar-collapsed .sidebar-note {
  display: none;
}

.studio-body.sidebar-collapsed .sidebar-toggle-button {
  width: 40px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  writing-mode: vertical-rl;
}

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

.side-group-title {
  margin: 0 0 2px;
  color: rgba(234, 208, 151, 0.82);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-transform: uppercase;
}

.side-link {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 40px;
  padding: 0 12px 0 18px;
  color: rgba(247, 242, 232, 0.72);
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.side-link.active {
  color: var(--ivory);
  border-color: var(--line-dark);
  background: rgba(247, 242, 232, 0.06);
}

.side-link.active::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--gold);
}

.side-link.utility {
  color: rgba(247, 242, 232, 0.78);
  border-color: var(--line-dark);
}

.sidebar-api-link {
  justify-content: space-between;
  color: var(--ivory);
  border-color: rgba(234, 208, 151, 0.28);
  background: rgba(234, 208, 151, 0.08);
}

.sidebar-api-link small {
  color: rgba(247, 242, 232, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-api-link:hover {
  border-color: rgba(234, 208, 151, 0.45);
  background: rgba(234, 208, 151, 0.13);
}

body.role-user:not(.content-route-authed) .studio-section-nav,
body.role-user:not(.content-route-authed) .side-group[data-section-group="content"] {
  display: none;
}

.sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line-dark);
}

.sidebar-note {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: rgba(247, 242, 232, 0.05);
}

.workspace {
  padding: 32px;
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  width: min(100%, 1180px);
  margin: 0 auto 24px;
}

.workspace-header h1 {
  margin: 0;
  font-size: 32px;
  line-height: 40px;
}

.user-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chip,
.user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.chip.jade {
  color: var(--jade);
  border-color: rgba(35, 107, 99, 0.22);
  background: var(--jade-soft);
}

.user-badge {
  color: var(--ink);
  cursor: pointer;
  justify-content: center;
  text-decoration: none;
}

.account-badge {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(380px, 440px) minmax(0, 1fr);
  gap: 16px;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.workspace-grid.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.form-card,
.result-card {
  padding: 24px;
}

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

.card-heading h2 {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
}

.card-heading span {
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
  line-height: 22px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(198, 161, 91, 0.78);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.14);
}

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

.article-custom-input {
  margin-top: 2px;
}

.shortvideo-settings-panel {
  display: grid;
  gap: 14px;
}

.shortvideo-settings-panel[hidden] {
  display: none;
}

.shortvideo-settings-section {
  display: grid;
  gap: 12px;
  padding: 12px 0 14px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.shortvideo-settings-section:first-child {
  border-top: 0;
  padding-top: 2px;
}

.shortvideo-section-head {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 14px;
}

.shortvideo-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 22px;
}

.shortvideo-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 18px;
}

.shortvideo-control-grid,
.shortvideo-template-grid {
  display: grid;
  gap: 12px;
}

.shortvideo-control-grid-basic {
  grid-template-columns: minmax(170px, 1.05fr) minmax(120px, 0.8fr) minmax(150px, 0.9fr) minmax(140px, 0.9fr);
}

.shortvideo-control-grid-basic:has([data-stage-two-control][hidden]) {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.8fr) minmax(180px, 0.9fr);
}

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

.shortvideo-field {
  gap: 7px;
  margin-bottom: 0;
  min-width: 0;
}

.shortvideo-field > span {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 850;
  line-height: 18px;
}

.shortvideo-stage-script textarea {
  min-height: 112px;
}

.shortvideo-compact-section {
  padding-bottom: 4px;
}

.shortvideo-compact-section textarea {
  min-height: 64px;
}

.field-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
}

.inline-clear-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.inline-clear-button:hover {
  border-color: rgba(198, 161, 91, 0.7);
  color: var(--ink);
  background: rgba(255, 250, 238, 0.92);
}

.template-input-group {
  display: grid;
  gap: 7px;
}

.template-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 7px;
}

.template-actions select {
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.mini-action-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(198, 161, 91, 0.5);
  border-radius: 8px;
  background: rgba(255, 248, 233, 0.82);
  color: #7a4c12;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.mini-action-button:hover {
  background: rgba(240, 203, 127, 0.32);
}

.shortvideo-reference-tools {
  display: grid;
  gap: 10px;
  margin: 0;
}

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

.shortvideo-reference-upload {
  margin-bottom: 0;
}

.shortvideo-reference-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.shortvideo-reference-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.shortvideo-reference-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.06);
}

.shortvideo-reference-card .inline-clear-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.shortvideo-reference-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortvideo-reference-tag {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.shortvideo-reference-tag input {
  height: 34px;
}

.form-card[data-active-tool="shortvideo"] #extraInput {
  min-height: 64px;
}

.form-card[data-active-tool="shortvideo"] #extraInputLabel {
  font-size: 12px;
}

.workflow-primary-hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.wechat-fields {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.wechat-fields[hidden] {
  display: none;
}

.workflow-field-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.workflow-mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.workflow-mode-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 10px;
  min-height: 104px;
  padding: 12px;
  margin: 0;
  border: 1px solid rgba(216, 208, 194, 0.86);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.workflow-mode-option input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
}

.workflow-mode-option strong,
.workflow-mode-option small {
  display: block;
}

.workflow-mode-option strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 20px;
}

.workflow-mode-option small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

.workflow-mode-option:has(input:checked) {
  border-color: rgba(198, 151, 73, 0.82);
  background: rgba(255, 248, 232, 0.68);
  box-shadow: 0 10px 24px rgba(198, 161, 91, 0.12);
}

.workflow-secondary-settings {
  margin: 0 0 14px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.34);
}

.workflow-secondary-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 11px 12px;
  color: var(--ink);
  cursor: pointer;
}

.workflow-secondary-settings summary span {
  font-weight: 850;
}

.workflow-secondary-settings summary small {
  color: var(--muted);
  font-size: 12px;
}

.workflow-secondary-body {
  display: grid;
  gap: 0;
  padding: 0 12px 12px;
}

.workflow-secondary-settings:not([open]) > .workflow-secondary-body {
  display: none;
}

.workspace-grid.conversation-mode {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(100%, 1120px);
}

.workspace-grid.conversation-mode > .form-card,
.workspace-grid.conversation-mode > .result-card {
  width: 100%;
  box-sizing: border-box;
}

.workspace-grid.conversation-mode .result-card {
  order: 2;
  min-height: min(56vh, 680px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(219, 227, 224, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
}

.workspace-grid.conversation-mode .form-card {
  order: 1;
  position: relative;
  bottom: auto;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(200, 211, 207, 0.96);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 38px rgba(12, 23, 32, 0.1);
  backdrop-filter: blur(10px);
}

.workspace-grid.conversation-mode .form-card .card-heading {
  margin-bottom: 0;
}

.workspace-grid.conversation-mode .form-card .card-heading h2 {
  font-size: 15px;
  line-height: 20px;
}

.workspace-grid.conversation-mode .form-card > label {
  margin-bottom: 0;
}

.workspace-grid.conversation-mode #coreInput {
  min-height: 76px;
  max-height: 220px;
  font-size: 15px;
  line-height: 24px;
  border-color: rgba(15, 118, 110, 0.26);
  background: #ffffff;
}

.workspace-grid.conversation-mode .workflow-primary-hint {
  margin: -2px 0 0;
}

.workspace-grid.conversation-mode .workflow-secondary-settings {
  margin: 0;
  background: rgba(247, 250, 248, 0.72);
}

.workspace-grid.conversation-mode #runWorkflowButton {
  justify-self: end;
  min-width: 142px;
  margin-top: 0;
}

.workflow-chat {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr);
  min-height: inherit;
}

.workflow-chat-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(219, 227, 224, 0.9);
  background: rgba(247, 250, 248, 0.72);
}

.workflow-chat-topline div {
  display: grid;
  gap: 2px;
}

.workflow-chat-topline span,
.workflow-chat-topline small,
.chat-message-head span,
.chat-result-source,
.chat-node-summary,
.chat-node-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.workflow-chat-topline strong {
  color: var(--ink);
  font-size: 16px;
}

.workflow-chat-topline small {
  max-width: 620px;
  text-align: right;
}

.workflow-chat-thread {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 420px;
  max-height: min(68vh, 760px);
  padding: 22px clamp(16px, 3vw, 34px) 28px;
  overflow: auto;
  scroll-behavior: smooth;
}

.chat-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.chat-message.user {
  max-width: 820px;
  margin-left: auto;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
  border-radius: 999px;
  background: var(--jade);
}

.chat-message.user .chat-avatar {
  background: var(--ink-3);
}

.chat-bubble {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(219, 227, 224, 0.94);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.chat-message.user .chat-bubble {
  background: rgba(242, 249, 247, 0.92);
}

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

.chat-message-head strong {
  color: var(--ink);
  font-size: 13px;
}

.chat-message-body > h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 24px;
  line-height: 32px;
}

.chat-message-body > p {
  margin: 0 0 10px;
  color: var(--ink-3);
  line-height: 1.75;
}

.chat-input-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 12px 0 0;
}

.chat-submitted-core {
  padding: 12px 14px;
  color: var(--ink);
  border: 1px solid rgba(219, 227, 224, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.chat-input-summary div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(219, 227, 224, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
}

.chat-input-summary dt {
  color: var(--muted);
  font-size: 11px;
}

.chat-input-summary dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.chat-input-more,
.chat-node-panel {
  margin-top: 12px;
}

.chat-input-more summary,
.chat-node-panel > summary,
.chat-node-item > summary {
  cursor: pointer;
  list-style: none;
}

.chat-input-more summary::-webkit-details-marker,
.chat-node-panel > summary::-webkit-details-marker,
.chat-node-item > summary::-webkit-details-marker {
  display: none;
}

.chat-input-more {
  overflow: hidden;
  border: 1px solid rgba(219, 227, 224, 0.94);
  border-radius: var(--radius);
  background: rgba(247, 250, 248, 0.72);
}

.chat-input-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 9px 12px;
  color: var(--ink);
  font-weight: 850;
}

.chat-input-more > summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.chat-input-more .submitted-input-grid {
  padding: 0 12px 12px;
  margin: 0;
}

.chat-node-panel {
  overflow: hidden;
  border: 1px solid rgba(219, 227, 224, 0.94);
  border-radius: var(--radius);
  background: rgba(247, 250, 248, 0.82);
}

.chat-node-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 850;
}

.chat-node-panel > summary em,
.chat-node-item summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.chat-node-summary,
.chat-node-empty {
  margin: 0;
  padding: 0 12px 12px;
}

.chat-node-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.chat-node-item {
  border: 1px solid rgba(219, 227, 224, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.chat-node-item summary {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px 10px;
}

.chat-node-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
}

.chat-node-item.running .chat-node-dot {
  background: var(--info);
}

.chat-node-item.succeeded .chat-node-dot {
  background: var(--jade);
}

.chat-node-item.failed .chat-node-dot {
  background: var(--danger);
}

.chat-node-item summary strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-node-item p,
.chat-node-item pre {
  margin: 0 10px 10px 29px;
}

.chat-node-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.chat-node-item pre {
  max-height: 240px;
  padding: 10px;
  overflow: auto;
  color: var(--ink);
  font-size: 12px;
  line-height: 18px;
  border: 1px solid rgba(219, 227, 224, 0.9);
  border-radius: var(--radius);
  background: #ffffff;
  white-space: pre-wrap;
}

.chat-run-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--ink);
}

.chat-run-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.chat-run-actions span {
  color: var(--muted);
  font-size: 12px;
}

.workflow-followup-composer {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(35, 107, 99, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(228, 240, 237, 0.78), rgba(255, 248, 232, 0.56)),
    rgba(255, 255, 255, 0.82);
}

.workflow-followup-composer label {
  margin: 0;
}

.workflow-followup-composer textarea {
  min-height: 86px;
  background: #ffffff;
}

.workflow-followup-composer > div {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.xhs-result-body {
  max-width: 760px;
}

.short-video-fields {
  display: grid;
  gap: 0;
}

.moments-fields {
  display: grid;
  gap: 0;
}

.preuw-fields {
  display: grid;
  gap: 0;
}

.uw-appeal-fields {
  display: grid;
  gap: 0;
}

.uw-appeal-helper,
.uw-privacy-note,
.uw-sop-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.uw-appeal-helper strong,
.uw-privacy-note strong {
  display: block;
  margin-bottom: 4px;
}

.uw-appeal-helper span,
.uw-privacy-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.uw-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.uw-template-status {
  min-height: 18px;
}

.uw-privacy-note {
  border-color: rgba(198, 161, 91, 0.42);
  background: rgba(255, 248, 232, 0.54);
}

.uw-sop-card {
  color: var(--ink);
  background: rgba(237, 242, 239, 0.58);
}

.uw-sop-card summary {
  cursor: pointer;
  font-weight: 900;
}

.uw-sop-card ol {
  display: grid;
  gap: 8px;
  margin: 2px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.uw-delivery-actions {
  display: grid;
  gap: 10px;
  max-width: 860px;
  padding: 14px;
  margin: 10px 0 16px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

.uw-delivery-actions h3 {
  margin: 0;
}

.uw-delivery-actions p {
  margin: 0;
  color: var(--muted);
}

.uw-delivery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.short-video-fields[hidden],
.moments-fields[hidden],
.preuw-fields[hidden],
.uw-appeal-fields[hidden] {
  display: none;
}

.file-input-panel {
  padding: 12px;
  border: 1px dashed rgba(198, 161, 91, 0.5);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.42);
}

.file-input-panel input[type="file"] {
  height: auto;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.file-input-panel span {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.file-input-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.switch-row input {
  width: 16px;
  height: 16px;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.editor-sections {
  display: grid;
  gap: 18px;
}

.editor-section {
  padding: 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.38);
}

.editor-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(216, 208, 194, 0.72);
}

.editor-section-heading h3 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 26px;
}

.editor-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 21px;
}

.editor-section-heading span {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 4px 8px;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(198, 161, 91, 0.42);
  border-radius: var(--radius);
  background: #fff8e8;
}

.editor-notice {
  min-height: 40px;
  padding: 10px 12px;
  margin: 16px 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  border: 1px solid rgba(35, 107, 99, 0.22);
  border-radius: var(--radius);
  background: var(--jade-soft);
}

.editor-notice[data-state="pending"] {
  color: var(--gold-dark);
  border-color: rgba(198, 161, 91, 0.42);
  background: #fff8e8;
}

.editor-notice[data-state="success"] {
  color: var(--jade);
}

.editor-notice[data-state="error"] {
  color: #9f2d20;
  border-color: rgba(159, 45, 32, 0.24);
  background: #fff0ed;
}

.tool-config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.tool-config-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
}

.tool-config-card[data-dirty="true"] {
  border-color: rgba(198, 161, 91, 0.72);
  box-shadow: 0 12px 28px rgba(198, 161, 91, 0.12);
}

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

.tool-config-card h3 {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 26px;
}

.tool-config-card-head strong {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: var(--jade);
  font-size: 12px;
  border: 1px solid rgba(35, 107, 99, 0.24);
  border-radius: var(--radius);
  background: var(--jade-soft);
}

.tool-config-card-head strong[data-state="disabled"] {
  color: var(--muted);
  border-color: rgba(216, 208, 194, 0.82);
  background: rgba(255, 255, 255, 0.5);
}

.tool-config-card p {
  margin: 0;
  color: var(--muted);
  line-height: 24px;
}

.tool-config-field {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}

.tool-config-field input,
.tool-config-field textarea,
.tool-config-field select {
  width: 100%;
  padding: 10px 11px;
  color: var(--ink);
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  font: inherit;
  line-height: 22px;
}

.tool-config-field textarea {
  min-height: 104px;
  resize: vertical;
}

.tool-config-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}

.tool-config-switch input {
  width: 16px;
  height: 16px;
}

.tool-config-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.tool-config-meta div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(216, 208, 194, 0.7);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.44);
}

.tool-config-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.tool-config-meta dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.tool-config-actions {
  display: grid;
  gap: 8px;
}

.tool-config-notice {
  margin: 0;
}

.tool-integration-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  margin-top: 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

.tool-integration-card .history-header {
  margin-bottom: 0;
}

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

.tool-integration-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.78);
  border-left: 4px solid rgba(100, 116, 139, 0.5);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.tool-integration-item.ok {
  border-left-color: var(--jade);
}

.tool-integration-item.failed {
  border-left-color: #9f2d20;
  background: rgba(255, 244, 241, 0.56);
}

.tool-integration-item.running,
.tool-integration-item.pending,
.tool-integration-item.warning {
  border-left-color: var(--gold);
}

.tool-integration-item.disabled {
  opacity: 0.74;
}

.tool-integration-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tool-integration-head span,
.tool-integration-item dt,
.tool-integration-item p {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.tool-integration-head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
}

.tool-integration-head em {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.72);
}

.tool-integration-item dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

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

.knowledge-upload-card,
.knowledge-list-card,
.knowledge-detail-card,
.knowledge-detail-empty {
  padding: 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

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

.knowledge-upload-card {
  display: grid;
  gap: 14px;
}

.knowledge-route-guide {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(35, 107, 99, 0.18);
  border-radius: var(--radius);
  background: rgba(248, 252, 250, 0.62);
}

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

.knowledge-route-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.knowledge-route-row strong {
  font-size: 14px;
  line-height: 20px;
}

.knowledge-route-row span,
.knowledge-route-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.knowledge-upload-card label,
.knowledge-file-field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.knowledge-upload-card input,
.knowledge-upload-card select,
.knowledge-upload-card textarea {
  width: 100%;
  padding: 10px 11px;
  color: var(--ink);
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.knowledge-file-field small,
.knowledge-muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.knowledge-upload-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}

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

.knowledge-source-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 13px;
  color: var(--ink);
  text-align: left;
  border: 1px solid rgba(216, 208, 194, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.knowledge-source-item.active {
  border-color: rgba(35, 107, 99, 0.46);
  box-shadow: 0 12px 28px rgba(35, 107, 99, 0.12);
}

.knowledge-source-item strong {
  font-size: 15px;
  line-height: 22px;
}

.knowledge-source-item small,
.knowledge-source-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 18px;
}

.knowledge-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  padding: 3px 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.78);
}

.knowledge-status[data-state="extracted"],
.knowledge-status[data-state="published"],
.knowledge-status[data-state="approved"] {
  color: var(--jade);
  border-color: rgba(35, 107, 99, 0.24);
  background: var(--jade-soft);
}

.knowledge-status[data-state="processing"] {
  border-color: rgba(198, 161, 91, 0.52);
  background: rgba(255, 244, 214, 0.9);
}

.knowledge-status[data-state="pending_review"] {
  color: #7a5817;
  border-color: rgba(198, 161, 91, 0.42);
  background: rgba(255, 244, 214, 0.82);
}

.knowledge-status[data-state="failed"],
.knowledge-status[data-state="partial"] {
  color: #9f2d20;
  border-color: rgba(159, 45, 32, 0.24);
  background: rgba(255, 244, 241, 0.72);
}

.knowledge-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.knowledge-detail-head h3 {
  margin: 4px 0 8px;
  font-size: 22px;
  line-height: 30px;
}

.knowledge-detail-head p {
  margin: 0;
  color: var(--muted);
  line-height: 24px;
}

.knowledge-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.knowledge-tag {
  padding: 4px 8px;
  color: var(--jade);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(35, 107, 99, 0.22);
  border-radius: var(--radius);
  background: rgba(228, 240, 237, 0.72);
}

.knowledge-detail-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.knowledge-detail-section h4 {
  margin: 0;
  font-size: 16px;
}

.knowledge-analysis-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(35, 107, 99, 0.2);
  border-radius: var(--radius);
  background: rgba(248, 252, 250, 0.7);
}

.knowledge-auto-classify-note {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(35, 107, 99, 0.18);
  border-radius: var(--radius);
  background: rgba(247, 251, 249, 0.82);
}

.knowledge-auto-classify-note strong {
  color: var(--ink);
  font-size: 13px;
}

.knowledge-auto-classify-note span {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.knowledge-upload-card label:has(#knowledgeSourceTypeInput),
.knowledge-upload-card label:has(#knowledgeDomainInput),
.knowledge-upload-card label:has(#knowledgePermissionInput),
.knowledge-upload-card label:has(#knowledgeSensitivityInput),
.knowledge-upload-card label:has(#knowledgeTagsInput) {
  display: none;
}

.knowledge-analysis-summary {
  color: var(--ink);
  font-size: 14px;
  line-height: 23px;
}

.knowledge-analysis-block {
  display: grid;
  gap: 8px;
}

.knowledge-analysis-block strong {
  font-size: 13px;
}

.knowledge-analysis-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 21px;
}

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

.knowledge-number-card {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid rgba(216, 208, 194, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.knowledge-number-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.knowledge-number-card strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
}

.knowledge-number-card p,
.knowledge-number-card small,
.knowledge-number-card li {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.knowledge-number-card ul {
  margin: 0;
  padding-left: 18px;
}

.knowledge-chart-analysis {
  padding: 12px;
  border: 1px solid rgba(35, 107, 99, 0.18);
  border-radius: var(--radius);
  background: rgba(247, 251, 249, 0.82);
}

.knowledge-risk-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-risk-list span {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  color: #9f2d20;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(159, 45, 32, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 244, 241, 0.82);
}

.knowledge-review-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.knowledge-review-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.knowledge-review-form input,
.knowledge-review-form select,
.knowledge-review-form textarea {
  width: 100%;
  padding: 10px 11px;
  color: var(--ink);
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

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

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

.knowledge-sync-row {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(216, 208, 194, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.knowledge-sync-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.knowledge-sync-row span,
.knowledge-sync-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.knowledge-asset-list,
.knowledge-extraction-list {
  display: grid;
  gap: 10px;
}

.knowledge-asset-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(216, 208, 194, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.knowledge-asset-row strong,
.knowledge-asset-row span,
.knowledge-asset-row small {
  display: block;
}

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

.knowledge-extraction-card {
  padding: 12px;
  border: 1px solid rgba(216, 208, 194, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.knowledge-extraction-card summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.knowledge-extraction-card summary small {
  margin-left: auto;
  color: var(--muted);
}

.knowledge-warning-list {
  margin: 10px 0;
  padding-left: 20px;
  color: var(--muted);
}

.knowledge-text-preview {
  max-height: 320px;
  overflow: auto;
}

.knowledge-detail-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  color: var(--muted);
  text-align: center;
}

.knowledge-job-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(198, 161, 91, 0.46);
  border-radius: var(--radius);
  background: rgba(255, 244, 214, 0.72);
}

.knowledge-job-banner strong,
.knowledge-job-banner span {
  display: block;
}

.knowledge-job-banner span {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.knowledge-job-banner small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

@media (max-width: 980px) {
  .knowledge-form-grid,
  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  .knowledge-route-grid {
    grid-template-columns: 1fr;
  }

  .knowledge-analysis-grid {
    grid-template-columns: 1fr;
  }

  .knowledge-detail-head,
  .knowledge-asset-row,
  .knowledge-job-banner,
  .knowledge-sync-row > div {
    flex-direction: column;
    align-items: stretch;
  }
}

.tool-integration-item dl div {
  display: grid;
  gap: 2px;
}

.tool-integration-item dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 20px;
}

.tool-integration-item p {
  margin: 0;
}

.tool-integration-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-settings-card {
  display: grid;
  gap: 14px;
  max-width: 560px;
  padding: 18px;
  margin-top: 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.user-management-card {
  max-width: none;
}

.account-profile-card {
  max-width: 720px;
}

.account-identity-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding-top: 4px;
}

.account-identity-form .editor-notice {
  grid-column: 1 / -1;
}

.email-verify-row {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.user-profile-card {
  max-width: 780px;
}

.user-profile-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.user-profile-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  font-size: 13px;
}

.account-summary-card,
.account-security-card {
  max-width: 780px;
}

.system-status-card,
.backup-settings-card {
  max-width: 920px;
}

.backup-list {
  display: grid;
  gap: 8px;
}

.backup-list h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.backup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.backup-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.backup-item strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.backup-item span,
.backup-item small {
  color: var(--muted);
  font-size: 12px;
}

.account-center-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-note-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}

.user-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.user-management-filters,
.user-bulk-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 180px) minmax(130px, 180px) auto auto minmax(160px, auto);
  gap: 10px;
  align-items: end;
}

.user-bulk-panel {
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(140px, 180px) minmax(140px, 180px) auto auto;
  padding: 12px;
  border: 1px solid rgba(216, 208, 194, 0.68);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.38);
}

.user-management-filters strong {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

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

.user-management-item {
  display: grid;
  grid-template-columns: auto minmax(180px, 1.2fr) repeat(5, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.user-management-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
}

.user-management-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.user-management-main span,
.user-management-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.user-management-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.insurance-trash-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(45, 98, 143, 0.18);
  border-radius: 8px;
  background: rgba(247, 251, 255, 0.78);
}

.insurance-trash-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.insurance-trash-preview-header span {
  color: var(--muted);
  font-size: 12px;
}

.insurance-trash-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.insurance-trash-preview-item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.insurance-trash-preview-item span,
.insurance-trash-preview-item small {
  color: var(--muted);
  font-size: 12px;
}

.insurance-trash-preview-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-reset-card,
.registration-policy-card {
  max-width: 920px;
}

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

.password-reset-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.image-policy-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-top: 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.image-policy-head {
  margin: 0;
}

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

.image-policy-field input {
  min-height: 42px;
}

.image-policy-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.image-policy-notice {
  margin: 0;
}

.image-asset-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-top: 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.image-asset-head {
  margin: 0;
}

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

.image-asset-notice {
  margin: 0;
}

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

.image-asset-metric {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

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

.image-asset-metric strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 30px;
}

.image-asset-path {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.image-asset-path span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.image-asset-path code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12px;
}

.image-asset-orphans {
  display: grid;
  gap: 8px;
}

.image-asset-orphans h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.image-asset-orphan-item {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.image-asset-orphan-item span {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
}

.image-asset-orphan-item small {
  color: var(--muted);
  font-size: 12px;
}

.image-usage-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-top: 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.image-usage-head {
  margin: 0;
}

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

.image-usage-notice {
  margin: 0;
}

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

.image-usage-metric {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.image-usage-metric span,
.image-usage-metric small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.image-usage-metric strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 30px;
}

.image-usage-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.image-usage-subcard {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.44);
}

.image-usage-subcard h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.image-usage-error-list,
.image-usage-recent-list {
  display: grid;
  gap: 8px;
}

.image-usage-error-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.image-usage-error-list span,
.image-usage-recent-item span,
.image-usage-recent-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.image-usage-recent-item {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(216, 208, 194, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.image-usage-recent-item.success {
  border-color: rgba(35, 107, 99, 0.2);
}

.image-usage-recent-item.failed {
  border-color: rgba(159, 45, 32, 0.24);
  background: rgba(255, 244, 241, 0.56);
}

.image-usage-recent-item strong {
  color: var(--ink);
  font-size: 13px;
}

.api-console {
  display: grid;
  gap: 18px;
}

.api-console-hero {
  padding: 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

.api-console-hero h2 {
  margin: 4px 0 8px;
}

.api-console-actions,
.api-console-token-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.api-console-notice {
  margin: 0;
}

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

.api-console-metric,
.api-console-card,
.api-console-quota-card,
.api-console-policy-list div,
.api-console-recent-item {
  border: 1px solid rgba(216, 208, 194, 0.76);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.api-console-metric {
  display: grid;
  gap: 5px;
  min-height: 116px;
  padding: 15px;
  border-left: 4px solid rgba(100, 116, 139, 0.5);
}

.api-console-metric.success {
  border-left-color: var(--jade);
}

.api-console-metric.pending {
  border-left-color: var(--gold);
}

.api-console-metric.error {
  border-left-color: #9f2d20;
}

.api-console-metric span,
.api-console-metric small,
.api-console-card-head span,
.api-console-quota-card span,
.api-console-quota-card small,
.api-console-policy-list span,
.api-console-recent-item span,
.api-console-recent-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.api-console-metric strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 28px;
}

.api-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
  gap: 14px;
}

.api-console-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.api-console-policy-card,
.api-console-recent-card {
  grid-column: 1 / -1;
}

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

.api-console-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 24px;
}

.api-console-quota-list,
.api-console-policy-list,
.api-console-recent-list {
  display: grid;
  gap: 10px;
}

.api-console-quota-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.api-console-quota-card strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 26px;
  line-height: 32px;
}

.api-console-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(216, 208, 194, 0.56);
}

.api-console-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jade), var(--gold));
}

.api-console-policy-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.api-console-policy-list div {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.api-console-policy-list strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
}

.api-console-recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border-left: 4px solid rgba(100, 116, 139, 0.5);
}

.api-console-recent-item.succeeded {
  border-left-color: var(--jade);
}

.api-console-recent-item.failed {
  border-left-color: #9f2d20;
}

.api-console-recent-item.running,
.api-console-recent-item.queued,
.api-console-recent-item.submitting {
  border-left-color: var(--gold);
}

.api-console-recent-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.tab.active {
  color: var(--ink);
  border-color: rgba(198, 161, 91, 0.5);
  background: #fff8e8;
}

.result-panel {
  color: var(--ink-3);
  font-size: 14px;
  line-height: 24px;
}

.result-panel h2 {
  margin-bottom: 12px;
  font-size: 24px;
  line-height: 32px;
}

.result-panel h3 {
  margin: 24px 0 8px;
  font-size: 16px;
  line-height: 24px;
}

.result-panel p {
  margin-bottom: 12px;
}

.dashboard-panel {
  display: grid;
  gap: 24px;
}

.dashboard-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 248, 232, 0.92), rgba(228, 240, 237, 0.62)),
    #fffaf0;
}

.dashboard-hero h2 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 36px;
}

.dashboard-hero p {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
}

.dashboard-card-meta {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.dashboard-card-meta span {
  min-height: 32px;
  padding: 7px 10px;
  color: var(--jade);
  font-size: 12px;
  border: 1px solid rgba(35, 107, 99, 0.18);
  border-radius: var(--radius);
  background: rgba(228, 240, 237, 0.72);
}

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

.dashboard-primary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-secondary-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-more-tools {
  border: 1px solid rgba(219, 227, 224, 0.96);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.dashboard-more-tools summary {
  min-height: 44px;
  padding: 12px 16px;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.dashboard-more-tools .dashboard-tool-grid {
  padding: 0 16px 16px;
}

.dashboard-more-tools:not([open]) .dashboard-tool-grid {
  display: none;
}

.dashboard-more-tools .dashboard-tool-card {
  min-height: 132px;
}

.dashboard-panel [data-open-insurance-workbench],
.dashboard-panel [data-open-image-workbench],
body[data-app-route="content-workbench"] .dashboard-panel [data-open-insurance-workbench],
body[data-app-route="content-workbench"] .dashboard-panel [data-open-image-workbench] {
  display: grid;
}

.dashboard-tool-card {
  display: grid;
  gap: 10px;
  min-height: 156px;
  padding: 18px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.content-hub {
  display: grid;
  gap: 18px;
}

.content-hub-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.content-hub-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 32px;
}

.content-hub-header p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.content-hub-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.content-hub-meta span {
  min-height: 36px;
  padding: 8px 10px;
  color: var(--jade);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(35, 107, 99, 0.18);
  border-radius: var(--radius);
  background: rgba(228, 240, 237, 0.72);
}

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

.content-hub-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  min-height: 154px;
  padding: 18px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.content-hub-card:hover {
  transform: translateY(-2px);
  border-color: rgba(35, 107, 99, 0.46);
  box-shadow: var(--shadow);
}

.content-hub-card.primary {
  border-color: rgba(35, 107, 99, 0.38);
  background: rgba(243, 249, 247, 0.88);
}

.content-hub-card span {
  grid-column: 1 / -1;
  color: var(--jade);
  font-size: 12px;
  font-weight: 850;
}

.content-hub-card strong {
  font-size: 18px;
  line-height: 1.35;
}

.content-hub-card small {
  justify-self: end;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 12px;
  border-radius: 999px;
  background: rgba(235, 240, 238, 0.84);
}

.content-hub-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.content-hub-empty {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.dashboard-tool-card:hover {
  border-color: rgba(198, 161, 91, 0.62);
  box-shadow: 0 16px 36px rgba(8, 17, 31, 0.1);
  transform: translateY(-1px);
}

.dashboard-tool-card.primary {
  border-color: rgba(198, 161, 91, 0.62);
  background: #fff8e8;
}

.history-policy-note {
  margin: -6px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 21px;
}

.dashboard-tool-card strong {
  font-size: 18px;
  line-height: 26px;
}

.dashboard-tool-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 21px;
}

.dashboard-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(198, 161, 91, 0.42);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.82);
}

.dashboard-running {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(35, 107, 99, 0.22);
  border-radius: var(--radius);
  background: rgba(228, 240, 237, 0.46);
}

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

.dashboard-running-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(35, 107, 99, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.dashboard-running-item div {
  display: grid;
  gap: 4px;
}

.dashboard-running-item strong {
  color: var(--ink);
  font-size: 15px;
}

.dashboard-running-item span,
.dashboard-running-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.dashboard-running-actions,
.run-status-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.run-status-actions {
  margin-top: 2px;
}

.run-status-actions span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-recent {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.44);
}

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

.dashboard-recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.76);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

.dashboard-recent-item div {
  display: grid;
  gap: 4px;
}

.dashboard-recent-item strong {
  font-size: 14px;
  line-height: 22px;
}

.dashboard-recent-item span {
  color: var(--muted);
  font-size: 12px;
}

.result-body {
  max-width: 760px;
  padding: 16px;
  margin: 12px 0 18px;
  white-space: normal;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
}

.body-word-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  margin: 6px 0 10px;
  color: #6d4b16;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid rgba(198, 161, 91, 0.4);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.78);
}

.result-table-wrap {
  max-width: 100%;
  margin: 12px 0 18px;
  overflow: auto;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

.result-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 20px;
}

.result-table th,
.result-table td {
  max-width: 280px;
  min-width: 120px;
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
  border-right: 1px solid rgba(216, 208, 194, 0.72);
  border-bottom: 1px solid rgba(216, 208, 194, 0.72);
}

.result-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--ink);
  background: #fff8e8;
}

.submitted-input-card {
  max-width: 760px;
  padding: 14px;
  margin: 12px 0 18px;
  border: 1px solid rgba(198, 161, 91, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.48);
}

.submitted-input-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
  list-style: none;
  cursor: pointer;
}

.submitted-input-card[open] .submitted-input-head {
  margin-bottom: 10px;
}

.submitted-input-head::-webkit-details-marker {
  display: none;
}

.submitted-input-head h3 {
  margin: 0;
}

.submitted-input-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.submitted-input-grid dd {
  overflow-wrap: anywhere;
}

.submitted-input-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.submitted-input-grid > div {
  display: grid;
  align-content: start;
  min-height: 72px;
}

.submitted-input-grid .submitted-input-collapsible-row {
  grid-column: 1 / -1;
  min-height: 0;
}

.submitted-input-value {
  display: grid;
  gap: 8px;
}

.submitted-input-value summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.submitted-input-value summary::-webkit-details-marker {
  display: none;
}

.submitted-input-value summary span {
  min-width: 0;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}

.submitted-input-value summary em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.submitted-input-value-body {
  max-height: 340px;
  padding: 10px 12px;
  overflow: auto;
  color: var(--ink);
  line-height: 1.7;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.ocr-quality-card {
  max-width: 760px;
  padding: 14px;
  margin: 12px 0 18px;
  border: 1px solid rgba(198, 161, 91, 0.42);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.62);
}

.ocr-quality-card[data-state="ok"] {
  border-color: rgba(35, 107, 99, 0.24);
  background: rgba(228, 240, 237, 0.5);
}

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

.ocr-quality-head h3,
.ocr-quality-card p {
  margin: 0;
}

.ocr-quality-head span {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 4px 8px;
  color: #6d4b16;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(198, 161, 91, 0.38);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
}

.ocr-quality-card[data-state="ok"] .ocr-quality-head span {
  color: var(--jade);
  border-color: rgba(35, 107, 99, 0.22);
}

.ocr-quality-card ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 21px;
}

.ocr-quality-card details {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.ocr-quality-card summary {
  cursor: pointer;
  font-weight: 800;
}

.ocr-preview-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.ocr-preview-actions span {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.history-detail-layout .ocr-quality-card {
  max-width: none;
  margin: 0;
}

.ocr-trace-card {
  max-width: 760px;
  padding: 14px;
  margin: 12px 0 18px;
  border: 1px solid rgba(35, 107, 99, 0.26);
  border-radius: var(--radius);
  background: rgba(228, 240, 237, 0.42);
}

.ocr-trace-card[data-state="warning"] {
  border-color: rgba(198, 161, 91, 0.42);
  background: rgba(255, 248, 232, 0.62);
}

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

.ocr-trace-head h3 {
  margin: 0;
}

.ocr-trace-head span {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 4px 8px;
  color: var(--jade);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(35, 107, 99, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.ocr-trace-card[data-state="warning"] .ocr-trace-head span {
  color: #6d4b16;
  border-color: rgba(198, 161, 91, 0.38);
}

.ocr-trace-card details {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.ocr-trace-card summary {
  cursor: pointer;
  font-weight: 800;
}

.ocr-trace-card ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 21px;
}

.history-detail-layout .ocr-trace-card {
  max-width: none;
  margin: 0;
}

.ocr-preview-list {
  display: grid;
  gap: 14px;
  max-width: 860px;
}

.ocr-preview-card {
  padding: 16px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.44);
}

.ocr-preview-card[data-state="ok"] {
  border-color: rgba(35, 107, 99, 0.24);
  background: rgba(228, 240, 237, 0.34);
}

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

.ocr-preview-head h3,
.ocr-preview-card h4 {
  margin: 0;
}

.ocr-preview-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ocr-preview-head dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 8px;
  min-width: 260px;
  margin: 0;
}

.ocr-preview-head dl div {
  padding: 8px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
}

.ocr-preview-head dt {
  color: var(--muted);
  font-size: 11px;
}

.ocr-preview-head dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 800;
}

.ocr-preview-issues {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 21px;
}

.ocr-page-details {
  margin: 10px 0 14px;
}

.ocr-page-details summary {
  cursor: pointer;
  font-weight: 800;
}

.ocr-page-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 9px 0;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid rgba(216, 208, 194, 0.58);
}

.ocr-page-row strong {
  color: var(--ink);
}

.ocr-page-row small {
  flex-basis: 100%;
}

.feedback-card {
  max-width: 760px;
  padding: 14px;
  margin: 12px 0 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
}

.moments-agent-card {
  max-width: 760px;
  padding: 14px;
  margin: 12px 0 18px;
  border: 1px solid rgba(79, 150, 118, 0.28);
  border-radius: var(--radius);
  background: rgba(244, 250, 247, 0.72);
}

.moments-agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.feedback-head h3 {
  margin: 0;
}

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

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-text-field {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.feedback-text-field span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.feedback-text-field textarea {
  width: 100%;
  min-height: 92px;
  padding: 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  resize: vertical;
  border: 1px solid rgba(207, 196, 177, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.feedback-text-field textarea:focus {
  outline: 2px solid rgba(198, 161, 91, 0.34);
  border-color: rgba(198, 161, 91, 0.76);
}

.feedback-helper {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.feedback-chip {
  min-height: 36px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  border: 1px solid rgba(207, 196, 177, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
}

.feedback-chip:hover,
.feedback-chip.active {
  color: #6d4b16;
  border-color: rgba(198, 161, 91, 0.72);
  background: rgba(255, 248, 232, 0.92);
}

.feedback-chip:disabled {
  cursor: wait;
  opacity: 0.72;
}

.feedback-followup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.feedback-revise-btn {
  min-height: 38px;
  padding: 0 14px;
  color: #11233a;
  font: inherit;
  font-weight: 800;
  border: 1px solid rgba(198, 161, 91, 0.72);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(238, 211, 145, 0.96), rgba(199, 158, 73, 0.94));
  cursor: pointer;
}

.feedback-regenerate-btn {
  color: #f8efe1;
  border-color: rgba(17, 35, 58, 0.82);
  background: linear-gradient(135deg, #16263b, #0a1524);
}

.feedback-revise-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.feedback-revision-notice {
  max-width: 760px;
  padding: 12px 14px;
  margin: 0 0 14px;
  color: #6d4b16;
  font-weight: 800;
  border: 1px solid rgba(198, 161, 91, 0.46);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.88);
}

.wechat-image-actions {
  display: grid;
  gap: 12px;
  max-width: 760px;
  padding: 12px 14px;
  margin: 14px 0 18px;
  border: 1px solid rgba(198, 161, 91, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.52);
}

.wechat-image-actions-head,
.wechat-image-action-buttons,
.wechat-image-prompt-editor-head,
.wechat-image-prompt-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.wechat-image-actions-head strong,
.wechat-image-prompt-editor-head strong {
  color: var(--ink);
}

.wechat-image-actions span,
.wechat-image-prompt-editor-head span {
  color: var(--muted);
  font-size: 13px;
}

.wechat-image-action-buttons {
  justify-content: flex-start;
}

.wechat-image-prompt-editor {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(198, 161, 91, 0.26);
}

.wechat-image-prompt-editor textarea {
  min-height: 160px;
  background: rgba(255, 255, 255, 0.78);
}

.wechat-inline-image-result {
  display: grid;
  gap: 10px;
}

.wechat-inline-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.wechat-inline-image-item {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid rgba(216, 208, 194, 0.8);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.wechat-inline-image-item img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
}

.wechat-inline-image-item figcaption {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 8px;
  border-radius: var(--radius);
  background: rgba(8, 17, 31, 0.72);
  backdrop-filter: blur(10px);
}

.wechat-inline-image-item button,
.wechat-inline-image-item a {
  color: #ffffff;
  font-size: 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.wechat-final-prompt {
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.wechat-final-prompt summary {
  padding: 10px 12px;
  cursor: pointer;
}

.wechat-final-prompt pre {
  max-height: 260px;
  margin: 0;
  padding: 0 12px 12px;
  overflow: auto;
  white-space: pre-wrap;
}

.wechat-linked-images {
  max-width: 760px;
  padding: 14px;
  margin: 12px 0 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

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

.wechat-linked-images-head h3 {
  margin: 0;
}

.wechat-linked-image-grid {
  display: grid;
  gap: 12px;
}

.wechat-linked-image-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(216, 208, 194, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.38);
}

.wechat-linked-image-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.wechat-linked-image-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.wechat-linked-image-thumbs button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}

.wechat-linked-image-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.manual-revision-card {
  display: grid;
  gap: 12px;
}

.manual-revision-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.manual-revision-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.run-status-card {
  display: grid;
  gap: 12px;
  max-width: 760px;
  padding: 16px;
  margin: 12px 0 18px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

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

.run-status-head strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 24px;
}

.run-status-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.run-progress {
  position: relative;
  overflow: hidden;
  height: 8px;
  border-radius: var(--radius);
  background: rgba(216, 208, 194, 0.5);
}

.run-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(198, 161, 91, 0.42), rgba(198, 161, 91, 0.96));
  animation: run-progress 1.4s ease-in-out infinite;
}

@keyframes run-progress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(280%);
  }
}

.run-log {
  padding-top: 4px;
}

.run-log summary {
  width: fit-content;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.run-log .history-detail-grid {
  margin-top: 10px;
}

.workflow-error-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 760px;
  margin-top: 12px;
}

.workflow-error-actions .copy-notice {
  min-width: 180px;
}

.run-event-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.run-event-list h4 {
  margin: 2px 0 4px;
  color: var(--ink);
  font-size: 13px;
}

.run-event-summary {
  margin: 0;
  padding: 10px 12px;
  color: #6f3a20;
  font-size: 12px;
  line-height: 20px;
  border: 1px solid rgba(198, 161, 91, 0.42);
  border-radius: var(--radius);
  background: rgba(255, 248, 232, 0.74);
}

.run-event-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.38);
}

.run-event-item.failed {
  border-color: rgba(159, 45, 32, 0.38);
  background: rgba(255, 244, 241, 0.72);
}

.run-event-item.succeeded {
  border-color: rgba(65, 133, 96, 0.28);
  background: rgba(243, 250, 245, 0.68);
}

.run-event-item.running {
  border-color: rgba(198, 161, 91, 0.34);
}

.run-event-item.canceled {
  border-color: rgba(100, 116, 139, 0.28);
  background: rgba(248, 250, 252, 0.66);
}

.run-event-topline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.run-event-topline span {
  color: var(--muted);
  font-size: 12px;
}

.run-event-topline strong {
  color: var(--ink);
  font-size: 13px;
}

.run-event-topline em {
  min-height: 22px;
  padding: 2px 7px;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.run-event-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
}

.run-event-output {
  margin-top: 4px;
}

.run-event-output summary {
  width: fit-content;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.run-event-output summary::-webkit-details-marker {
  display: none;
}

.run-event-output pre {
  max-height: 420px;
  margin: 8px 0 0;
  padding: 10px 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.65;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
}

.completed-run-log {
  max-width: 760px;
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.run-record-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.run-record-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.run-record-overview-card {
  min-height: 98px;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-left: 4px solid rgba(100, 116, 139, 0.55);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.run-record-overview-card:hover,
.run-record-overview-card:focus-visible,
.run-record-overview-card.active {
  border-color: rgba(198, 151, 73, 0.76);
  background: rgba(255, 255, 255, 0.76);
  outline: none;
  transform: translateY(-1px);
}

.run-record-overview-card span,
.run-record-overview-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.run-record-overview-card strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--ink);
  font-size: 28px;
  line-height: 34px;
}

.run-record-overview-card.failed {
  border-left-color: #9f2d20;
}

.run-record-overview-card.running {
  border-left-color: var(--gold);
}

.run-record-overview-card.succeeded {
  border-left-color: var(--jade);
}

.run-record-overview-card.canceled {
  border-left-color: rgba(100, 116, 139, 0.72);
}

.run-record-scope,
.run-record-countbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.run-record-scope:empty {
  display: none;
}

.run-record-scope span,
.run-record-countbar strong {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  font-weight: 800;
}

.run-record-countbar strong {
  color: var(--muted);
  font-weight: 700;
}

.audit-log-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 300px) minmax(120px, 150px) auto auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 18px;
}

.audit-log-filters label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}

.audit-log-filters input,
.audit-log-filters select {
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  font: inherit;
}

.audit-log-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.audit-log-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 260px);
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-left: 4px solid rgba(100, 116, 139, 0.55);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.audit-log-main,
.audit-log-meta {
  display: grid;
  gap: 8px;
}

.audit-log-main p,
.audit-log-meta span,
.audit-log-meta small {
  margin: 0;
  color: var(--muted);
  line-height: 22px;
}

.run-record-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-left: 4px solid rgba(100, 116, 139, 0.55);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.run-record-item:hover,
.run-record-item:focus-visible {
  border-color: rgba(198, 151, 73, 0.72);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
  transform: translateY(-1px);
}

.run-record-item.succeeded {
  border-left-color: var(--jade);
}

.run-record-item.failed {
  border-left-color: #9f2d20;
}

.run-record-item.running {
  border-left-color: var(--gold);
}

.run-record-item.canceled {
  border-left-color: rgba(100, 116, 139, 0.72);
}

.run-record-main,
.run-record-meta {
  display: grid;
  gap: 8px;
}

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

.run-record-title strong {
  color: var(--ink);
  font-size: 17px;
}

.run-record-title span {
  padding: 3px 8px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.7);
}

.run-record-main p,
.run-record-meta span,
.run-record-meta small {
  margin: 0;
  color: var(--muted);
  line-height: 22px;
}

.run-record-error {
  color: #9f2d20 !important;
}

.run-record-image-summary {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.run-record-image-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.run-record-image-meta span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid rgba(216, 208, 194, 0.76);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.run-record-image-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.run-record-image-preview img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: 8px;
  background: rgba(248, 244, 236, 0.86);
}

.run-record-detail-actions {
  justify-content: flex-end;
}

.run-record-detail-output {
  max-height: 460px;
  overflow: auto;
}

.run-record-diagnostic-card {
  border-left: 4px solid rgba(100, 116, 139, 0.55);
}

.run-record-diagnostic-card.failed {
  border-left-color: #9f2d20;
  background: rgba(159, 45, 32, 0.06);
}

.run-record-diagnostic-card.slow {
  border-left-color: var(--gold);
  background: rgba(198, 151, 73, 0.08);
}

.run-record-diagnostic-card.normal {
  border-left-color: var(--jade);
}

.run-record-diagnostic-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.run-record-diagnostic-summary h3,
.run-record-diagnostic-summary p {
  margin: 0;
}

.run-record-diagnostic-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 18px;
}

.run-record-diagnostic-summary p,
.run-record-diagnostic-summary small {
  color: var(--muted);
  line-height: 22px;
}

.run-record-diagnostic-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.image-run-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.image-run-record-grid figure {
  position: relative;
  min-height: 180px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(248, 244, 236, 0.82);
}

.image-run-record-grid img {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  display: block;
  object-fit: cover;
}

.image-run-record-grid figcaption {
  position: absolute;
  inset: auto 8px 8px 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.image-run-record-grid figure:hover figcaption,
.image-run-record-grid figure:focus-within figcaption {
  opacity: 1;
  transform: translateY(0);
}

.image-run-record-grid button,
.image-run-record-grid a {
  min-height: 34px;
  padding: 7px 11px;
  color: #fff;
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  border: 0;
  border-radius: var(--radius);
  background: rgba(11, 18, 32, 0.78);
  cursor: pointer;
}

.copy-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 4px;
}

.result-primary-actions {
  align-items: center;
}

.result-main-action {
  min-width: 132px;
}

.result-more-actions {
  position: relative;
}

.result-more-actions summary {
  min-height: 34px;
  padding: 7px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  list-style: none;
}

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

.result-more-actions div,
.result-reuse-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.result-more-actions div {
  margin-top: 8px;
}

.result-more-actions:not([open]) div {
  display: none;
}

.result-reuse-actions {
  margin: 4px 0 10px;
}

.copy-notice {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
}

.copy-notice.error {
  color: var(--danger);
}

.shortvideo-next-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid rgba(11, 18, 32, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.shortvideo-image-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid rgba(198, 161, 91, 0.36);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.72);
}

.shortvideo-next-actions span {
  color: var(--muted);
  font-size: 13px;
}

.shortvideo-image-actions span {
  color: var(--muted);
  font-size: 13px;
}

.shortvideo-visual-panel {
  display: grid;
  gap: 14px;
  max-width: 960px;
  padding: 16px;
  margin: 14px 0 18px;
  border: 1px solid rgba(35, 107, 99, 0.22);
  border-radius: var(--radius);
  background: rgba(242, 249, 247, 0.7);
}

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

.shortvideo-visual-head h3 {
  margin: 0 0 4px;
}

.shortvideo-visual-head p,
.shortvideo-visual-reference small,
.shortvideo-visual-status,
.shortvideo-visual-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.shortvideo-visual-reference {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
}

.shortvideo-visual-reference label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.shortvideo-visual-reference input {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.shortvideo-visual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shortvideo-visual-status {
  min-height: 20px;
}

.shortvideo-visual-result-grid {
  display: grid;
  gap: 12px;
}

.shortvideo-visual-result {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.shortvideo-visual-result.failed {
  border-color: rgba(190, 75, 75, 0.34);
  background: rgba(255, 242, 242, 0.72);
}

.shortvideo-visual-result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
}

.shortvideo-visual-result-head span {
  color: var(--muted);
  white-space: nowrap;
}

.shortvideo-visual-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.shortvideo-asset-table {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.shortvideo-video-package {
  padding-top: 8px;
}

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

.shortvideo-asset-table-head h4 {
  margin: 0 0 4px;
}

.shortvideo-asset-table-head p,
.shortvideo-asset-notice {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

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

.shortvideo-asset-table-scroll {
  overflow-x: auto;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.shortvideo-asset-table table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
}

.shortvideo-asset-table th,
.shortvideo-asset-table td {
  max-width: 280px;
  padding: 10px;
  border-bottom: 1px solid rgba(216, 208, 194, 0.7);
  text-align: left;
  vertical-align: top;
  line-height: 18px;
}

.shortvideo-asset-table th {
  color: var(--ink);
  background: rgba(242, 249, 247, 0.85);
  font-weight: 800;
  white-space: nowrap;
}

.shortvideo-asset-table td {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.shortvideo-visual-thumbs figure {
  display: grid;
  gap: 8px;
  margin: 0;
}

.shortvideo-visual-thumbs img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: #fff;
}

.shortvideo-visual-thumbs figcaption {
  display: flex;
  justify-content: flex-end;
  font-size: 12px;
}

.shortvideo-visual-thumbs a {
  color: var(--jade);
  font-weight: 800;
}

.shortvideo-visual-error {
  margin: 0;
  color: #a33d3d;
  font-size: 13px;
  line-height: 20px;
}

.history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.history-header h2 {
  margin-bottom: 0;
}

.history-item {
  display: grid;
  gap: 8px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.history-item.selected {
  border-color: rgba(198, 161, 91, 0.62);
  background: rgba(255, 248, 232, 0.62);
}

.history-item-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--gold-dark);
  flex: 0 0 auto;
}

.history-item strong {
  font-size: 14px;
}

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

.history-item-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
}

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

.history-meta-row span {
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(216, 208, 194, 0.76);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.36);
}

.favorite-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
  white-space: nowrap;
}

.favorite-pill.active {
  color: var(--ink);
  border-color: rgba(198, 161, 91, 0.52);
  background: #fff8e8;
}

.retention-pill.favorite {
  color: var(--ink);
  border-color: rgba(198, 161, 91, 0.52);
  background: #fff8e8;
}

.retention-pill.soon {
  color: #7c3f13;
  border-color: rgba(198, 151, 73, 0.54);
  background: rgba(255, 248, 232, 0.9);
}

.retention-pill.expired {
  color: #9f2d20;
  border-color: rgba(159, 45, 32, 0.26);
  background: rgba(255, 244, 241, 0.72);
}

.history-revision-pill {
  color: #31445b;
  border-color: rgba(21, 43, 68, 0.28) !important;
  background: rgba(239, 245, 249, 0.82) !important;
}

.history-revision-pill.active {
  color: #6d4c14;
  border-color: rgba(198, 161, 91, 0.56) !important;
  background: rgba(255, 248, 232, 0.9) !important;
}

.history-content-pill {
  color: #3d4b5c;
  border-color: rgba(61, 75, 92, 0.24) !important;
  background: rgba(247, 250, 252, 0.86) !important;
}

.history-feedback-pill {
  color: #6f4b17;
  border-color: rgba(198, 161, 91, 0.5) !important;
  background: rgba(255, 248, 232, 0.86) !important;
}

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

.history-source-button {
  border-color: rgba(198, 161, 91, 0.62);
  background: rgba(255, 248, 232, 0.78);
}

.revision-compare-button {
  border-color: rgba(21, 43, 68, 0.32);
  background: rgba(239, 245, 249, 0.82);
}

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

.revision-source-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.revision-source-note p {
  color: var(--muted);
  line-height: 24px;
}

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

.revision-child-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
  cursor: pointer;
}

.revision-child-item:hover {
  border-color: rgba(198, 161, 91, 0.72);
  background: rgba(255, 248, 232, 0.88);
}

.revision-child-item strong {
  font-size: 15px;
}

.revision-child-item span,
.revision-child-item small {
  color: var(--muted);
  font-size: 12px;
}

.revision-child-reason {
  color: #6d4b16 !important;
}

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

.revision-compare-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.76);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.revision-compare-head {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.revision-compare-head h3 {
  margin: 0;
}

.revision-compare-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.history-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(132px, 0.7fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(216, 208, 194, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
}

.history-filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.history-filter-bar input,
.history-filter-bar select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  color: var(--ink);
  border: 1px solid rgba(207, 196, 177, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  outline: none;
}

.history-filter-bar input:focus,
.history-filter-bar select:focus {
  border-color: rgba(198, 161, 91, 0.72);
  box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.16);
}

.history-filter-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 40px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.history-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid rgba(216, 208, 194, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.44);
}

.history-bulk-select-all,
.history-bulk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.history-bulk-select-all {
  color: var(--ink);
  font-weight: 800;
}

.history-bulk-select-all input {
  width: 18px;
  height: 18px;
  accent-color: var(--gold-dark);
}

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

.btn.danger {
  color: #8b2b20;
  border-color: rgba(159, 45, 32, 0.28);
  background: rgba(255, 244, 241, 0.72);
}

.history-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.history-detail-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.history-detail-card h3 {
  margin-bottom: 12px;
}

.history-detail-collapsible {
  padding: 0;
  overflow: hidden;
}

.history-detail-collapsible summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  list-style: none;
  cursor: pointer;
}

.history-detail-collapsible summary::-webkit-details-marker {
  display: none;
}

.history-detail-collapsible summary span {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.history-detail-collapsible summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-detail-collapsible[open] summary {
  border-bottom: 1px solid var(--line);
}

.history-detail-collapsible[open] summary small {
  color: #8a641f;
}

.history-detail-collapsible[open] summary small::before {
  content: "已展开 · ";
}

.history-detail-collapsible:not([open]) summary small::before {
  content: "默认收起 · ";
}

.history-detail-collapsible-body {
  padding: 16px;
}

.history-detail-wide {
  grid-column: 1 / -1;
}

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

.history-detail-grid div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.44);
}

.history-detail-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.history-detail-grid dd {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  line-height: 22px;
}

.history-empty-note {
  color: var(--muted);
  line-height: 24px;
}

.history-meta {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.login-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
}

.login-dialog::backdrop {
  background: rgba(8, 17, 31, 0.72);
  backdrop-filter: blur(8px);
}

.login-card {
  position: relative;
  padding: 32px;
  border-top: 3px solid var(--gold);
}

.login-card h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 32px;
}

.login-copy {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.login-error {
  margin: -4px 0 16px;
  color: #9f2d20;
  font-size: 13px;
  line-height: 20px;
}

.login-error[data-state="success"] {
  color: #236b63;
}

.login-action-stack {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.login-card textarea {
  min-height: 88px;
  resize: vertical;
}

.email-reset-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.login-divider {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf0;
  cursor: pointer;
}

.future-login {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.future-login span {
  min-height: 28px;
  padding: 5px 10px;
  color: #968c7f;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f4efe5;
}

.image-chat-open-button {
  white-space: nowrap;
}

.image-chat-shell {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 17, 31, 0.64);
  backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.image-chat-modal {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1280px, calc(100vw - 28px));
  height: min(92dvh, 940px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(251, 248, 241, 0.92), rgba(228, 240, 237, 0.84)),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 32px 90px rgba(8, 17, 31, 0.34);
  backdrop-filter: blur(24px);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.image-chat-shell.is-open .image-chat-backdrop,
.image-chat-shell.is-open .image-chat-modal {
  opacity: 1;
}

.image-chat-shell.is-open .image-chat-modal {
  transform: translateY(0) scale(1);
}

body[data-app-route="image-workbench"] .image-chat-shell {
  z-index: 500;
  place-items: stretch;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 220px),
    #eef3f1;
}

body[data-app-route="image-workbench"] .image-chat-backdrop,
body[data-app-route="image-workbench"] .image-chat-close {
  display: none;
}

body[data-app-route="image-workbench"] .image-chat-modal {
  width: 100%;
  height: 100dvh;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

body[data-app-route="image-workbench"] .image-chat-shell.is-open .image-chat-modal {
  transform: none;
}

.image-chat-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px 10px;
}

.image-chat-header h2 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 28px;
}

.image-chat-close {
  position: static;
  flex: 0 0 auto;
}

.image-chat-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-bottom: 1px solid rgba(216, 208, 194, 0.76);
  background: rgba(251, 248, 241, 0.36);
}

.image-chat-tabs button {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(23, 99, 88, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.image-chat-tabs button.active {
  background: #176358;
  color: #fff;
}

.image-chat-tabs [data-image-history-refresh] {
  margin-left: auto;
  color: #176358;
  border-color: rgba(23, 99, 88, 0.16);
  background: rgba(255, 255, 255, 0.44);
}

.image-chat-tabs [data-image-config-check] {
  color: #8c6b2d;
  border-color: rgba(140, 107, 45, 0.22);
  background: rgba(255, 247, 224, 0.62);
}

.image-chat-stream {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 16px 24px;
  overflow-y: auto;
}

.image-chat-empty {
  display: grid;
  align-content: center;
  min-height: 100%;
  color: var(--muted);
  text-align: center;
}

.image-chat-empty strong {
  color: var(--ink);
  font-size: 18px;
}

.image-chat-empty p {
  max-width: 420px;
  margin: 8px auto 0;
  line-height: 24px;
}

.image-chat-message {
  display: flex;
}

.image-chat-message.user {
  justify-content: flex-end;
}

.image-chat-message.assistant {
  justify-content: flex-start;
}

.image-chat-bubble {
  width: fit-content;
  max-width: min(1040px, 100%);
  padding: 14px 16px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(8, 17, 31, 0.08);
}

.image-chat-message.assistant .image-chat-bubble:not(.image-chat-loading-card):not(.image-chat-error) {
  width: min(1040px, 100%);
}

.image-chat-message.user .image-chat-bubble {
  color: #fff;
  border-color: rgba(35, 107, 99, 0.22);
  background: linear-gradient(135deg, #236b63, #174c47);
}

.image-chat-bubble p {
  margin: 0;
  line-height: 24px;
}

.image-chat-bubble small {
  display: inline-flex;
  margin-top: 8px;
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
}

.image-chat-error {
  color: #8c1d18;
  border-color: rgba(159, 45, 32, 0.2);
  background: #fff4f1;
}

.image-chat-loading-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.image-chat-loading-card span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--jade);
  animation: image-chat-pulse 900ms ease-in-out infinite;
}

.image-chat-loading-card span:nth-child(2) {
  animation-delay: 120ms;
}

.image-chat-loading-card span:nth-child(3) {
  animation-delay: 240ms;
}

.image-chat-loading-card p {
  color: var(--muted);
  font-size: 13px;
}

@keyframes image-chat-pulse {
  0%,
  100% {
    opacity: 0.32;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.image-chat-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  width: 100%;
  margin-top: 12px;
}

.image-chat-result-item {
  position: relative;
  min-height: 260px;
  aspect-ratio: auto;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(8, 17, 31, 0.1);
  border-radius: 12px;
  background: #efe9dc;
}

.image-chat-result-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 8px;
}

.image-chat-result-item figcaption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  background: rgba(8, 17, 31, 0.54);
  opacity: 0;
  transition: opacity 160ms ease;
}

.image-chat-result-item:hover figcaption,
.image-chat-result-item:focus-within figcaption {
  opacity: 1;
}

.image-chat-result-item button,
.image-chat-result-item a {
  min-height: 34px;
  padding: 7px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

.image-chat-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.image-chat-inline-actions button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(23, 99, 88, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  color: #176358;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

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

.image-history-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(120px, 0.7fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(216, 208, 194, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.image-history-toolbar label {
  margin: 0;
}

.image-history-toolbar span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-history-toolbar input,
.image-history-toolbar select {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid rgba(216, 208, 194, 0.95);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.image-history-toolbar button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(23, 99, 88, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  color: #176358;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.image-history-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.image-history-filter-empty {
  min-height: 260px;
  border: 1px dashed rgba(216, 208, 194, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
}

.image-history-card {
  padding: 14px;
  border: 1px solid rgba(216, 208, 194, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

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

.image-history-card-head strong {
  display: block;
  color: var(--ink);
}

.image-history-card-head small,
.image-history-negative {
  color: var(--muted);
  font-size: 12px;
}

.image-history-card p {
  margin: 10px 0 0;
}

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

.image-history-thumb {
  position: relative;
  min-height: 180px;
  aspect-ratio: auto;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(8, 17, 31, 0.1);
  border-radius: 10px;
  background: #efe9dc;
}

.image-history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 6px;
}

.image-history-thumb figcaption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(8, 17, 31, 0.56);
  opacity: 0;
  transition: opacity 160ms ease;
}

.image-history-thumb:hover figcaption,
.image-history-thumb:focus-within figcaption {
  opacity: 1;
}

.image-history-card button,
.image-history-thumb a {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(23, 99, 88, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  color: #176358;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.image-history-thumb button,
.image-history-thumb a {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
}

.image-history-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}

.image-chat-console {
  display: grid;
  gap: 8px;
  padding: 10px 24px 12px;
  border-top: 1px solid rgba(216, 208, 194, 0.76);
  background: rgba(251, 248, 241, 0.86);
}

.image-chat-shell[data-mode="history"] .image-chat-console {
  display: none;
}

.image-chat-console label {
  margin: 0;
}

.image-chat-console label > span {
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 16px;
}

.image-chat-control-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}

.image-chat-essential-row {
  display: grid;
  grid-template-columns: minmax(132px, 0.42fr) minmax(220px, 1fr);
  gap: 8px;
  align-items: stretch;
}

.image-chat-extra-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(240px, 1.28fr);
  gap: 8px;
  align-items: stretch;
}

.image-chat-advanced {
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.image-chat-advanced summary {
  min-height: 36px;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.image-chat-advanced[open] {
  padding-bottom: 10px;
}

.image-chat-advanced:not([open]) > :not(summary) {
  display: none;
}

.image-chat-advanced[open] summary {
  margin-bottom: 8px;
}

.image-chat-advanced .image-chat-assist-row,
.image-chat-advanced .image-chat-control-row,
.image-chat-advanced .image-chat-negative-label,
.image-chat-advanced .image-template-manager {
  margin: 0 10px 8px;
}

.image-chat-assist-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto auto;
  align-items: end;
  gap: 8px;
}

.image-chat-assist-row.is-primary {
  padding: 8px;
  border: 1px solid rgba(198, 161, 91, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.image-chat-assist-row button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.image-chat-notify-toggle {
  min-height: 34px;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.image-chat-notify-toggle input {
  margin: 0;
}

.image-chat-notify-toggle span {
  margin: 0 !important;
  white-space: nowrap;
}

.image-template-manager {
  max-height: 178px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(216, 208, 194, 0.86);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
}

.image-template-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.image-template-manager-head strong {
  font-size: 13px;
}

.image-template-manager button,
.image-template-actions button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

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

.image-template-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(216, 208, 194, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.image-template-item strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 18px;
}

.image-template-item p,
.image-template-item span,
.image-template-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.image-template-item span {
  display: block;
  margin-top: 2px;
}

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

.image-template-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.image-template-dialog[hidden] {
  display: none;
}

.image-template-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 28, 0.36);
  backdrop-filter: blur(10px);
}

.image-template-dialog-panel {
  position: relative;
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(216, 208, 194, 0.84);
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.94);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.image-template-dialog-panel header,
.image-template-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-template-dialog-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 28px;
}

.image-template-dialog-panel label {
  display: grid;
  gap: 6px;
}

.image-template-dialog-panel input {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

.image-template-dialog-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.image-template-dialog-actions {
  justify-content: flex-end;
}

.image-template-dialog-actions button:not(.btn) {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.image-chat-reference-label,
.image-chat-negative-label {
  display: grid;
  align-content: start;
  gap: 6px;
}

.image-chat-reference-label input[type="file"] {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font: inherit;
}

.file-input-panel.managed-file-upload,
.knowledge-file-field.managed-file-upload,
.image-chat-reference-label.managed-file-upload,
.shortvideo-visual-reference label.managed-file-upload {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 156px;
  padding: 18px;
  border: 2px dashed rgba(15, 118, 110, 0.34);
  border-radius: var(--radius);
  background: rgba(247, 250, 248, 0.86);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.file-input-panel.managed-file-upload:hover,
.knowledge-file-field.managed-file-upload:hover,
.image-chat-reference-label.managed-file-upload:hover,
.shortvideo-visual-reference label.managed-file-upload:hover,
.managed-file-upload.dragging {
  border-color: rgba(15, 118, 110, 0.68);
  background: rgba(240, 250, 247, 0.96);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.managed-file-upload > input[type="file"],
.image-chat-reference-label.managed-file-upload > input[type="file"],
.knowledge-file-field.managed-file-upload > input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.managed-upload-face {
  display: grid;
  place-items: center;
  min-height: 96px;
  padding: 16px;
  text-align: center;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.managed-upload-face strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 22px;
}

.managed-upload-face span,
.managed-file-upload > span,
.managed-file-upload > small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.managed-upload-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  cursor: default;
}

.managed-upload-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-left: 4px solid rgba(15, 118, 110, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.managed-upload-card.uploading {
  border-left-color: var(--jade);
}

.managed-upload-card.completed {
  border-left-color: #15803d;
}

.managed-upload-card.error {
  border-left-color: #b42318;
  background: rgba(255, 247, 246, 0.92);
}

.managed-upload-card-head,
.managed-upload-card-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.managed-upload-card-head strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 19px;
  overflow-wrap: anywhere;
}

.managed-upload-card-head span,
.managed-upload-card-foot span,
.managed-upload-card-foot p,
.managed-upload-card-head em {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.managed-upload-card-head em {
  flex: 0 0 auto;
  font-style: normal;
  font-weight: 800;
  color: var(--jade);
}

.managed-upload-card.error .managed-upload-card-head em {
  color: #b42318;
}

.managed-upload-card.completed .managed-upload-card-head em {
  color: #15803d;
}

.managed-upload-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(216, 208, 194, 0.72);
}

.managed-upload-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jade), #2f9f83);
  transition: width 0.18s ease;
}

.managed-upload-card.error .managed-upload-progress span {
  background: #b42318;
}

.managed-upload-card-foot {
  align-items: center;
}

.managed-upload-card-foot p {
  flex: 1 1 auto;
  margin: 0;
}

.managed-upload-card .mini-action {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(216, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
}

.image-chat-reference-preview {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(216, 208, 194, 0.88);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.image-chat-reference-preview img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee7d8;
}

.image-chat-reference-preview button {
  justify-self: start;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  cursor: pointer;
}

.image-chat-negative-label textarea {
  min-height: 52px;
  max-height: 84px;
  padding: 8px 10px;
  line-height: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.image-chat-prompt-label textarea {
  min-height: 64px;
  max-height: 116px;
  padding: 8px 10px;
  line-height: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.image-chat-console-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.image-chat-status {
  display: none;
}

.image-chat-status.is-error {
  color: #9f2d20;
}

.image-chat-send {
  flex: 0 0 auto;
  min-width: 96px;
}

.image-chat-lightbox {
  position: fixed;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 56px 24px 32px;
  background: rgba(8, 17, 31, 0.88);
}

.image-chat-lightbox img {
  max-width: min(96vw, 1440px);
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
}

.image-chat-lightbox .btn {
  margin-top: 18px;
}

.image-chat-lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 980px) {
  .site-header {
    width: calc(100% - 24px);
  }

  .top-nav {
    display: none;
  }

  .hero-section,
  .section-heading,
  .profile-layout,
  .workspace-grid,
  .studio-body {
    grid-template-columns: 1fr;
  }

  .studio-topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-card-grid,
  .editor-grid,
  .workflow-mode-options,
  .image-policy-grid,
  .image-asset-metrics,
  .image-usage-metrics,
  .image-usage-grid,
  .api-console-metrics,
  .api-console-grid,
  .api-console-policy-list,
  .dashboard-tool-grid,
  .content-hub-grid,
  .tool-config-grid,
  .tool-integration-list,
  .user-create-grid,
  .user-management-filters,
  .user-bulk-panel,
  .user-management-item,
  .password-reset-item,
  .audit-log-filters,
  .audit-log-item,
  .revision-compare-grid,
  .history-filter-bar,
  .history-detail-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    display: grid;
  }

  .content-hub-header,
  .content-hub-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .shortvideo-visual-head,
  .shortvideo-visual-reference {
    grid-template-columns: 1fr;
  }

  .shortvideo-visual-head {
    display: grid;
  }

  .hero-section {
    padding-top: 128px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .hero-subtitle {
    max-width: 680px;
  }

  .hero-panel {
    align-self: auto;
  }

  .tool-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .sidebar-note {
    margin-top: 24px;
  }
}

@media (max-width: 640px) {
  .hero-section,
  .section-wrap,
  .profile-band,
  .studio-topbar,
  .workspace {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tool-grid,
  .field-grid,
  .profile-card-grid,
  .editor-grid,
  .account-identity-form,
  .image-policy-grid,
  .image-asset-metrics,
  .image-usage-metrics,
  .image-usage-grid,
  .api-console-metrics,
  .api-console-grid,
  .api-console-policy-list,
  .user-create-grid,
  .user-management-filters,
  .user-bulk-panel,
  .user-management-item,
  .email-verify-row,
  .password-reset-item {
    grid-template-columns: 1fr;
  }

  .workspace-header {
    display: grid;
  }

  .site-actions {
    gap: 8px;
  }

  .site-actions .btn {
    min-height: 36px;
    padding: 0 12px;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .hero-subtitle {
    max-width: 100%;
  }

  .profile-details {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .profile-photo-frame {
    width: min(180px, 100%);
    order: 2;
    min-height: 96px;
  }

  .history-header {
    display: grid;
  }

  .backup-item {
    display: grid;
  }

  .run-record-item,
  .api-console-recent-item,
  .audit-log-filters,
  .audit-log-item,
  .run-record-diagnostic-summary {
    grid-template-columns: 1fr;
  }

  .run-record-meta,
  .run-record-diagnostic-actions {
    justify-content: flex-start;
  }

  .workflow-secondary-settings summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-recent-item {
    display: grid;
  }

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

  .history-bulk-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .revision-source-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .revision-source-actions {
    justify-content: flex-start;
  }

  .history-detail-wide {
    grid-column: auto;
  }

  .shortvideo-section-head,
  .shortvideo-control-grid-basic,
  .shortvideo-template-grid {
    grid-template-columns: 1fr;
  }

  .template-actions {
    grid-template-columns: 1fr auto 34px;
  }

  .template-actions .mini-action-button {
    padding: 0 10px;
  }

  .shortvideo-reference-list {
    grid-template-columns: 1fr;
  }

  .image-chat-shell {
    padding: 0;
  }

  .image-chat-modal {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }

  .image-chat-header,
  .image-chat-tabs,
  .image-chat-stream,
  .image-chat-console {
    padding-left: 16px;
    padding-right: 16px;
  }

  .image-chat-control-row,
  .image-chat-essential-row,
  .image-chat-assist-row,
  .image-chat-extra-grid,
  .image-chat-result-grid {
    grid-template-columns: 1fr;
  }

  .image-history-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .history-detail-grid {
    grid-template-columns: 1fr;
  }

  .image-history-search {
    grid-column: 1 / -1;
  }

  .image-template-item {
    grid-template-columns: 1fr;
  }

  .image-template-actions {
    justify-content: flex-start;
  }

  .image-chat-result-item,
  .image-history-thumb {
    min-height: 220px;
  }

  .image-chat-console-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .image-chat-send {
    width: 100%;
  }
}

.conversation-workflow-active .result-panel {
  height: 100%;
  color: var(--ink-3);
}

.conversation-workflow-active .result-panel p {
  margin: 0 0 10px;
}

.conversation-workflow-active .chat-message.user {
  max-width: none;
  margin-left: 0;
}

.conversation-workflow-active .result-body {
  margin-top: 14px;
  border-color: rgba(219, 227, 224, 0.8);
  background: rgba(255, 255, 255, 0.72);
}

.conversation-workflow-active .copy-actions {
  margin: 12px 0;
}

.conversation-workflow-active .ocr-trace-card,
.conversation-workflow-active .ocr-quality-card,
.conversation-workflow-active .shortvideo-visual-panel,
.conversation-workflow-active .wechat-image-actions,
.conversation-workflow-active .wechat-linked-images,
.conversation-workflow-active .uw-delivery-actions {
  max-width: none;
  margin: 14px 0 0;
}

.conversation-workflow-active .body-word-count {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .workspace-grid.conversation-mode {
    width: 100%;
  }

  .workspace-grid.conversation-mode .result-card {
    min-height: 56vh;
  }

  .workspace-grid.conversation-mode .form-card {
    bottom: auto;
    padding: 12px;
  }

  .workflow-chat {
    grid-template-rows: auto minmax(320px, 1fr);
  }

  .workflow-chat-topline,
  .chat-run-status,
  .chat-run-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-chat-topline small {
    max-width: none;
    text-align: left;
  }

  .workflow-chat-thread {
    max-height: 62vh;
    padding: 16px 12px 20px;
  }

  .chat-message {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
  }

  .chat-avatar {
    width: 30px;
    height: 30px;
  }

  .chat-bubble {
    padding: 13px;
  }

  .chat-input-summary {
    grid-template-columns: 1fr;
  }

  .chat-node-item summary {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .chat-node-item summary em {
    grid-column: 2;
  }

  .workspace-grid.conversation-mode #runWorkflowButton {
    width: 100%;
  }
}

/* Phase 2 visual refinement: calmer technical workbench polish. */
:root {
  --ink: #07111d;
  --ink-2: #102033;
  --ink-3: #243241;
  --text: #07111d;
  --ivory: #f6f8f7;
  --paper: #ffffff;
  --muted: #5f6c70;
  --line: #d8e1e0;
  --line-dark: rgba(229, 237, 236, 0.16);
  --gold: #c79a3c;
  --gold-dark: #805f1d;
  --jade: #0f766e;
  --jade-soft: #e4f4f1;
  --info: #2563eb;
  --info-soft: #eaf2ff;
  --accent-cyan: #0891b2;
  --accent-jade: #0f766e;
  --accent-amber: #b7791f;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-muted: rgba(244, 248, 247, 0.9);
  --border-soft: rgba(204, 216, 216, 0.82);
  --ring: 0 0 0 3px rgba(8, 145, 178, 0.14);
  --shadow: 0 18px 44px rgba(7, 17, 29, 0.12);
  --shadow-soft: 0 8px 22px rgba(7, 17, 29, 0.08);
  --radius: 8px;
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, #f6f8f7 0%, #edf3f2 52%, #f6f4ef 100%);
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  color: var(--ink);
  border-color: var(--border-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
select:hover,
textarea:hover {
  border-color: rgba(8, 145, 178, 0.36);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  border-color: rgba(8, 145, 178, 0.62);
  box-shadow: var(--ring);
}

.btn,
.tab,
.studio-section-link,
.side-link,
.dashboard-tool-card,
.content-hub-card,
.history-item,
.run-record-item,
.image-history-card,
.image-chat-tabs button,
.image-chat-inline-actions button {
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.btn-primary,
#runWorkflowButton,
.image-chat-send {
  color: #ffffff;
  border-color: rgba(8, 145, 178, 0.48);
  background: linear-gradient(135deg, #0f766e 0%, #0891b2 58%, #2563eb 100%);
  box-shadow: 0 14px 28px rgba(8, 145, 178, 0.18);
}

.btn-primary:hover,
#runWorkflowButton:hover,
.image-chat-send:hover {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 18px 34px rgba(8, 145, 178, 0.24);
}

.btn-secondary,
.user-badge,
.tab,
.studio-section-link {
  color: var(--ink-2);
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.78);
}

.btn-secondary:hover,
.user-badge:hover,
.tab:hover,
.studio-section-link:hover {
  border-color: rgba(8, 145, 178, 0.28);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.brand-mark {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 42%),
    linear-gradient(135deg, #0f766e 0%, #0891b2 56%, #c79a3c 100%);
  box-shadow: 0 10px 24px rgba(8, 145, 178, 0.18);
}

.studio-view {
  background:
    linear-gradient(rgba(7, 17, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 17, 29, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #f7f9f8 0%, #eef4f3 52%, #f7f5ef 100%);
  background-size: 32px 32px, 32px 32px, auto;
}

.studio-topbar {
  min-height: 70px;
  padding: 12px 28px;
  border-bottom-color: rgba(205, 218, 218, 0.88);
  background: rgba(250, 252, 252, 0.9);
  box-shadow: 0 10px 28px rgba(7, 17, 29, 0.06);
  backdrop-filter: blur(18px);
}

.studio-section-nav {
  gap: 4px;
  border-color: rgba(205, 218, 218, 0.86);
  background: rgba(240, 245, 244, 0.82);
}

.studio-section-link.active,
.tab.active {
  color: var(--accent-cyan);
  border-color: rgba(8, 145, 178, 0.34);
  background: #ffffff;
  box-shadow: inset 0 -2px 0 rgba(8, 145, 178, 0.72), var(--shadow-soft);
}

.studio-body {
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: calc(100vh - 70px);
}

.studio-body.sidebar-collapsed {
  grid-template-columns: 56px minmax(0, 1fr);
}

.sidebar {
  top: 70px;
  height: calc(100vh - 70px);
  padding: 22px 18px;
  color: #f7faf9;
  border-right: 1px solid rgba(229, 237, 236, 0.1);
  background:
    linear-gradient(135deg, rgba(8, 145, 178, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(15, 118, 110, 0.12), rgba(183, 121, 31, 0.08) 46%, transparent 78%),
    #0b121d;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar-panel-title {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom-color: rgba(229, 237, 236, 0.14);
}

.sidebar-panel-title small,
.sidebar-note p,
.side-link,
.sidebar-api-link small {
  color: rgba(233, 241, 241, 0.68);
}

.sidebar-toggle-button,
.side-link.utility,
.sidebar-api-link {
  color: #f7faf9;
  border-color: rgba(229, 237, 236, 0.14);
  background: rgba(255, 255, 255, 0.055);
}

.side-group-title {
  color: rgba(125, 211, 252, 0.78);
  letter-spacing: 0;
}

.side-group[hidden] {
  display: none !important;
}

.side-subgroup-title {
  margin-top: 12px;
  color: rgba(233, 241, 241, 0.5);
  font-size: 11px;
  font-weight: 800;
}

.side-group .side-subgroup-title:first-child {
  margin-top: 0;
}

.side-link {
  min-height: 40px;
  padding-left: 16px;
}

.side-link:hover {
  color: #ffffff;
  border-color: rgba(125, 211, 252, 0.22);
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(1px);
}

.side-link.active {
  color: #ffffff;
  border-color: rgba(8, 145, 178, 0.38);
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.2), rgba(37, 99, 235, 0.08));
  box-shadow: inset 3px 0 0 rgba(34, 211, 238, 0.96);
}

.side-link.active::before {
  display: none;
}

.sidebar-note {
  border-color: rgba(229, 237, 236, 0.13);
  background: rgba(255, 255, 255, 0.055);
}

.workspace {
  padding: 30px;
}

.workspace-header,
.workspace-grid {
  width: min(100%, 1240px);
}

.workspace-header {
  margin-bottom: 22px;
}

.workspace-header h1 {
  color: var(--ink);
  font-size: 30px;
  line-height: 38px;
}

.workspace-header .eyebrow,
.result-panel .eyebrow,
.card-heading span,
label > span,
.image-chat-console label > span {
  color: var(--muted);
  letter-spacing: 0;
}

.workspace-grid {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 18px;
}

.form-card,
.result-card,
.dashboard-hero,
.dashboard-recent,
.dashboard-running,
.content-hub-header,
.content-hub-card,
.run-status-card,
.run-record-item,
.history-item,
.image-history-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.form-card,
.result-card {
  padding: 22px;
}

.card-heading {
  margin-bottom: 18px;
}

.card-heading h2 {
  color: var(--ink);
  font-size: 19px;
  line-height: 27px;
}

.tabs {
  gap: 6px;
  padding-bottom: 14px;
  border-bottom-color: rgba(205, 218, 218, 0.86);
}

.tab {
  min-height: 34px;
  padding: 0 12px;
}

.result-body,
.result-panel {
  color: var(--ink-3);
}

.dashboard-panel {
  gap: 22px;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 247, 246, 0.84) 55%, rgba(255, 247, 229, 0.62)),
    #ffffff;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 145, 178, 0.16), transparent 38%),
    linear-gradient(rgba(7, 17, 29, 0.045) 1px, transparent 1px);
  background-size: auto, 100% 18px;
}

.dashboard-hero > * {
  position: relative;
}

.dashboard-hero h2 {
  color: var(--ink);
  font-size: 26px;
  line-height: 34px;
}

.dashboard-card-meta span,
.content-hub-meta span,
.chip.jade {
  color: var(--accent-jade);
  border-color: rgba(15, 118, 110, 0.2);
  background: rgba(228, 244, 241, 0.82);
}

.dashboard-tool-card,
.content-hub-card {
  min-height: 150px;
  background: rgba(255, 255, 255, 0.8);
}

.dashboard-tool-card:hover,
.content-hub-card:hover,
.history-item:hover,
.run-record-item:hover,
.image-history-card:hover {
  border-color: rgba(8, 145, 178, 0.38);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.dashboard-tool-card.primary,
.content-hub-card.primary {
  border-color: rgba(8, 145, 178, 0.34);
  background:
    linear-gradient(135deg, rgba(232, 247, 246, 0.92), rgba(255, 255, 255, 0.9));
}

.dashboard-tool-card strong,
.content-hub-card strong {
  color: var(--ink);
}

.dashboard-tool-card small,
.content-hub-card p,
.dashboard-recent-item span,
.dashboard-running-item span,
.dashboard-running-item small {
  color: var(--muted);
}

.dashboard-card-icon {
  color: var(--accent-cyan);
  border-color: rgba(8, 145, 178, 0.24);
  background: rgba(232, 247, 246, 0.78);
}

.dashboard-running {
  border-color: rgba(15, 118, 110, 0.2);
  background: rgba(236, 247, 245, 0.72);
}

.dashboard-running-item,
.dashboard-recent-item,
.image-history-toolbar,
.image-template-item,
.managed-upload-card,
.image-chat-reference-preview {
  border-color: var(--border-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
}

.run-status-card {
  background:
    linear-gradient(135deg, rgba(236, 247, 245, 0.86), rgba(255, 255, 255, 0.86));
}

.copy-actions .btn,
.mini-action-button,
.image-template-manager button,
.image-template-actions button,
.image-chat-assist-row button,
.image-history-card button,
.image-history-toolbar button,
.managed-upload-card .mini-action {
  border-color: var(--border-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.image-chat-backdrop {
  background: rgba(7, 17, 29, 0.72);
  backdrop-filter: blur(16px);
}

.image-chat-modal {
  border: 1px solid rgba(229, 237, 236, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(250, 252, 252, 0.98), rgba(240, 246, 245, 0.96)),
    #ffffff;
  box-shadow: 0 30px 82px rgba(7, 17, 29, 0.34);
}

body[data-app-route="image-workbench"] .image-chat-shell {
  background:
    linear-gradient(rgba(7, 17, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 17, 29, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #f7f9f8 0%, #eef4f3 56%, #f7f5ef 100%);
  background-size: 32px 32px, 32px 32px, auto;
}

body[data-app-route="image-workbench"] .image-chat-modal {
  border-radius: 0;
  background: transparent;
}

.image-chat-header {
  padding: 16px 28px 12px;
  border-bottom: 1px solid rgba(205, 218, 218, 0.72);
  background: rgba(255, 255, 255, 0.56);
}

.image-chat-header h2 {
  color: var(--ink);
  font-size: 21px;
  line-height: 28px;
}

.image-chat-tabs {
  gap: 6px;
  padding: 9px 28px;
  border-bottom-color: rgba(205, 218, 218, 0.76);
  background: rgba(248, 251, 250, 0.82);
}

.image-chat-tabs button {
  min-height: 32px;
  color: var(--muted);
  border-color: var(--border-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.image-chat-tabs button.active {
  color: #ffffff;
  border-color: rgba(8, 145, 178, 0.46);
  background: linear-gradient(135deg, #0f766e, #0891b2);
  box-shadow: 0 10px 22px rgba(8, 145, 178, 0.16);
}

.image-chat-tabs [data-image-history-refresh],
.image-chat-tabs [data-image-config-check] {
  color: var(--accent-cyan);
  border-color: rgba(8, 145, 178, 0.2);
  background: rgba(255, 255, 255, 0.76);
}

.image-chat-stream {
  padding: 18px 28px;
}

.image-chat-bubble {
  border-color: var(--border-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
}

.image-chat-message.user .image-chat-bubble {
  color: #ffffff;
  border-color: rgba(8, 145, 178, 0.26);
  background: linear-gradient(135deg, #0f766e, #155e75);
}

.image-chat-loading-card span {
  background: var(--accent-cyan);
}

.image-chat-result-item,
.image-history-thumb {
  border-color: rgba(7, 17, 29, 0.1);
  border-radius: var(--radius);
  background: #f0f4f3;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
}

.image-chat-result-item figcaption,
.image-history-thumb figcaption {
  background: rgba(7, 17, 29, 0.62);
}

.image-chat-result-item button,
.image-chat-result-item a,
.image-history-thumb button,
.image-history-thumb a {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.18);
}

.image-chat-console {
  padding: 12px 28px 14px;
  border-top-color: rgba(205, 218, 218, 0.78);
  background: rgba(248, 251, 250, 0.94);
}

.image-chat-advanced,
.image-template-manager,
.managed-upload-face,
.image-template-dialog-panel,
.image-chat-lightbox img {
  border-radius: var(--radius);
}

.image-chat-assist-row.is-primary,
.file-input-panel.managed-file-upload,
.knowledge-file-field.managed-file-upload,
.image-chat-reference-label.managed-file-upload,
.shortvideo-visual-reference label.managed-file-upload {
  border-color: rgba(8, 145, 178, 0.26);
  background: rgba(244, 249, 248, 0.9);
}

.managed-upload-progress span {
  background: linear-gradient(90deg, var(--accent-jade), var(--accent-cyan));
}

@media (max-width: 980px) {
  .studio-topbar {
    min-height: 64px;
    padding: 10px 14px;
  }

  .studio-body {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .studio-body.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    max-height: none;
    padding: 14px;
  }

  .workspace {
    padding: 18px 14px 24px;
  }

  .workspace-header {
    flex-direction: column;
    gap: 14px;
  }

  .workspace-header h1 {
    font-size: 26px;
    line-height: 34px;
  }

  .workspace-grid,
  .workspace-grid.conversation-mode {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .dashboard-hero,
  .content-hub-header {
    flex-direction: column;
    gap: 14px;
  }

  .dashboard-tool-grid,
  .dashboard-primary-grid,
  .dashboard-secondary-grid,
  .content-hub-grid {
    grid-template-columns: 1fr;
  }

  .image-chat-header,
  .image-chat-tabs,
  .image-chat-stream,
  .image-chat-console {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Phase 2.1: high-star dashboard polish translated to the existing CSS stack. */
:root {
  --surface-hover: rgba(255, 255, 255, 0.96);
  --surface-subtle: rgba(247, 250, 250, 0.78);
  --state-success: #15803d;
  --state-warning: #b7791f;
  --state-danger: #b42318;
  --state-running: #0891b2;
  --control-height: 42px;
  --density-gap: 10px;
}

.btn,
.user-badge,
.chip,
.tab,
.studio-section-link,
.side-link,
.dashboard-card-meta span,
.dashboard-card-icon,
.content-hub-meta span,
.run-record-title span,
.run-record-image-meta span,
.image-chat-tabs button {
  white-space: nowrap;
}

.btn,
.dialog-close,
.mini-action-button,
.image-template-manager button,
.image-template-actions button,
.image-chat-assist-row button,
.image-history-card button,
.image-history-toolbar button,
.managed-upload-card .mini-action,
.image-chat-inline-actions button {
  min-height: var(--control-height);
  font-weight: 800;
}

.dialog-close {
  min-height: 34px;
}

.btn:active,
.dashboard-tool-card:active,
.content-hub-card:active,
.side-link:active,
.image-chat-tabs button:active {
  transform: translateY(0);
}

.login-dialog {
  width: min(456px, calc(100vw - 32px));
}

.login-dialog::backdrop {
  background:
    linear-gradient(180deg, rgba(7, 17, 29, 0.72), rgba(7, 17, 29, 0.82));
  backdrop-filter: blur(12px);
}

.login-card {
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(229, 237, 236, 0.82);
  border-top: 0;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 250, 0.96)),
    #ffffff;
  box-shadow: 0 28px 72px rgba(7, 17, 29, 0.34);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-jade), var(--accent-cyan), var(--accent-amber));
}

.login-card h2 {
  color: var(--ink);
  font-size: 23px;
  line-height: 31px;
}

.login-copy {
  margin-bottom: 22px;
}

.login-error {
  padding: 10px 12px;
  color: var(--state-danger);
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 241, 239, 0.84);
}

.login-error[hidden] {
  display: none;
}

.login-error[data-state="success"] {
  color: var(--state-success);
  border-color: rgba(21, 128, 61, 0.18);
  background: rgba(239, 253, 244, 0.86);
}

.login-action-stack {
  gap: 10px;
}

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

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: var(--border-soft);
}

.dialog-close {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
}

.dialog-close:hover {
  color: var(--ink);
  border-color: rgba(8, 145, 178, 0.28);
  background: #ffffff;
}

.workspace-header .chip,
.user-cluster .chip,
.user-badge {
  min-height: 34px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.workspace-header .eyebrow,
.result-panel .eyebrow,
.content-hub-card span,
.dashboard-card-icon,
.side-group-title {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 850;
}

.form-card,
.result-card {
  position: relative;
}

.form-card::before,
.result-card::before,
.dashboard-recent::before,
.dashboard-running::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(8, 145, 178, 0.24), transparent 60%);
  pointer-events: none;
}

.form-card,
.result-card,
.dashboard-recent,
.dashboard-running {
  overflow: hidden;
}

label {
  gap: 7px;
}

label > span,
.image-chat-console label > span,
.audit-log-filters label {
  font-size: 12px;
  font-weight: 820;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea,
.audit-log-filters input,
.audit-log-filters select,
.image-history-toolbar input,
.image-history-toolbar select {
  min-height: var(--control-height);
  padding: 9px 11px;
}

textarea {
  line-height: 1.58;
}

.dashboard-tool-card,
.content-hub-card {
  position: relative;
  overflow: hidden;
  align-content: start;
}

.dashboard-tool-card::before,
.content-hub-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(8, 145, 178, 0);
  transition: background 0.16s ease;
}

.dashboard-tool-card:hover::before,
.content-hub-card:hover::before,
.dashboard-tool-card.primary::before,
.content-hub-card.primary::before {
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-jade));
}

.dashboard-tool-card:hover,
.content-hub-card:hover {
  background: var(--surface-hover);
}

.dashboard-tool-card strong,
.content-hub-card strong,
.dashboard-recent-item strong,
.dashboard-running-item strong {
  font-weight: 850;
}

.dashboard-tool-card small,
.content-hub-card p {
  max-width: 34rem;
}

.dashboard-more-tools {
  border-color: var(--border-soft);
  background: var(--surface-subtle);
  box-shadow: var(--shadow-soft);
}

.dashboard-more-tools summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-more-tools summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--accent-cyan);
  border: 1px solid rgba(8, 145, 178, 0.22);
  border-radius: var(--radius);
  background: #ffffff;
}

.dashboard-more-tools[open] summary::after {
  content: "-";
}

.run-progress {
  height: 7px;
  background: rgba(210, 221, 221, 0.76);
}

.run-progress span {
  background: linear-gradient(90deg, var(--accent-jade), var(--accent-cyan), #60a5fa);
  box-shadow: 0 0 18px rgba(8, 145, 178, 0.28);
}

.run-status-head span,
.run-event-topline em,
.run-record-title span,
.run-record-image-meta span,
.history-meta {
  font-weight: 760;
}

.run-event-item,
.completed-run-log,
.audit-log-item,
.run-record-item,
.run-record-overview-card,
.history-detail-card,
.run-record-diagnostic-card {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.76);
}

.run-event-item.running,
.run-record-item.running,
.run-record-overview-card.running {
  border-left-color: var(--state-running);
}

.run-event-item.succeeded,
.run-record-item.succeeded,
.run-record-overview-card.succeeded,
.run-record-diagnostic-card.normal {
  border-left-color: var(--state-success);
}

.run-event-item.failed,
.run-record-item.failed,
.run-record-overview-card.failed,
.run-record-diagnostic-card.failed {
  border-left-color: var(--state-danger);
}

.run-event-summary,
.run-record-diagnostic-card.slow {
  border-color: rgba(183, 121, 31, 0.24);
  background: rgba(255, 248, 232, 0.68);
}

.run-record-overview-card:hover,
.run-record-overview-card:focus-visible,
.run-record-overview-card.active,
.run-record-item:hover,
.run-record-item:focus-visible {
  border-color: rgba(8, 145, 178, 0.36);
  background: var(--surface-hover);
  box-shadow: var(--shadow-soft);
}

.run-record-overview-card strong {
  font-size: 26px;
  line-height: 32px;
}

.copy-actions .btn,
.workflow-error-actions .btn,
.run-status-actions .btn,
.dashboard-running-actions .btn,
.image-chat-inline-actions button,
.image-history-card button,
.image-history-toolbar button,
.image-template-manager button,
.image-template-actions button,
.image-chat-assist-row button,
.managed-upload-card .mini-action {
  min-height: 34px;
  padding: 7px 11px;
}

.copy-actions .btn:hover,
.workflow-error-actions .btn:hover,
.run-status-actions .btn:hover,
.dashboard-running-actions .btn:hover,
.image-chat-inline-actions button:hover,
.image-history-card button:hover,
.image-history-toolbar button:hover,
.image-template-manager button:hover,
.image-template-actions button:hover,
.image-chat-assist-row button:hover,
.managed-upload-card .mini-action:hover {
  border-color: rgba(8, 145, 178, 0.32);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.image-chat-modal {
  isolation: isolate;
}

.image-chat-header,
.image-chat-tabs,
.image-chat-console {
  backdrop-filter: blur(14px);
}

.image-chat-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-jade), var(--accent-cyan), var(--accent-amber));
}

body[data-app-route="image-workbench"] .image-chat-header::before {
  height: 2px;
}

.image-chat-empty {
  border: 1px dashed rgba(8, 145, 178, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.image-chat-result-grid,
.image-history-grid,
.managed-upload-list {
  gap: 12px;
}

.image-chat-result-item,
.image-history-thumb,
.image-run-record-grid figure {
  background:
    linear-gradient(45deg, rgba(7, 17, 29, 0.035) 25%, transparent 25%, transparent 75%, rgba(7, 17, 29, 0.035) 75%),
    linear-gradient(45deg, rgba(7, 17, 29, 0.035) 25%, transparent 25%, transparent 75%, rgba(7, 17, 29, 0.035) 75%),
    #f3f6f6;
  background-position: 0 0, 10px 10px, 0 0;
  background-size: 20px 20px, 20px 20px, auto;
}

.image-chat-result-item img,
.image-history-thumb img {
  transition: transform 0.18s ease;
}

.image-chat-result-item:hover img,
.image-history-thumb:hover img {
  transform: scale(1.015);
}

.image-chat-console {
  box-shadow: 0 -10px 24px rgba(7, 17, 29, 0.05);
}

.image-chat-advanced {
  border-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.62);
}

.image-chat-advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.image-chat-advanced summary::after {
  content: "+";
  color: var(--accent-cyan);
}

.image-chat-advanced[open] summary::after {
  content: "-";
}

.image-template-manager,
.managed-upload-face,
.managed-upload-card,
.image-history-toolbar,
.image-history-card {
  box-shadow: var(--shadow-soft);
}

.image-chat-status.is-error,
.run-record-error,
.image-chat-error {
  color: var(--state-danger) !important;
}

@media (max-width: 980px) {
  .login-card {
    padding: 24px;
  }

  .btn,
  .user-badge,
  .chip,
  .tab,
  .studio-section-link,
  .dashboard-card-meta span,
  .dashboard-card-icon,
  .content-hub-meta span,
  .image-chat-tabs button {
    white-space: normal;
  }

  .run-record-item,
  .audit-log-item,
  .run-record-diagnostic-summary {
    grid-template-columns: 1fr;
  }

  .run-status-head,
  .dashboard-running-item,
  .dashboard-recent-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .image-chat-empty {
    min-height: 220px;
    padding: 18px;
  }
}
