:root {
  --vr-surface: var(--ui-surface);
  --vr-surface-soft: var(--ui-surface-soft);
  --vr-line: var(--ui-separator);
  --vr-text: var(--ui-text);
  --vr-muted: var(--ui-text-secondary);
  --vr-accent: var(--ui-accent);
  --vr-accent-ink: #ffffff;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 17% 8%, rgba(99, 128, 255, 0.095), transparent 29%),
    radial-gradient(circle at 88% 4%, rgba(118, 88, 246, 0.07), transparent 31%),
    linear-gradient(145deg, #f8faff 0%, var(--ref-bg) 48%, #f3f5ff 100%);
  background-attachment: fixed;
  color: var(--ui-text);
}

body::before,
.page-bg-video {
  display: none;
}

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

.main {
  width: 100%;
  min-height: 100vh;
  padding: 0 0 48px;
  display: grid;
  align-content: start;
  gap: 0;
}

.app-topbar,
body:not(.project-mode) .app-topbar,
body.project-mode .app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 62px;
  margin: 0;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  border: 0;
  border-bottom: 1px solid rgba(216, 221, 234, 0.72);
  border-radius: 0;
  background: var(--ref-surface);
  color: var(--ui-text);
  box-shadow: 0 8px 28px rgba(82, 97, 160, 0.035);
  backdrop-filter: none;
}

.app-topbar h1 {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ui-text);
  font-size: 16px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.app-topbar h1::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 5px solid var(--ref-blue);
  border-right-color: var(--ref-purple);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(85, 116, 247, 0.08);
  transform: rotate(-38deg);
}

.app-topbar .nav-list {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  gap: 4px;
}

.nav-list a,
.nav-list a:hover,
.nav-list a.active {
  min-height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ui-text-secondary);
  box-shadow: none;
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
}

.nav-list a:hover {
  background: var(--ui-surface-hover);
  color: var(--ui-text);
}

.nav-list a.active {
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

.app-topbar .nav-list a[data-view-link] {
  border: 1px solid var(--ui-separator-strong);
  background: var(--ui-surface);
  box-shadow: 0 1px 2px rgba(31, 35, 48, 0.06);
  font-weight: 650;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.app-topbar .nav-list a[data-view-link]:hover {
  border-color: rgba(85, 116, 247, 0.36);
  background: var(--ui-surface-hover);
  color: var(--ui-accent);
  box-shadow: 0 5px 14px rgba(85, 116, 247, 0.12);
  transform: translateY(-1px);
}

.app-topbar .nav-list a[data-view-link].active {
  border-color: var(--ui-accent);
  background: var(--ui-accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(85, 116, 247, 0.22);
  transform: none;
}

.app-topbar .nav-list a[data-view-link]:focus-visible {
  outline: 3px solid var(--ui-accent-soft);
  outline-offset: 2px;
}

.app-topbar .nav-list a.home-return-link,
.app-topbar .nav-list a.home-return-link:hover {
  border: 0;
  background: transparent;
  color: var(--ui-text-secondary);
  box-shadow: none;
}

.app-topbar .side-status {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  min-height: 32px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(216, 221, 234, 0.78);
  border-radius: 999px;
  background: var(--ref-surface);
  color: var(--ui-text-secondary);
  box-shadow: var(--ref-shadow-card);
  font-size: 12px;
  font-weight: 550;
}

.top-model-picker {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  margin: 0 0 8px;
  border-color: var(--ui-separator);
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
  box-shadow: var(--ui-shadow-sm);
}

.top-model-picker .top-model-label,
.top-model-picker .model-option,
.top-model-picker .reference-flux-freedom {
  border-color: transparent;
  background: transparent;
  color: var(--ui-text-secondary);
  box-shadow: none;
}

.top-model-picker .model-option:has(input:checked) {
  border-color: rgba(0, 113, 227, 0.18);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

.top-model-picker input {
  accent-color: var(--ui-accent);
}

.top-model-picker .reference-flux-freedom input {
  border-color: var(--ui-separator-strong);
  background: var(--ui-surface);
  color: var(--ui-text);
  -webkit-text-fill-color: var(--ui-text);
}

.welcome-page {
  position: static;
  width: min(1280px, calc(100% - 40px));
  min-height: auto;
  margin: 18px auto 0;
  padding: 54px 48px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand support"
    "launcher launcher"
    "editor editor"
    "projects projects";
  grid-template-rows: auto;
  align-items: start;
  align-content: start;
  gap: 34px;
  border: 1px solid rgba(216, 221, 234, 0.68);
  border-radius: 22px;
  background:
    radial-gradient(circle at 78% 7%, rgba(118, 88, 246, 0.08), transparent 31%),
    rgba(255, 255, 255, 0.56);
  box-shadow: var(--ref-shadow-panel);
}

.home-blank-hero,
.home-support-board,
.project-create-launcher,
.welcome-page .project-editor,
.welcome-page .project-board {
  position: static;
  inset: auto;
  transform: none;
}

.home-blank-hero {
  grid-area: brand;
  width: auto;
  height: auto;
  max-width: 680px;
  padding: 0;
  display: block;
}

.home-blank-hero::before {
  content: none;
}

.home-blank-hero .eyebrow {
  margin: 0 0 8px;
  color: var(--ref-blue);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-blank-hero h2 {
  margin: 0;
  color: var(--ui-text);
  font-size: clamp(34px, 3.3vw, 46px);
  line-height: 1.15;
  font-weight: 680;
  letter-spacing: -0.035em;
  white-space: normal;
}

.home-blank-hero h2::after {
  content: "选择一种工作方式，或继续最近的项目";
  margin-top: 12px;
  display: block;
  color: var(--ui-text-secondary);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0;
}

.home-support-board {
  grid-area: support;
  align-self: start;
  width: auto;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.home-support-board .support-kicker {
  margin: 0;
  color: var(--ui-text-tertiary);
  font-size: 12px;
  line-height: 32px;
  font-weight: 500;
  text-align: left;
  text-shadow: none;
  white-space: nowrap;
}

.support-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
}

.support-number,
.support-number:hover {
  width: auto;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(216, 221, 234, 0.82);
  border-radius: 999px;
  background: var(--ref-surface);
  color: var(--ui-text-secondary);
  box-shadow: var(--ui-shadow-sm);
  transform: none;
}

.support-number:hover {
  border-color: var(--ui-separator-strong);
  background: var(--ui-surface-hover);
}

.support-number strong,
.home-support-board .support-number strong {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ui-text);
  box-shadow: none;
  font-size: 13px;
  line-height: 1;
  font-weight: 650;
}

.support-number span,
.home-support-board .support-number span {
  color: var(--ui-text-secondary);
  font-size: 11px;
  line-height: 1;
  text-align: left;
  text-shadow: none;
}

.project-create-launcher {
  grid-area: launcher;
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  z-index: auto;
}

.project-create-launcher .primary-btn,
.project-create-launcher a.primary-btn {
  --entry-art-position: right 18px center;
  --entry-art-size: 214px auto;

  position: relative;
  left: auto;
  width: 100%;
  min-height: 218px;
  padding: 28px 228px 28px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  border: 1px solid rgba(216, 221, 234, 0.76);
  border-radius: 20px;
  background-color: var(--ref-surface);
  background-repeat: no-repeat;
  background-position: var(--entry-art-position);
  background-size: var(--entry-art-size);
  color: var(--ui-text);
  box-shadow: var(--ref-shadow-card);
  transform: none;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-align: left;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

#openProjectEditorBtn {
  --entry-art-image: url("assets/home-replicate-entry.webp");

  background-image: var(--entry-art-image);
}

.project-create-launcher a.primary-btn {
  --entry-art-image: url("assets/home-local-wash-entry.webp");

  background-image: var(--entry-art-image);
}

.project-create-launcher .primary-btn:hover,
.project-create-launcher a.primary-btn:hover {
  border-color: rgba(85, 116, 247, 0.25);
  background-color: var(--ref-surface);
  background-image: var(--entry-art-image);
  background-repeat: no-repeat;
  background-position: var(--entry-art-position);
  background-size: var(--entry-art-size);
  box-shadow: var(--ref-shadow-card);
  transform: none;
}

.welcome-page .project-editor {
  grid-area: editor;
  justify-self: center;
  width: min(820px, 100%);
  margin: 0;
  padding: 24px;
  border: 1px solid rgba(216, 221, 234, 0.78);
  border-radius: var(--ref-radius-panel);
  background: var(--ref-surface);
  color: var(--ui-text);
  box-shadow: var(--ref-shadow-panel);
  backdrop-filter: none;
}

.welcome-page .project-editor .section-head.compact {
  margin: 0 0 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.welcome-page .project-editor .section-head.compact h3 {
  margin: 0;
  color: var(--ui-text);
  font-size: 18px;
  font-weight: 650;
}

.welcome-page .project-editor .section-head.compact .case-meta {
  color: var(--ui-text-secondary);
  font-size: 12px;
}

.welcome-page .project-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.welcome-page .project-grid label {
  min-width: 0;
  color: var(--ui-text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.welcome-page .project-grid input,
.welcome-page .project-grid select,
.welcome-page .project-grid .platform-select-button {
  width: 100%;
  min-height: 44px;
  height: 44px;
  border: 1px solid var(--ui-separator-strong);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: none;
}

.welcome-page #businessType,
.welcome-page #businessType:hover,
.welcome-page #businessType:focus {
  background: var(--ui-surface);
  color: var(--ui-text);
  -webkit-text-fill-color: var(--ui-text);
}

.welcome-page #businessType option {
  background: var(--ui-surface);
  color: var(--ui-text);
}

.welcome-page .project-grid input:focus,
.welcome-page .project-grid select:focus,
.welcome-page .project-grid .platform-select-button:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px var(--ui-accent-soft);
}

.welcome-page .platform-select-current,
.welcome-page .platform-select-arrow {
  color: var(--ui-text);
}

.welcome-page .project-grid .project-actions {
  grid-column: 1 / -1;
  grid-row: auto;
  width: 100%;
  align-self: end;
}

.welcome-page .project-grid .project-actions .primary-btn {
  width: 100%;
  min-height: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--ui-accent);
  color: #fff;
  box-shadow: none;
}

.welcome-page .project-grid .project-actions .primary-btn:hover {
  background: var(--ui-accent-hover);
  transform: none;
}

.welcome-page .project-board {
  grid-area: projects;
  width: 100%;
  margin: 8px 0 0;
  padding: 0;
  display: block;
  color: var(--ui-text);
}

.welcome-page .project-board::before {
  content: "最近项目";
  margin-bottom: 14px;
  display: block;
  color: var(--ui-text);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.welcome-page .project-board-actions {
  margin: -42px 0 10px;
  display: flex;
  justify-content: flex-end;
}

.welcome-page .project-board-actions .danger-btn {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--ui-separator);
  border-radius: 8px;
  background: transparent;
  color: var(--ui-danger);
  box-shadow: none;
}

.welcome-page .project-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  animation: none;
  scrollbar-width: thin;
}

.welcome-page .project-card {
  flex: 0 0 240px;
  min-height: 104px;
  padding: 14px 16px;
  border: 1px solid rgba(216, 221, 234, 0.76);
  border-radius: var(--ref-radius-card);
  background: var(--ref-surface);
  color: var(--ui-text);
  box-shadow: var(--ui-shadow-sm);
  backdrop-filter: none;
}

.welcome-page .project-card:hover,
.welcome-page .project-card.active {
  border-color: rgba(0, 113, 227, 0.38);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
  transform: none;
}

.welcome-page .project-card.active {
  box-shadow: inset 3px 0 0 var(--ui-accent), var(--ui-shadow-sm);
}

.welcome-page .project-card-title strong {
  color: var(--ui-text);
}

.welcome-page .project-card-main span,
.welcome-page .project-card-main small {
  color: var(--ui-text-secondary);
}

.platform-support-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: none;
}

.platform-support-panel {
  width: min(760px, 100%);
  max-height: min(80vh, 720px);
  overflow: hidden;
  border: 1px solid var(--ui-separator);
  border-radius: 18px;
  background: var(--ui-surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: none;
}

.platform-support-head {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--ui-separator);
}

.platform-support-head .eyebrow {
  color: var(--ui-text-tertiary);
}

.platform-support-head h3 {
  color: var(--ui-text);
  font-size: 22px;
}

.platform-support-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--ui-separator);
  border-radius: 8px;
  background: var(--ui-surface-soft);
  color: var(--ui-text-secondary);
  box-shadow: none;
}

.platform-support-list {
  max-height: calc(min(80vh, 720px) - 80px);
  padding: 18px 22px 22px;
  gap: 8px;
}

.platform-support-item {
  border: 1px solid var(--ui-separator);
  border-radius: 10px;
  background: var(--ui-surface-soft);
  color: var(--ui-text);
}

body.project-mode {
  background-color: var(--ref-bg);
}

body.project-mode .main {
  padding-bottom: 64px;
}

.workspace-stack {
  width: min(1240px, calc(100% - 40px));
  margin: 22px auto 0;
}

.workspace-section {
  width: 100%;
  padding: 32px;
  border: 1px solid rgba(216, 221, 234, 0.72);
  border-radius: var(--ref-radius-panel);
  background: var(--ref-surface);
  color: var(--ui-text);
  box-shadow: var(--ref-shadow-panel);
  backdrop-filter: none;
  scroll-margin-top: 112px;
}

.workspace-section .section-head,
.workspace-section .imports-title-row {
  color: var(--ui-text);
}

.workspace-section .eyebrow {
  color: var(--ui-text-tertiary);
}

.workspace-section .section-assist,
.workspace-section .case-meta {
  color: var(--ui-text-secondary);
}

.workspace-section h2,
.workspace-section h3,
.workspace-section h4,
.workspace-section strong,
.workspace-section label {
  color: var(--ui-text);
}

.workspace-section button,
.workspace-section input,
.workspace-section select,
.workspace-section summary {
  border-radius: 8px;
}

.workspace-section .primary-btn {
  border: 0;
  background: var(--ref-blue);
  color: #fff;
  box-shadow: none;
}

.workspace-section .primary-btn:hover {
  background: var(--ref-blue-hover);
  transform: none;
}

.workspace-section .secondary-btn {
  border: 1px solid var(--ui-separator-strong);
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: none;
}

.plugin-install-panel,
.platform-filter-panel,
.plugin-bar,
.task-section,
.reference-head-actions {
  border: 1px solid rgba(216, 221, 234, 0.78);
  border-radius: 12px;
  background: var(--ref-surface);
  color: var(--ui-text);
  box-shadow: none;
}

.workspace-section .plugin-install-toggle {
  min-height: 58px;
  padding: 0 16px 0 18px;
  border-radius: 11px;
  background: transparent;
  color: var(--ui-text);
  box-shadow: inset 4px 0 0 var(--ui-accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.workspace-section .plugin-install-toggle::after {
  min-width: 64px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--ui-accent);
  color: #fff;
  box-shadow: 0 5px 14px rgba(85, 116, 247, 0.22);
}

.workspace-section .plugin-install-panel {
  border-color: rgba(85, 116, 247, 0.34);
  background: linear-gradient(105deg, rgba(85, 116, 247, 0.09), rgba(118, 88, 246, 0.05) 58%, var(--ui-surface) 100%);
  box-shadow: 0 8px 22px rgba(85, 116, 247, 0.12);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.workspace-section .plugin-install-panel:hover {
  border-color: rgba(85, 116, 247, 0.58);
  box-shadow: 0 12px 28px rgba(85, 116, 247, 0.18);
}

.workspace-section .plugin-install-toggle:hover {
  background: rgba(85, 116, 247, 0.06);
  color: var(--ui-accent);
}

.workspace-section .plugin-install-toggle:focus-visible {
  outline: 3px solid var(--ui-accent-soft);
  outline-offset: -3px;
}

.workspace-section .plugin-install-toggle:hover::after {
  background: var(--ui-accent-hover);
  box-shadow: 0 7px 18px rgba(85, 116, 247, 0.28);
}

.workspace-section .plugin-install-content,
.workspace-section .browser-support,
.workspace-section .install-steps {
  background: var(--ui-surface);
  color: var(--ui-text);
}

.workspace-section .browser-support,
.workspace-section .install-steps {
  border-color: var(--ui-separator);
}

.workspace-section .browser-support h4,
.workspace-section .install-steps h4,
.workspace-section .install-steps ol,
.workspace-section .support-row {
  color: var(--ui-text);
}

.workspace-section .support-table {
  border-color: var(--ui-separator);
  background: var(--ui-surface-soft);
}

.workspace-section .support-row {
  border-bottom-color: var(--ui-separator);
}

.workspace-section .support-head {
  background: var(--ui-surface-hover);
  color: var(--ui-text-secondary);
}

.workspace-section .support-ok {
  background: var(--ui-success-soft);
  color: var(--ui-success);
}

.platform-filter-panel {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
  align-items: end;
}

.platform-filter-panel .platform-filter-grid {
  align-items: end;
}

.workspace-section .platform-filter-panel > div:first-child strong {
  color: var(--ui-text);
  font-size: 15px;
  font-weight: 650;
}

.workspace-section .platform-filter-panel .case-meta,
.workspace-section .platform-filter-panel label,
.workspace-section .locked-filter {
  color: var(--ui-text-secondary);
}

.workspace-section .locked-filter {
  border-color: var(--ui-separator);
  background: var(--ui-surface);
}

.platform-filter-panel .platform-filter-grid input,
.platform-filter-panel .platform-filter-grid select {
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
  -webkit-text-fill-color: var(--ui-text);
  border-color: var(--ui-separator-strong);
  box-shadow: none;
}

.platform-filter-panel .platform-filter-grid select option,
.platform-filter-panel .platform-filter-grid select option:checked {
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
  -webkit-text-fill-color: var(--ui-text);
}

.platform-filter-panel .platform-filter-grid input::placeholder {
  color: var(--ui-text-tertiary) !important;
}

.plugin-bar {
  margin-bottom: 18px;
  padding: 11px 14px;
}

.pending-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--ui-separator);
}

.pending-item {
  border-bottom: 1px solid var(--ui-separator);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.source-post-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.source-post {
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr) minmax(360px, auto);
  grid-template-areas:
    "gallery content actions"
    "gallery footer actions";
  gap: 10px 18px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--ui-separator);
  border-radius: 12px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-sm);
}

.source-content {
  grid-area: content;
  gap: 6px;
  padding-top: 2px;
}

.source-content p {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.source-post:has(.clone-btn:disabled) {
  border-color: rgba(85, 116, 247, 0.42);
  box-shadow: inset 3px 0 0 var(--ref-blue), var(--ref-shadow-card);
}

.source-post:has(.source-task-feedback.ok:not([hidden])) {
  border-color: rgba(40, 184, 116, 0.34);
}

.source-post:has(.source-task-feedback.error:not([hidden])) {
  border-color: rgba(239, 78, 94, 0.34);
}

.source-task-feedback {
  width: 100%;
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.source-task-feedback.ok {
  background: var(--ref-success-soft);
  color: var(--ref-success);
}

.source-task-feedback.error {
  background: var(--ref-danger-soft);
  color: var(--ref-danger);
}

#generateAllReferencesBtn:disabled,
.clone-btn:disabled {
  cursor: wait;
  opacity: 0.62;
}

.source-gallery {
  grid-area: gallery;
  min-width: 0;
  min-height: 142px;
  height: 100%;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 96px;
  align-content: start;
  justify-content: start;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px;
  border-radius: 10px;
  background: var(--ui-surface-soft);
}

.source-gallery-single {
  grid-template-columns: 112px;
  grid-auto-columns: 112px;
}

.source-gallery img,
.source-thumb-empty {
  width: 96px;
  height: 96px;
  aspect-ratio: auto;
}

.source-gallery-single img,
.source-gallery-single .source-thumb-empty {
  width: 112px;
  height: 112px;
}

.source-footer {
  grid-area: footer;
  margin-top: 0;
  display: grid;
  grid-template-columns: auto auto minmax(150px, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding-top: 10px;
}

.source-actions {
  grid-area: actions;
  min-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.source-metrics {
  min-width: 0;
  justify-content: flex-start;
  gap: 16px;
}

.clone-controls {
  grid-column: 1 / -1;
  width: 100%;
  margin-left: 0;
  justify-content: flex-end;
}

.source-post .clone-count {
  border-color: var(--ui-separator-strong);
  background: var(--ui-surface);
  color: var(--ui-text);
  -webkit-text-fill-color: var(--ui-text);
}

.source-task-feedback {
  grid-column: 2 / -1;
}

.reference-head-actions {
  padding: 8px;
  border: 1px solid rgba(216, 221, 234, 0.78);
  border-radius: 10px;
  background: var(--ref-surface);
}

.reference-head-actions #generateAllCount {
  border-color: var(--ui-separator-strong);
  background: var(--ui-accent-soft);
  color: var(--ui-text);
  -webkit-text-fill-color: var(--ui-text);
}

.task-history,
.history-group-list {
  display: grid;
  gap: 0;
}

.history-group,
.history-row {
  border-color: var(--ui-separator);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.history-row {
  border-bottom: 1px solid var(--ui-separator);
}

.empty-state {
  border: 1px solid var(--ui-separator);
  border-radius: 12px;
  background: var(--ui-surface-soft);
  color: var(--ui-text-secondary);
  box-shadow: none;
}

#matrixEmpty {
  min-height: 390px;
  padding: 232px 24px 40px;
  display: grid;
  place-items: start center;
  align-content: center;
  background-image: url("assets/reference-empty.webp");
  background-repeat: no-repeat;
  background-position: center 46px;
  background-size: 190px auto;
  text-align: center;
}

.feedback-prompt-main {
  position: fixed;
  z-index: 50;
  top: auto;
  right: 20px;
  bottom: 20px;
  width: 116px;
  height: 42px;
  margin: 0;
  padding: 0 14px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--ui-separator);
  border-radius: 10px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-md);
  color: var(--ui-text);
  cursor: text;
  transition:
    width 180ms ease,
    height 180ms ease,
    padding 180ms ease;
}

.feedback-prompt-main[hidden] {
  display: none;
}

.feedback-prompt-main::before {
  content: "意见反馈";
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ui-text);
  font-size: 13px;
  font-weight: 600;
}

.feedback-prompt-main p,
.feedback-prompt-main label {
  height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.feedback-prompt-main:focus-within {
  width: min(320px, calc(100vw - 24px));
  height: auto;
  padding: 16px;
}

.feedback-prompt-main:focus-within::before {
  height: auto;
  margin-bottom: 10px;
  justify-content: flex-start;
  font-size: 15px;
}

.feedback-prompt-main:focus-within p,
.feedback-prompt-main:focus-within label {
  height: auto;
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
}

.feedback-prompt-main:focus-within p {
  margin: 0 0 10px;
  color: var(--ui-text-secondary);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 400;
}

.feedback-prompt-main:focus-within label {
  display: grid;
  gap: 7px;
  color: var(--ui-text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.feedback-prompt-main textarea,
.feedback-prompt-main textarea:focus,
.feedback-prompt-main:focus-within textarea {
  width: 100%;
  min-height: 96px;
  max-height: 180px;
  padding: 9px 10px;
  border: 1px solid var(--ui-separator-strong);
  border-radius: 8px;
  background: var(--ui-surface);
  color: var(--ui-text);
  box-shadow: none;
  resize: vertical;
  overflow: auto;
}

@media (max-width: 1100px) {
  .welcome-page {
    padding-top: 40px;
  }

  .project-create-launcher .primary-btn,
  .project-create-launcher a.primary-btn {
    min-height: 204px;
  }

  .platform-filter-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .welcome-page {
    padding-inline: 30px;
  }

  .project-create-launcher .primary-btn,
  .project-create-launcher a.primary-btn {
    --entry-art-position: right 10px center;
    --entry-art-size: 166px auto;

    padding-right: 172px;
  }

  .source-post {
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
    grid-template-areas:
      "gallery content"
      "gallery footer"
      "actions actions";
  }

  .source-actions {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    align-items: center;
  }

  .source-task-feedback {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .app-topbar,
  body:not(.project-mode) .app-topbar,
  body.project-mode .app-topbar {
    min-height: 52px;
    padding: 8px 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .app-topbar h1 {
    font-size: 14px;
  }

  .app-topbar .nav-list {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    overflow-x: auto;
  }

  .app-topbar .side-status {
    grid-column: 2;
    grid-row: 1;
  }

  .top-model-picker {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: stretch;
  }

  .welcome-page {
    width: calc(100% - 24px);
    margin-top: 12px;
    padding: 34px 18px 28px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "support"
      "launcher"
      "editor"
      "projects";
    gap: 24px;
    border-radius: 18px;
  }

  .home-support-board {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .project-create-launcher {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-create-launcher .primary-btn,
  .project-create-launcher a.primary-btn {
    --entry-art-position: right 4px center;
    --entry-art-size: 148px auto;

    min-height: 184px;
    padding: 22px 148px 22px 20px;
    border-radius: 16px;
  }

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

  .welcome-page .project-grid .project-actions {
    grid-column: 1;
  }

  .workspace-stack {
    width: calc(100% - 24px);
    margin-top: 16px;
  }

  .workspace-section {
    padding: 22px 16px;
    border-radius: 16px;
  }

  .workspace-section .section-head,
  .workspace-section .imports-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-section .head-actions,
  .reference-head-actions {
    width: 100%;
  }

  .source-post-list {
    grid-template-columns: 1fr;
  }

  .source-post {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "gallery"
      "content"
      "footer"
      "actions";
    gap: 12px;
    padding: 12px;
  }

  .source-gallery {
    min-height: 112px;
    height: auto;
    grid-auto-columns: 88px;
  }

  .source-gallery img,
  .source-thumb-empty {
    width: 88px;
    height: 88px;
  }

  .source-gallery-single {
    grid-template-columns: 96px;
    grid-auto-columns: 96px;
  }

  .source-gallery-single img,
  .source-gallery-single .source-thumb-empty {
    width: 96px;
    height: 96px;
  }

  .source-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }

  .source-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .source-metrics {
    flex: 1 1 180px;
  }

  .clone-controls {
    width: 100%;
    justify-content: flex-start;
  }

  #matrixEmpty {
    min-height: 330px;
    padding-top: 196px;
    background-position: center 38px;
    background-size: 155px auto;
  }

  .feedback-prompt-main {
    right: 12px;
    bottom: 12px;
  }
}

@media (max-width: 420px) {
  .welcome-page {
    padding-inline: 12px;
  }

  .home-blank-hero h2 {
    font-size: 28px;
  }

  .support-metrics {
    width: 100%;
  }

  .support-number,
  .support-number:hover {
    flex: 1 1 0;
    justify-content: center;
  }

  .project-create-launcher .primary-btn,
  .project-create-launcher a.primary-btn {
    --entry-art-size: 128px auto;

    min-height: 174px;
    padding: 20px 126px 20px 18px;
  }

  .welcome-page .project-editor {
    padding: 18px 16px;
  }

  .welcome-page .project-list {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .welcome-page .project-card {
    width: 100%;
    flex-basis: auto;
  }

  .platform-support-modal {
    padding: 12px;
  }

  .platform-support-list {
    grid-template-columns: 1fr;
    padding: 14px;
  }
}
