:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d7e0ee;
  --line-strong: #c1cee0;
  --text: #172033;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-soft: #e9f1ff;
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --warning: #b45309;
  --warning-soft: #fff7ed;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

a {
  color: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid transparent;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

#app {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 18px;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f6fff, #7fb0ff);
  color: #fff;
  font-weight: 800;
}

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

.brand-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.stack {
  display: grid;
  gap: 12px;
}

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

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

.tiny {
  font-size: 12px;
}

.btn,
.header-actions button,
.stage-actions button,
.toolbar button {
  min-height: 40px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
}

.btn.secondary,
button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn.ghost,
button.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid transparent;
}

.btn.danger,
button.danger {
  background: var(--danger);
  color: #fff;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  display: grid;
  align-content: start;
  gap: 20px;
}

.sidebar-section {
  display: grid;
  gap: 10px;
}

.sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

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

.sidebar-note p {
  margin: 8px 0 0;
  line-height: 1.6;
}

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

.recent-project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 6px;
}

.recent-card {
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.recent-card.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

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

.recent-card span {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

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

.recent-delete {
  width: 42px;
  padding: 0;
  border: 1px solid #fecaca;
  background: #fff;
  color: var(--danger);
  font-size: 12px;
}

.recent-delete:hover,
.recent-delete:focus-visible {
  border-color: var(--danger);
  background: #fff1f2;
}

.main {
  padding: 20px 24px 24px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.launcher {
  min-height: calc(100vh - 150px);
  padding: 44px 8px 24px;
  display: grid;
  align-content: start;
  gap: 34px;
}

.launcher-copy {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.launcher-kicker {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.launcher-copy h2 {
  margin: 0;
  font-size: 36px;
  line-height: 1.25;
}

.launcher-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.workflow-card {
  min-height: 250px;
  padding: 24px;
  border: 1px solid var(--line);
  border-top-width: 4px;
  background: #fff;
  color: var(--text);
  text-align: left;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.workflow-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.workflow-card.blue {
  border-top-color: #2563eb;
  background: #f5f8ff;
}

.workflow-card.green {
  border-top-color: #0f9f86;
  background: #f2fbf8;
}

.workflow-card.cyan {
  border-top-color: #0891b2;
  background: #f2fbfd;
}

.workflow-number {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.workflow-title {
  font-size: 23px;
  font-weight: 800;
}

.workflow-desc {
  font-size: 15px;
  font-weight: 600;
}

.workflow-detail {
  color: var(--muted);
  line-height: 1.7;
}

.workflow-action {
  color: var(--primary);
  font-weight: 700;
}

.launcher-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.launcher-summary div {
  padding: 18px;
  text-align: center;
}

.launcher-summary div + div {
  border-left: 1px solid var(--line);
}

.launcher-summary strong,
.launcher-summary span {
  display: block;
}

.launcher-summary strong {
  font-size: 22px;
}

.launcher-summary span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

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

.header-copy h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.header-copy p {
  margin: 0;
  color: var(--muted);
}

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

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

.route-toggle {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
}

.route-toggle button {
  min-height: 34px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
}

.route-toggle button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.step-strip {
  display: grid;
  grid-template-columns: repeat(var(--step-count, 5), minmax(0, 1fr));
  gap: 12px;
}

.step-item {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px 12px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  text-align: left;
}

.step-item.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.step-item.complete .step-index {
  background: var(--primary);
  color: #fff;
}

.step-index {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.step-copy strong,
.step-copy em {
  display: block;
}

.step-copy em {
  margin-top: 4px;
  font-style: normal;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.flash {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  box-shadow: var(--shadow);
  font-weight: 600;
  line-height: 1.5;
}

.flash.success {
  color: var(--success);
  background: var(--success-soft);
  border-color: #b7f0c7;
}

.flash.error {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fecaca;
}

.flash.warn {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #fed7aa;
}

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

.stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  gap: 16px;
}

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

.stage-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.stage-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.settings-stage {
  padding: 26px 30px 92px;
  gap: 0;
}

.settings-section {
  padding: 26px 0;
  border-bottom: 1px solid #e5eaf2;
  display: grid;
  gap: 18px;
}

.settings-section:last-of-type {
  border-bottom: 0;
}

.settings-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.settings-section-title strong {
  font-size: 17px;
}

.settings-section-title span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.settings-section-title .required {
  color: var(--danger);
}

.settings-link {
  color: var(--primary) !important;
  font-weight: 600;
}

.title-input-wrap {
  position: relative;
  max-width: 1100px;
}

.title-input-wrap input {
  min-height: 58px;
  padding: 0 86px 0 16px;
  border: 0;
  background: #f7f8fa;
  font-size: 16px;
}

.title-input-wrap span {
  position: absolute;
  top: 50%;
  right: 16px;
  color: var(--muted);
  font-size: 13px;
  transform: translateY(-50%);
}

.page-setting-title > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.page-setting-title b {
  color: #172033;
}

.page-slider-wrap {
  position: relative;
  overflow-x: auto;
  padding: 32px 8px 2px;
}

.page-slider-wrap output {
  position: absolute;
  top: 0;
  left: clamp(22px, var(--page-position), calc(100% - 22px));
  min-width: 46px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
}

.page-slider-wrap output::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--primary);
  transform: translateX(-50%) rotate(45deg);
}

.page-slider-wrap input[type="range"] {
  width: 100%;
  min-width: 920px;
  height: 28px;
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--primary);
}

.page-ticks {
  min-width: 920px;
  display: grid;
  grid-template-columns: repeat(16, minmax(42px, 1fr));
  color: #52627a;
  font-size: 12px;
}

.page-ticks span {
  text-align: center;
}

.select-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 760px;
}

.select-card,
.model-card {
  position: relative;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.select-card > input,
.model-card > input,
.visual-choice-card > input,
.layout-choice-card > input,
.pill-choice > input,
.cover-choice-card > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.select-card:has(input:checked),
.model-card:has(input:checked),
.visual-choice-card:has(input:checked),
.layout-choice-card:has(input:checked),
.cover-choice-card:has(input:checked) {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: #f7faff;
}

.choice-indicator {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
}

.select-card:has(input:checked) .choice-indicator {
  border: 6px solid var(--primary);
}

.select-card-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.select-card-copy strong {
  font-size: 15px;
}

.select-card-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.model-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding: 2px;
}

.model-symbol {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #53657d;
  color: #fff;
  font-weight: 800;
}

.model-provider-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
}

.model-provider-logo img {
  width: 35px;
  height: 35px;
  display: block;
  object-fit: contain;
}

.model-provider-logo.compact,
.model-symbol.compact {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

.model-provider-logo.compact img {
  width: 31px;
  height: 31px;
}

.model-symbol-1 {
  background: #1f6feb;
}

.model-symbol-2 {
  background: #0f9f86;
}

.model-symbol-3 {
  background: #e56b6f;
}

.model-symbol-4 {
  background: #725ac1;
}

.visual-card-scroller,
.cover-card-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 190px;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 10px;
}

.visual-choice-card,
.layout-choice-card,
.cover-choice-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
  cursor: pointer;
}

.visual-choice-card strong,
.layout-choice-card strong,
.cover-choice-card strong {
  font-size: 13px;
  text-align: center;
}

.visual-choice-card em,
.layout-choice-card em {
  min-height: 34px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.5;
}

.style-preview-frame,
.layout-preview-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid #dfe4eb;
  background: #f3f6fa;
}

.style-preview-frame {
  height: 168px;
}

.layout-preview-frame {
  aspect-ratio: 1.575;
}

.style-preview-frame img,
.layout-preview-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fff;
}

.image-preview-button {
  position: absolute;
  left: 8px;
  bottom: 8px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.image-preview-button:hover,
.image-preview-button:focus-visible {
  background: #0f172a;
}

.preset-rule-tag {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 4px;
  background: #eef3fa;
  color: #53657d;
  font-size: 10px;
  line-height: 1.2;
}

.visual-choice-card:has(input:checked) .preset-rule-tag,
.layout-choice-card:has(input:checked) .preset-rule-tag {
  background: var(--primary-soft);
  color: var(--primary);
}

.custom-style-preview {
  padding: 16px 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  background:
    linear-gradient(#dbe7f7, #dbe7f7) 14px 54px / calc(100% - 28px) 1px no-repeat,
    linear-gradient(#e8eef7, #e8eef7) 14px 83px / calc(100% - 48px) 1px no-repeat,
    linear-gradient(#e8eef7, #e8eef7) 14px 112px / calc(100% - 36px) 1px no-repeat,
    #fff;
}

.custom-style-preview b {
  color: var(--primary);
  font-size: 12px;
}

.custom-style-preview span {
  max-height: 70px;
  overflow: hidden;
  color: #4b5e76;
  font-size: 11px;
  line-height: 1.6;
}

.custom-style-delete {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 1px solid #fecaca;
  border-radius: 4px;
  background: #fff;
  color: #b42318;
  font-size: 18px;
  line-height: 1;
}

.custom-style-add-card {
  min-height: 252px;
  border-style: dashed;
  place-items: center;
  align-content: center;
  color: var(--primary);
  text-align: center;
}

.custom-style-add-card:hover,
.custom-style-add-card:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.custom-style-add-card b {
  width: 46px;
  height: 46px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.custom-style-add-card span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.layout-card-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 280px;
  gap: 18px;
  overflow-x: auto;
  padding: 2px 2px 10px;
}

.style-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.style-preview-dialog {
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.style-preview-dialog header {
  min-height: 64px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.style-preview-dialog header div {
  display: grid;
  gap: 4px;
}

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

.style-preview-dialog header button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.style-preview-canvas {
  min-height: 0;
  padding: 18px;
  overflow: auto;
  background: #edf1f6;
}

.style-preview-canvas img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 148px);
  margin: 0 auto;
  display: block;
  border: 1px solid #cfd8e5;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.custom-style-dialog {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.custom-style-dialog header,
.custom-style-dialog footer {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.custom-style-dialog header {
  border-bottom: 1px solid var(--line);
}

.custom-style-dialog header div {
  display: grid;
  gap: 4px;
}

.custom-style-dialog header span {
  color: var(--muted);
  font-size: 12px;
}

.custom-style-dialog header button {
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.custom-style-form-body {
  min-height: 0;
  padding: 18px;
  overflow: auto;
  display: grid;
  gap: 15px;
}

.custom-style-form-body label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.custom-style-form-body textarea {
  min-height: 112px;
}

.custom-style-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.custom-style-dialog footer button {
  min-width: 112px;
  min-height: 40px;
  padding: 0 16px;
}

.custom-style-dialog footer button:not(.secondary) {
  background: var(--primary);
  color: #fff;
}

.image-settings-dialog,
.private-image-dialog {
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.image-settings-dialog header,
.image-settings-dialog footer,
.private-image-dialog header,
.private-image-dialog footer {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.image-settings-dialog header,
.private-image-dialog header {
  border-bottom: 1px solid var(--line);
}

.image-settings-dialog header > div,
.private-image-dialog header > div {
  display: grid;
  gap: 4px;
}

.image-settings-dialog header span,
.private-image-dialog header span,
.private-image-dialog footer span {
  color: var(--muted);
  font-size: 12px;
}

.image-settings-dialog header button,
.private-image-dialog header button {
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.image-settings-dialog footer,
.private-image-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.image-settings-dialog footer button,
.private-image-dialog footer button {
  min-width: 110px;
}

.image-settings-body,
.private-image-body {
  min-height: 0;
  padding: 18px 20px;
  overflow: auto;
}

.image-settings-body {
  display: grid;
  gap: 22px;
}

.image-settings-section {
  display: grid;
  gap: 12px;
}

.image-settings-section + .image-settings-section {
  padding-top: 20px;
  border-top: 1px solid #edf1f6;
}

.image-settings-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

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

.image-count-grid,
.image-layout-grid,
.image-style-grid,
.image-inline-settings {
  display: grid;
  gap: 12px;
}

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

.image-setting-choice,
.image-layout-choice,
.image-style-choice {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.image-setting-choice {
  min-height: 104px;
  padding: 16px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
}

.image-setting-choice:has(input:checked),
.image-layout-choice:has(input:checked),
.image-style-choice:has(input:checked) {
  border-color: var(--primary);
  background: #f7f9ff;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.image-setting-choice > input,
.image-layout-choice > input,
.image-style-choice > input {
  accent-color: var(--primary);
}

.image-setting-choice strong,
.image-setting-choice em {
  display: block;
}

.image-setting-choice strong i,
.image-layout-choice strong i {
  margin-left: 6px;
  padding: 2px 5px;
  border-radius: 3px;
  background: #fff1dc;
  color: #d97706;
  font-size: 10px;
  font-style: normal;
}

.image-setting-choice em,
.image-layout-choice em,
.image-style-choice em {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
}

.image-custom-count-choice em {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.image-custom-count-choice input[type="number"] {
  width: 82px;
  min-height: 34px;
  padding: 4px 8px;
}

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

.image-layout-choice {
  min-width: 0;
  padding: 10px;
  display: grid;
  gap: 7px;
}

.image-layout-choice > input {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.image-layout-choice img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid #dfe6ef;
  border-radius: 4px;
  background: #f8fafc;
}

.image-recommend-tag {
  position: absolute;
  top: -8px;
  right: 10px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

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

.image-style-choice {
  min-height: 82px;
  padding: 14px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.image-style-ratio {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.image-style-ratio input {
  width: 64px;
  min-height: 34px;
  padding: 4px 7px;
}

.image-style-ratio-summary {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.image-style-ratio-summary.invalid {
  color: var(--danger);
}

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

.image-inline-settings > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 10px;
}

.image-inline-settings label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.image-inline-settings input {
  accent-color: var(--primary);
}

.private-image-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
}

.private-image-upload {
  min-height: 190px;
  padding: 18px;
  border: 1px dashed #9ab8e8;
  border-radius: 6px;
  background: #f8fbff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  cursor: pointer;
  text-align: center;
}

.private-image-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.private-image-upload > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 24px;
}

.private-image-upload em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.private-image-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
}

.private-image-empty {
  grid-column: 1 / -1;
  min-height: 190px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.private-image-item {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.private-image-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #eef2f7;
}

.private-image-item div {
  padding: 8px;
  display: grid;
  gap: 3px;
}

.private-image-item strong,
.private-image-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.private-image-item strong {
  font-size: 12px;
}

.private-image-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.private-image-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.compact-settings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.compact-setting {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.pill-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-choice {
  position: relative;
  cursor: pointer;
}

.pill-choice span {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #4b5870;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
}

.pill-choice:has(input:checked) span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.advanced-settings {
  padding: 22px 0;
  border-bottom: 1px solid #e5eaf2;
}

.advanced-settings summary {
  cursor: pointer;
  font-weight: 700;
}

.advanced-settings .form-grid {
  margin-top: 18px;
}

.toggle-field {
  align-content: center;
}

.toggle-field label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-field input {
  width: auto;
}

.cover-card-grid {
  grid-auto-columns: 190px;
}

.cover-preview {
  height: 270px;
  border: 1px solid #dfe4eb;
  background: #fff;
  padding: 42px 16px 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  text-align: center;
  overflow: hidden;
}

.cover-preview i {
  font-size: 12px;
  font-style: normal;
}

.cover-preview b {
  align-self: center;
  font-size: 22px;
}

.cover-preview em {
  color: #68768c;
  font-size: 9px;
  font-style: normal;
}

.cover-wave {
  background: linear-gradient(160deg, #fff 0 72%, #e3f0ff 72% 78%, #4387df 78% 84%, #fff 84%);
}

.cover-city {
  background: linear-gradient(180deg, #4b78b8 0 10%, #fff 10% 82%, #dce8f7 82%);
}

.cover-angle {
  background: linear-gradient(130deg, #2ab0c5 0 13%, #fff 13% 82%, #0d2d5a 82%);
}

.cover-line {
  background: linear-gradient(180deg, #fff 0 9%, #1472bd 9% 14%, #fff 14% 86%, #e3f0f8 86%);
}

.settings-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 26px -30px -92px;
  padding: 16px 30px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.settings-sticky-actions button {
  min-width: 190px;
  min-height: 46px;
  padding: 0 22px;
  background: var(--primary);
  color: #fff;
}

.settings-sticky-actions span {
  color: var(--warning);
  font-size: 12px;
}

.score-planning-next {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.score-planning-next button {
  min-width: 190px;
  min-height: 44px;
  padding: 0 20px;
  background: var(--primary);
  color: #fff;
}

.score-planning-next #back-score-interpretation {
  min-width: 110px;
  margin-right: auto;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.score-planning-next span {
  color: var(--muted);
  font-size: 12px;
}

.catalog-planning-stage {
  padding: 0;
  overflow: hidden;
}

.catalog-planning-shell {
  height: clamp(680px, calc(100vh - 238px), 900px);
  display: grid;
  grid-template-columns: minmax(340px, 0.82fr) minmax(620px, 1.55fr);
  min-width: 0;
}

.planning-context-panel,
.catalog-workbench-panel {
  min-width: 0;
  min-height: 0;
}

.planning-context-panel {
  border-right: 1px solid var(--line);
  background: var(--panel-soft);
  display: flex;
  flex-direction: column;
}

.planning-context-tabs {
  flex: 0 0 auto;
  padding: 12px 12px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.planning-context-tabs button {
  min-height: 42px;
  padding: 0 8px;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.planning-context-tabs button.active {
  border-bottom-color: var(--primary);
  background: #fff;
  color: var(--primary);
  font-weight: 700;
}

.planning-context-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.planning-panel-actions {
  flex: 0 0 auto;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex;
  gap: 8px;
}

.planning-panel-actions button {
  min-height: 38px;
  padding: 0 12px;
  background: var(--primary);
  color: #fff;
}

.planning-direction-summary {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.planning-direction-summary span {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.planning-direction-summary b {
  color: var(--text);
}

.planning-direction-summary p,
.planning-copy-stack p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.planning-direction-list .direction-card {
  padding: 12px;
  background: #fff;
}

.planning-direction-list .direction-form {
  grid-template-columns: 1fr;
}

.planning-direction-list textarea {
  min-height: 92px;
}

.planning-score-list,
.planning-copy-stack {
  display: grid;
  gap: 12px;
}

.planning-score-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.planning-score-item > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.planning-score-item > div > span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.planning-score-item b {
  color: var(--primary);
  font-size: 12px;
}

.planning-score-item p {
  margin: 10px 0 6px 36px;
  color: var(--text);
  line-height: 1.6;
}

.planning-score-item em {
  margin-left: 36px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.planning-copy-stack section {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.planning-copy-stack section:last-child {
  border-bottom: 0;
}

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

.planning-tag-list span {
  padding: 5px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
}

.catalog-workbench-panel {
  padding: 18px;
  background: #fff;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  gap: 14px;
}

.catalog-workbench-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.catalog-workbench-head h2 {
  margin: 4px 0 6px;
  font-size: 20px;
}

.catalog-workbench-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.catalog-workbench-head > button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
}

.catalog-step-label {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.catalog-variant-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.catalog-variant-tabs button {
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  text-align: left;
}

.catalog-variant-tabs button strong,
.catalog-variant-tabs button span {
  display: block;
}

.catalog-variant-tabs button strong {
  color: var(--text);
}

.catalog-variant-tabs button span {
  margin-top: 4px;
  font-size: 12px;
}

.catalog-variant-tabs button.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: var(--primary-soft);
}

.catalog-variant-tabs button.active strong,
.catalog-variant-tabs button.active span {
  color: var(--primary);
}

.catalog-variant-summary {
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  background: var(--panel-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.catalog-variant-summary > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.catalog-variant-summary span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.model-fallback-notice {
  padding: 10px 12px;
  border-left: 3px solid var(--warning);
  background: var(--warning-soft);
  color: #92400e;
  display: grid;
  gap: 3px;
  font-size: 12px;
  line-height: 1.55;
}

.model-fallback-notice strong {
  color: #78350f;
}

.catalog-regenerate-control {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 138px auto;
  align-items: center;
  gap: 8px;
}

.catalog-regenerate-control label {
  color: var(--muted);
  font-size: 12px;
}

.catalog-regenerate-control select {
  min-height: 38px;
  padding: 6px 10px;
}

.catalog-regenerate-control button {
  min-height: 38px;
  padding: 0 12px;
}

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

.catalog-toolbar > div {
  display: flex;
  gap: 8px;
}

.catalog-toolbar button {
  min-height: 38px;
  padding: 0 12px;
}

.catalog-workbench-list {
  min-height: 0;
  padding-right: 4px;
  overflow: auto;
}

.catalog-workbench-list .catalog-card {
  padding: 12px;
  background: var(--panel-soft);
}

.catalog-chapter-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.catalog-chapter-title > span {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.catalog-workbench-list .catalog-form {
  grid-template-columns: minmax(0, 1fr) 120px 140px;
}

.catalog-workbench-list .catalog-title-field {
  min-width: 0;
}

.catalog-workbench-list .field-small {
  max-width: none;
}

.catalog-subsection-editor {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.catalog-subsection-editor > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.catalog-subsection-editor > header > div {
  display: grid;
  gap: 3px;
}

.catalog-subsection-editor > header span {
  color: var(--muted);
  font-size: 12px;
}

.catalog-subsection-editor > header button {
  min-height: 34px;
  padding: 0 10px;
}

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

.catalog-subsection-row {
  display: grid;
  grid-template-columns: 44px minmax(180px, 0.8fr) minmax(240px, 1.2fr) auto;
  align-items: center;
  gap: 8px;
}

.catalog-subsection-row > span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.catalog-subsection-row input {
  min-height: 36px;
  padding: 7px 9px;
}

.catalog-subsection-empty {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.workflow-context {
  padding: 14px 16px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  display: grid;
  gap: 5px;
}

.workflow-context span {
  color: var(--muted);
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

.badge.neutral {
  background: #eef2f7;
  color: var(--muted);
}

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

.field,
.field-full {
  display: grid;
  gap: 8px;
}

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

.field label,
.field-full label {
  font-size: 13px;
  font-weight: 600;
}

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

.choice-card,
.toggle-card,
.upload-card {
  width: 100%;
  text-align: left;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  display: grid;
  gap: 8px;
}

.choice-card.active,
.toggle-card.active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: #fff;
}

.toggle-card input,
.upload-card input {
  width: auto;
}

.toggle-card span,
.choice-card span,
.upload-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.upload-card input {
  margin: 0 0 4px;
}

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

.compact-upload {
  max-width: 520px;
}

.catalog-import {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.catalog-source-text {
  min-height: 220px;
}

.outline-editor {
  min-height: 180px;
}

.special-body-editor {
  min-height: 520px;
}

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

.chip {
  min-height: 36px;
  padding: 0 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

.chip.active {
  color: var(--primary);
  border-color: var(--primary);
  background: #fff;
}

.section-block {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.block-title {
  font-size: 14px;
  font-weight: 700;
}

.tip-row {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.tip-row.ok {
  background: var(--success-soft);
  border-color: #b7f0c7;
  color: var(--success);
}

.tip-row.warn {
  background: var(--warning-soft);
  border-color: #fed7aa;
  color: var(--warning);
}

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

.file-pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 12px;
  display: grid;
  gap: 10px;
}

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

.file-item,
.mini-empty {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

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

.file-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.info-fill-stage {
  padding: 28px 32px 96px;
  gap: 0;
}

.info-fill-head {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.analysis-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #f1c27d;
  border-radius: 999px;
  background: #fff8eb;
  color: #9a5b00;
  font-size: 12px;
  font-weight: 700;
}

.analysis-status.done {
  border-color: #9ee2b2;
  background: #effcf3;
  color: #15803d;
}

.info-fill-section {
  display: grid;
  gap: 18px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}

.info-fill-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.info-fill-section-title > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-fill-section-title strong {
  font-size: 16px;
}

.info-fill-section-title > span {
  color: var(--muted);
  font-size: 12px;
}

.technical-basis-section {
  gap: 14px;
}

.technical-basis-head,
.technical-basis-toolbar,
.technical-basis-dialog header,
.technical-basis-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.technical-basis-head > div,
.technical-basis-dialog header > div {
  display: grid;
  gap: 5px;
}

.technical-basis-head strong {
  font-size: 16px;
}

.technical-basis-head span,
.technical-basis-dialog header span,
.technical-basis-note,
.technical-basis-disabled,
.technical-basis-empty span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.technical-basis-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.technical-basis-switch input {
  width: 34px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.technical-basis-toolbar {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.technical-basis-toolbar label,
.technical-basis-toolbar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.technical-basis-toolbar label > span {
  color: var(--muted);
  font-size: 12px;
}

.technical-basis-toolbar select {
  min-width: 180px;
  min-height: 36px;
}

.technical-basis-toolbar button {
  min-height: 36px;
}

.technical-basis-table {
  overflow: hidden;
  border: 1px solid var(--line);
}

.technical-basis-table-head,
.technical-basis-row {
  display: grid;
  grid-template-columns: 54px minmax(240px, 1fr) minmax(150px, 0.45fr) 170px 64px;
  align-items: center;
  gap: 10px;
  min-width: 760px;
}

.technical-basis-table-head {
  min-height: 42px;
  padding: 0 12px;
  background: #f4f6f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.technical-basis-row {
  min-height: 54px;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.technical-basis-row input,
.technical-basis-row select {
  width: 100%;
  min-height: 36px;
}

.technical-basis-index {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.technical-basis-empty,
.technical-basis-disabled {
  display: grid;
  gap: 6px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  background: #fafbfc;
  text-align: center;
}

.technical-basis-parsing {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #4f5f7a;
  background: #f8faff;
  border: 1px dashed #c8d5f4;
}

.technical-basis-parsing i {
  width: 20px;
  height: 20px;
  border: 2px solid #c9d7fb;
  border-top-color: #2f67f6;
  border-radius: 50%;
  animation: technical-basis-spin 0.8s linear infinite;
}

.technical-basis-note.error {
  color: #c53b3b;
}

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

.technical-basis-note {
  margin: 0;
}

.technical-basis-dialog {
  width: min(860px, 92vw);
  max-height: min(720px, 88vh);
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.technical-basis-dialog header,
.technical-basis-dialog footer {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.technical-basis-dialog footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.technical-basis-dialog header button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
}

.technical-basis-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.technical-basis-search-form input,
.technical-basis-search-form select,
.technical-basis-search-form button {
  min-height: 40px;
}

.technical-basis-search-results {
  overflow: auto;
  padding: 8px 22px 18px;
}

.technical-basis-search-item {
  min-height: 62px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.technical-basis-search-item.disabled {
  cursor: default;
  opacity: 0.58;
}

.technical-basis-search-item > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.technical-basis-search-item strong,
.technical-basis-search-item em {
  overflow-wrap: anywhere;
}

.technical-basis-search-item em,
.technical-basis-search-item i,
.technical-basis-dialog footer > span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.technical-basis-dialog footer > div {
  display: flex;
  gap: 8px;
}

.technical-basis-search-empty {
  padding: 48px 16px;
  color: var(--muted);
  text-align: center;
}

.requirement-catalog-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #f4c76b;
  background: #fffaf0;
}

.requirement-catalog-status.confirmed {
  border-color: #86d3aa;
  background: #f0fbf5;
}

.requirement-catalog-status.discarded {
  border-color: var(--line);
  background: #f8fafc;
}

.requirement-catalog-status > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.requirement-catalog-status strong {
  font-size: 14px;
}

.requirement-catalog-status span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.requirement-catalog-status button {
  flex: 0 0 auto;
  min-height: 36px;
}

.requirement-catalog-dialog {
  width: min(660px, 92vw);
  max-height: min(720px, 90vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.requirement-catalog-dialog header,
.requirement-catalog-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.requirement-catalog-dialog header {
  border-bottom: 1px solid var(--line);
}

.requirement-catalog-dialog header > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.requirement-catalog-dialog header span,
.requirement-catalog-warning {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.requirement-catalog-dialog header button {
  width: 32px;
  height: 32px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 22px;
}

.requirement-catalog-body {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(240px, 1fr);
  gap: 14px;
  padding: 18px 20px;
  overflow: auto;
  background:
    linear-gradient(180deg, #f4f8ff 0, #fff 132px);
}

.requirement-catalog-notice {
  display: grid;
  gap: 5px;
}

.requirement-catalog-notice strong {
  font-size: 15px;
}

.requirement-catalog-notice span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.requirement-catalog-body textarea {
  width: 100%;
  min-height: 314px;
  resize: vertical;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.75;
}

.requirement-catalog-dialog footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.requirement-catalog-dialog footer > div {
  display: flex;
  gap: 8px;
}

.requirement-catalog-warning {
  color: #b45309;
}

.section-number {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.parse-mode-grid,
.bid-category-grid,
.image-source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.parse-mode-card {
  min-height: 90px;
  padding: 16px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.parse-mode-card.active {
  border-color: var(--primary);
  background: #f6f9ff;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.parse-mode-icon,
.image-source-symbol,
.file-type-mark {
  display: grid !important;
  place-items: center;
  flex: 0 0 auto;
  margin: 0 !important;
  background: var(--primary-soft);
  color: var(--primary) !important;
  font-size: 11px !important;
  font-weight: 800;
}

.parse-mode-icon {
  width: 46px;
  height: 46px;
  border-radius: 6px;
}

.parse-mode-card strong,
.parse-mode-card em {
  display: block;
}

.parse-mode-card em,
.image-source-card em {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.choice-radio {
  width: 17px;
  height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.parse-mode-card.active .choice-radio {
  border: 5px solid var(--primary);
}

.requirement-upload-panel {
  display: grid;
  gap: 12px;
}

.drop-upload {
  min-height: 148px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  padding: 20px;
  border: 1px dashed #9ab8e8;
  border-radius: var(--radius);
  background: #f8fbff;
  cursor: pointer;
  text-align: center;
}

.drop-upload input,
.inline-upload-row input,
.reference-upload-button input,
.image-source-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 24px;
}

.drop-upload em,
.inline-upload-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.manual-requirement-grid {
  display: grid;
  gap: 16px;
}

.manual-requirement-grid textarea {
  min-height: 150px;
}

.manual-requirement-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.manual-requirement-grid label small,
.image-prompt-field small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
}

.bid-category-block {
  display: grid;
  gap: 12px;
}

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

.bid-category-card {
  min-height: 74px;
  padding: 13px;
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.bid-category-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.bid-category-card.active {
  border-color: var(--primary);
  background: #f6f9ff;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.tender-interpretation-panel {
  margin-top: 24px;
  padding: 18px;
  display: grid;
  gap: 16px;
  border: 1px solid #a9d5bb;
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  background: #f7fcf8;
}

.tender-interpretation-panel.stale {
  border-color: #f1c27d;
  border-left-color: var(--warning);
  background: #fffaf2;
}

.tender-result-head,
.tender-result-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tender-result-head {
  justify-content: space-between;
}

.tender-result-head > div {
  align-items: baseline;
}

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

.tender-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.tender-result-grid > div {
  min-height: 92px;
  padding: 13px;
  display: grid;
  align-content: start;
  gap: 8px;
  background: #fff;
}

.tender-result-grid > div.wide {
  grid-column: 1 / -1;
  min-height: 74px;
}

.tender-result-grid span {
  color: var(--muted);
  font-size: 12px;
}

.tender-result-grid strong {
  line-height: 1.55;
}

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

.focus-tag-row b {
  padding: 5px 9px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
}

.segmented-control {
  width: fit-content;
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.segmented-control button {
  min-height: 32px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
}

.segmented-control button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.inline-upload-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed #9ab8e8;
  border-radius: var(--radius);
  background: #f8fbff;
  cursor: pointer;
}

.inline-upload-row > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
}

.inline-upload-row em {
  margin-left: auto;
}

.paste-list-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.paste-list-panel textarea {
  min-height: 130px;
}

.paste-list-panel button {
  min-height: 42px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
}

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

.reference-upload-item {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.reference-upload-item > div:first-child {
  display: grid;
  gap: 5px;
}

.reference-upload-item > div:first-child span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.reference-upload-button {
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

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

.image-source-card {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.image-source-card.active {
  border-color: var(--primary);
  background: #f6f9ff;
  box-shadow: inset 0 0 0 1px var(--primary);
}

.image-source-symbol {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

.image-source-choice {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

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

.image-source-settings {
  min-width: 54px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #b9cdf4;
  border-radius: 4px;
  background: #fff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.source-check {
  width: 18px;
  height: 18px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-style: normal;
}

.image-source-card.active .source-check {
  display: grid;
}

.image-prompt-field textarea {
  min-height: 86px;
}

.modern-file-list .file-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
}

.modern-file-list .file-item.is-parsing {
  border-color: #8fb3f4;
  background: #f7faff;
}

.modern-file-list .file-item.is-error {
  border-color: #efb3b3;
  background: #fff8f8;
}

.modern-file-list .file-item.is-finished {
  border-color: #b8ddca;
}

.file-type-mark {
  width: 38px;
  height: 38px;
  border-radius: 5px;
}

.file-item-copy {
  min-width: 0;
  display: grid !important;
  gap: 3px;
  margin: 0 !important;
}

.file-item-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-copy em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.file-parse-progress {
  width: 100%;
  height: 3px;
  margin: 2px 0 0 !important;
  overflow: hidden;
  border-radius: 2px;
  background: #dce7f9;
}

.file-parse-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 180ms ease;
}

.file-item-actions {
  display: flex !important;
  align-items: center;
  gap: 3px;
  margin: 0 !important;
  color: inherit !important;
}

.file-remove,
.file-retry {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
}

.file-retry {
  color: var(--primary);
  font-size: 18px;
}

.file-remove:hover,
.file-retry:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.package-selection-panel,
.package-selection-summary {
  margin-top: 12px;
  border: 1px solid #b9cae8;
  border-radius: 6px;
  background: #f8faff;
}

.package-selection-panel {
  padding: 14px;
}

.package-selection-head,
.package-selection-actions,
.package-selection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.package-selection-head strong,
.package-selection-head span,
.package-selection-summary strong {
  display: block;
}

.package-selection-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.package-detection-badge {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 4px 8px;
  border-radius: 4px;
  background: #fff3d6;
  color: #8a5b00 !important;
  font-weight: 700;
}

.package-option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.package-option,
.whole-package-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #ccd3df;
  border-radius: 5px;
  background: #fff;
  color: #3c4658;
  cursor: pointer;
}

.package-option.active,
.whole-package-option.active {
  border-color: var(--primary);
  background: #eef4ff;
  color: var(--primary);
}

.package-option input,
.whole-package-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
}

.package-selection-actions {
  padding-top: 12px;
  border-top: 1px solid #dce3ef;
}

.package-selection-summary {
  padding: 11px 12px;
}

.package-selection-summary > div {
  min-width: 0;
}

.package-selection-summary span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.package-selection-summary em {
  max-width: 260px;
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 4px;
  background: #e8f4ef;
  color: #176a4b;
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-fill-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 24px -32px -96px;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.06);
}

.info-fill-sticky-actions button {
  min-height: 40px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
}

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

.next-action-wrap > span {
  max-width: 260px;
  color: var(--warning);
  font-size: 12px;
  text-align: right;
}

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

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

.info-card.wide {
  grid-column: 1 / -1;
}

.info-card span {
  color: var(--muted);
  line-height: 1.6;
}

.table-block {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.table-block h3 {
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  background: var(--panel-soft);
  font-size: 13px;
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--panel-soft);
}

.catalog-list,
.content-list,
.direction-list,
.admin-list {
  display: grid;
  gap: 12px;
}

.catalog-card,
.content-card,
.direction-card,
.admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.catalog-head,
.content-head,
.direction-head,
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-model-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-model-heading > div {
  min-width: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.field-small {
  max-width: 160px;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-text {
  background: transparent;
  color: var(--danger);
  padding: 0;
}

.direction-meta,
.subsection-list,
.helper-list {
  display: grid;
  gap: 8px;
}

.subsection-item {
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}

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

.subsection-item span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.6;
}

.content-card textarea {
  min-height: 280px;
}

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

.content-card-actions > span {
  color: #66758b;
  font-size: 11px;
}

.content-history {
  border-top: 1px solid #e4e9f1;
  background: #f8fafc;
}

.content-history summary {
  padding: 11px 14px;
  color: #315a98;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.content-history-list {
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.content-history-list button {
  min-width: 0;
  min-height: 70px;
  padding: 10px;
  border: 1px solid #d8e1ed;
  background: #fff;
  color: #26364d;
  display: grid;
  align-content: start;
  gap: 4px;
  text-align: left;
}

.content-history-list button:hover {
  border-color: #8bacdf;
  background: #f5f9ff;
}

.content-history-list strong,
.content-history-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-history-list span {
  color: #778399;
  font-size: 11px;
}

.content-history-list em {
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

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

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.admin-section-nav {
  position: sticky;
  top: 88px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.admin-section-nav-head {
  min-height: 76px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.admin-section-nav-head strong,
.admin-section-nav-head span {
  display: block;
}

.admin-section-nav-head strong {
  font-size: 15px;
}

.admin-section-nav-head div > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.admin-section-nav nav {
  display: grid;
  padding: 6px;
}

.admin-section-nav nav button {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #354052;
  text-align: left;
}

.admin-section-nav nav button:hover {
  background: #f3f6fa;
}

.admin-section-nav nav button.active {
  border-left-color: #2563eb;
  background: #edf4ff;
  color: #174ea6;
}

.admin-section-nav nav button em {
  min-width: 24px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.admin-section-nav-status {
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.admin-section-nav-status span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #16a34a;
}

.admin-section-content {
  min-width: 0;
}

.admin-page-section {
  display: grid;
  gap: 16px;
}

.admin-page-head {
  min-height: 62px;
  padding-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-page-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.admin-page-head p {
  margin: 0;
  color: var(--muted);
}

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

.admin-overview-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 16px;
  color: inherit;
  text-align: left;
}

button.metric {
  cursor: pointer;
}

button.metric:hover {
  border-color: #9db8de;
  background: #f4f8fd;
}

.metric strong,
.metric span,
.metric em {
  display: block;
}

.metric strong {
  font-size: 26px;
}

.metric span {
  margin-top: 6px;
  color: var(--muted);
}

.metric em {
  margin-top: 12px;
  color: #778399;
  font-size: 12px;
  font-style: normal;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.pill.ok {
  color: var(--success);
  border-color: #86efac;
  background: #f0fdf4;
}

.pill.off {
  color: var(--warning);
  border-color: #fdba74;
  background: #fff7ed;
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .flash {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
  }

  .catalog-workbench-panel,
  .planning-context-scroll {
    padding: 12px;
  }

  .planning-context-tabs,
  .catalog-variant-tabs {
    grid-template-columns: repeat(3, minmax(132px, 1fr));
    overflow-x: auto;
  }

  .planning-context-tabs button {
    white-space: normal;
  }

  .planning-panel-actions {
    flex-wrap: wrap;
  }

  .planning-panel-actions button {
    flex: 1 1 140px;
  }

  .catalog-regenerate-control,
  .catalog-workbench-list .catalog-form {
    grid-template-columns: 1fr;
  }

  .catalog-regenerate-control label,
  .catalog-workbench-list .catalog-title-field,
  .catalog-workbench-list .field-full {
    grid-column: auto;
  }
}

@media (max-width: 1200px) {
  .catalog-planning-shell {
    height: auto;
    grid-template-columns: 1fr;
  }

  .planning-context-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .planning-context-scroll {
    max-height: 560px;
  }

  .catalog-workbench-panel {
    grid-template-rows: auto;
  }

  .catalog-workbench-list {
    max-height: 680px;
  }

  .step-strip,
  .workflow-grid,
  .choice-grid,
  .check-grid,
  .upload-grid,
  .bid-category-grid,
  .reference-upload-grid,
  .image-source-grid,
  .admin-overview-metrics,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-form,
  .direction-form,
  .admin-form,
  .info-grid,
  .file-panes,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .model-card-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }

  .compact-settings-grid {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topbar,
  .stage-head,
  .admin-page-head,
  .catalog-workbench-head,
  .catalog-variant-summary,
  .catalog-toolbar {
    flex-direction: column;
  }

  .catalog-workbench-head > button,
  .catalog-toolbar,
  .catalog-toolbar > div,
  .catalog-toolbar > button {
    width: 100%;
  }

  .catalog-toolbar > div {
    flex-wrap: wrap;
  }

  .catalog-regenerate-control {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .catalog-regenerate-control label {
    grid-column: 1 / -1;
  }

  .catalog-workbench-list .catalog-form {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-workbench-list .catalog-title-field,
  .catalog-workbench-list .field-full {
    grid-column: 1 / -1;
  }

  .catalog-subsection-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
  }

  .catalog-subsection-row [data-role="subsection-brief"] {
    grid-column: 2 / -1;
  }

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

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

  .admin-section-nav {
    position: static;
  }

  .admin-section-nav-head,
  .admin-section-nav-status {
    display: none;
  }

  .admin-section-nav nav {
    display: flex;
    overflow-x: auto;
    padding: 6px;
  }

  .admin-section-nav nav button {
    min-width: 130px;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .admin-section-nav nav button.active {
    border-bottom-color: #2563eb;
  }

  .step-strip,
  .workflow-grid,
  .choice-grid,
  .check-grid,
  .upload-grid,
  .parse-mode-grid,
  .bid-category-grid,
  .reference-upload-grid,
  .image-source-grid,
  .tender-result-grid,
  .form-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .tender-result-grid > div.wide {
    grid-column: auto;
  }

  .info-fill-stage {
    padding: 20px 16px 104px;
  }

  .info-fill-section-title,
  .tender-result-head,
  .info-fill-sticky-actions,
  .next-action-wrap,
  .technical-basis-head,
  .technical-basis-toolbar,
  .technical-basis-dialog footer {
    align-items: stretch;
    flex-direction: column;
  }

  .info-fill-section-title {
    gap: 8px;
  }

  .inline-upload-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .inline-upload-row em {
    width: 100%;
    margin-left: 36px;
  }

  .paste-list-panel {
    grid-template-columns: 1fr;
  }

  .info-fill-sticky-actions {
    margin: 22px -16px -104px;
    padding: 12px 16px;
  }

  .next-action-wrap {
    width: 100%;
  }

  .next-action-wrap > span {
    max-width: none;
    text-align: left;
  }

  .technical-basis-toolbar > div,
  .technical-basis-dialog footer > div,
  .requirement-catalog-dialog footer > div {
    flex-wrap: wrap;
  }

  .technical-basis-toolbar button,
  .technical-basis-dialog footer button,
  .requirement-catalog-dialog footer button {
    flex: 1 1 160px;
  }

  .technical-basis-table {
    overflow-x: auto;
  }

  .technical-basis-search-form {
    grid-template-columns: 1fr;
  }

  .requirement-catalog-status,
  .requirement-catalog-dialog header,
  .requirement-catalog-dialog footer {
    align-items: stretch;
    flex-direction: column;
  }

  .requirement-catalog-status button,
  .requirement-catalog-dialog footer > div {
    width: 100%;
  }

  .info-fill-sticky-actions button {
    width: 100%;
  }

  .package-selection-head,
  .package-selection-actions,
  .package-selection-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .package-selection-actions button,
  .package-selection-summary button {
    width: 100%;
  }

  .package-option-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .score-planning-next {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .score-planning-next button {
    width: 100%;
    min-width: 0;
  }

  .launcher {
    padding-top: 18px;
  }

  .launcher-copy {
    text-align: left;
    justify-items: start;
  }

  .launcher-copy h2 {
    font-size: 28px;
  }

  .launcher-summary {
    grid-template-columns: 1fr;
  }

  .launcher-summary div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .settings-stage {
    padding: 20px 16px 86px;
  }

  .select-card-grid,
  .model-card-grid {
    grid-template-columns: 1fr;
  }

  .visual-card-scroller {
    grid-auto-columns: 174px;
  }

  .layout-card-grid {
    grid-auto-columns: 250px;
  }

  .style-preview-modal {
    padding: 12px;
  }

  .image-count-grid,
  .image-layout-grid,
  .image-style-grid,
  .image-inline-settings,
  .private-image-body {
    grid-template-columns: 1fr;
  }

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

  .settings-sticky-actions {
    margin: 22px -16px -86px;
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .settings-sticky-actions button {
    min-width: 0;
    flex: 1 1 150px;
  }
}

/* Compact workbench shell and launcher inspired by the audited production flow. */
.app-shell {
  grid-template-columns: 148px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  background: #fff;
}

.brand-button {
  width: 100%;
  height: 48px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
}

.brand-button .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 14px;
}

.brand-text {
  color: #0f356d;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.side-nav {
  width: 100%;
  display: grid;
  gap: 6px;
}

.side-nav button {
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #516078;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
}

.side-nav button:hover,
.side-nav button.active {
  border-color: #d9e4f4;
  background: #f1f5fb;
  color: var(--primary);
}

.side-nav button span {
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.side-nav button em {
  font-size: 13px;
  font-style: normal;
  line-height: 1;
}

.sidebar-user {
  width: 36px;
  height: 36px;
  margin: auto auto 0;
  border-radius: 50%;
  background: #13233f;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.main {
  min-width: 0;
  padding: 0 16px 28px;
  gap: 14px;
}

.topbar {
  min-height: 60px;
  padding: 10px 0;
  align-items: center;
  border-bottom: 1px solid #e8edf5;
  background: rgba(255, 255, 255, 0.96);
}

.launcher-topbar {
  justify-content: flex-end;
}

.launcher-topbar .header-copy {
  display: none;
}

.launcher-topbar .header-actions {
  width: 100%;
  align-items: center;
  justify-content: flex-end;
}

.launcher-topbar .header-actions::before {
  display: none;
}

.utility-button,
.utility-user {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #dce4ef;
  border-radius: 17px;
  background: #fff;
  color: #46556e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.utility-button:hover {
  border-color: #a9c2e9;
  color: var(--primary);
}

.launcher-topbar .header-actions .utility-button {
  min-height: 34px;
  padding: 0 13px;
  background: #fff;
  color: #46556e;
  border: 1px solid #dce4ef;
}

.launcher-topbar .header-actions .utility-button:hover {
  border-color: #a9c2e9;
  color: var(--primary);
}

.utility-user {
  background: #f8fafc;
}

.launcher {
  min-height: auto;
  padding: 0 0 40px;
  gap: 18px;
}

.launcher-promo {
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 4px;
  background: #f04438;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.launcher-promo strong {
  font-size: 16px;
}

.launcher-promo span {
  opacity: 0.9;
  font-size: 13px;
}

.launcher-promo button {
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: #fff;
  color: #c62828;
  font-weight: 700;
}

.launcher-copy {
  min-height: 196px;
  padding: 54px 12px 34px;
  align-content: center;
}

.launcher-copy h2 {
  font-size: 38px;
  color: #101828;
}

.launcher-copy p {
  max-width: 820px;
}

.workflow-grid {
  gap: 12px;
}

.workflow-card {
  position: relative;
  min-height: 154px;
  padding: 28px 112px 24px 26px;
  border: 1px solid #dbe5f5;
  border-top-width: 1px;
  box-shadow: none;
  overflow: hidden;
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 9px;
}

.workflow-card.blue {
  border-color: #d5e2ff;
  background: #edf3ff;
}

.workflow-card.green {
  border-color: #cfece6;
  background: #eaf8f5;
}

.workflow-card.cyan {
  border-color: #cde8f3;
  background: #ebf8fc;
}

.workflow-card:hover {
  border-color: #87aee9;
  box-shadow: 0 10px 24px rgba(24, 52, 88, 0.09);
}

.workflow-visual {
  position: absolute;
  right: 24px;
  top: 26px;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.08);
}

.workflow-visual b {
  position: absolute;
  left: -78px;
  top: -10px;
  color: #6b7a92;
  font-size: 12px;
}

.workflow-visual i {
  color: var(--primary);
  font-size: 27px;
  font-style: normal;
  font-weight: 900;
}

.workflow-title {
  font-size: 20px;
}

.workflow-desc {
  color: #637089;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.workflow-action {
  font-size: 13px;
}

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

.feature-card {
  position: relative;
  min-height: 82px;
  padding: 15px 72px 15px 16px;
  border: 1px solid #e3e8f0;
  background: #fff;
  color: var(--text);
  text-align: left;
  overflow: hidden;
}

.feature-card:hover {
  border-color: #a8bee0;
  background: #f8fbff;
}

.feature-copy {
  display: grid;
  gap: 6px;
}

.feature-copy strong,
.feature-copy em {
  display: block;
}

.feature-copy strong {
  font-size: 15px;
}

.feature-copy em {
  color: #6b778d;
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.feature-icon {
  position: absolute;
  right: 15px;
  top: 15px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eef4ff;
  color: #2563eb;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 900;
}

.feature-card:nth-child(2) .feature-icon,
.feature-card:nth-child(5) .feature-icon {
  background: #e8f8f2;
  color: #087f5b;
}

.feature-card:nth-child(3) .feature-icon,
.feature-card:nth-child(6) .feature-icon {
  background: #f3edff;
  color: #6941c6;
}

.feature-card:nth-child(4) .feature-icon,
.feature-card:nth-child(7) .feature-icon {
  background: #fff1e8;
  color: #c2410c;
}

.feature-tag {
  position: absolute;
  right: -28px;
  top: 8px;
  width: 92px;
  padding: 3px 0;
  background: #f04438;
  color: #fff;
  text-align: center;
  transform: rotate(38deg);
  font-size: 10px;
  z-index: 2;
}

.goods-choice-backdrop {
  position: fixed;
  inset: 0;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
  display: grid;
  place-items: center;
  z-index: 120;
}

.goods-choice-dialog {
  width: min(680px, 100%);
  border: 1px solid #d9e2ef;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.goods-choice-dialog header {
  padding: 18px 20px;
  border-bottom: 1px solid #e3e8f0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.goods-choice-dialog header span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.goods-choice-dialog h3 {
  margin: 5px 0 0;
  font-size: 21px;
}

.goods-choice-dialog header button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid #dce3ed;
  background: #fff;
  color: #536176;
  font-size: 22px;
}

.goods-choice-options {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.goods-choice-options button {
  min-height: 150px;
  padding: 20px;
  border: 1px solid #d9e2ef;
  background: #f8fbff;
  color: #172033;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 8px;
  text-align: left;
}

.goods-choice-options button:hover {
  border-color: #7aa2dd;
  background: #f1f6ff;
}

.goods-choice-options strong {
  font-size: 18px;
}

.goods-choice-options em {
  color: #6f7c91;
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.goods-choice-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #eaf2ff;
  color: #2563eb;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.goods-choice-icon.alt {
  background: #e8f8f2;
  color: #087f5b;
}

.template-market,
.recent-projects-section {
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 16px;
}

.market-notice {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #bdd4ff;
  border-radius: 8px;
  background: #f5f9ff;
  color: #58677f;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
}

.market-notice strong {
  color: #2563eb;
  font-size: 13px;
}

.market-head,
.recent-projects-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.market-head span,
.recent-projects-head span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.market-head h3,
.recent-projects-head h3 {
  margin: 5px 0 0;
  font-size: 22px;
}

.market-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.market-meta span {
  padding: 6px 10px;
  border: 1px solid #dce5f1;
  border-radius: 14px;
  background: #fff;
  color: #657188;
  font-weight: 500;
}

.market-tabs {
  display: flex;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}

.market-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.market-tabs button:hover {
  color: #1d4ed8;
  background: #f8fafc;
}

.market-tabs button.active {
  border-bottom-color: #2563eb;
  color: #1d4ed8;
  background: #eef4ff;
}

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

.template-card {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 1px solid #dde5f0;
  background: #fff;
  color: var(--text);
  text-align: left;
  overflow: hidden;
}

.template-card:hover {
  border-color: #88aee8;
  box-shadow: 0 10px 22px rgba(24, 52, 88, 0.08);
}

.template-card img {
  width: 100%;
  display: block;
  object-fit: cover;
  border-bottom: 1px solid #e4e9f1;
}

.template-card.word img {
  aspect-ratio: 3 / 4;
}

.template-card.ppt img {
  aspect-ratio: 16 / 10;
}

.template-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  min-width: 43px;
  padding: 4px 7px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.86);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.template-card-copy {
  min-height: 112px;
  padding: 11px;
  display: grid;
  align-content: start;
  gap: 5px;
}

.template-card-copy strong {
  font-size: 13px;
  line-height: 1.35;
}

.template-card-copy em {
  color: #6c788c;
  font-size: 11px;
  font-style: normal;
  line-height: 1.45;
}

.template-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.template-card-tags i {
  padding: 3px 5px;
  border-radius: 3px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 9px;
  font-style: normal;
}

.creation-market {
  min-height: 260px;
}

.creation-market-card {
  width: min(820px, 100%);
  min-height: 260px;
  padding: 0;
  border: 1px solid #dbe4ef;
  background: #fff;
  color: #172033;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  overflow: hidden;
  text-align: left;
}

.creation-market-card:hover {
  border-color: #8aabe0;
  box-shadow: 0 12px 26px rgba(24, 52, 88, 0.08);
}

.creation-market-card > img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  border-right: 1px solid #e2e8f0;
}

.creation-market-copy {
  padding: 28px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
}

.creation-market-copy > span:first-child {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.creation-market-copy strong {
  font-size: 24px;
}

.creation-market-copy em {
  color: #68758a;
  font-size: 13px;
  font-style: normal;
  line-height: 1.65;
}

.creation-market-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.creation-market-tags i {
  padding: 5px 8px;
  border: 1px solid #dbe6f5;
  border-radius: 4px;
  color: #526178;
  font-size: 11px;
  font-style: normal;
}

.creation-market-copy b {
  margin-top: 4px;
  padding: 8px 14px;
  border-radius: 4px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
}

.template-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  padding: 22px;
  background: rgba(15, 23, 42, 0.56);
  display: grid;
  place-items: center;
}

.template-detail-dialog {
  width: min(1120px, 100%);
  max-height: calc(100vh - 44px);
  border: 1px solid #d7e0eb;
  background: #fff;
  box-shadow: 0 26px 74px rgba(15, 23, 42, 0.26);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.template-detail-header,
.template-detail-actions {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.template-detail-header {
  border-bottom: 1px solid #e1e7ef;
}

.template-detail-header > div {
  min-width: 0;
}

.template-detail-header span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
}

.template-detail-header h3 {
  margin: 4px 0 0;
  font-size: 21px;
}

.template-detail-header > button,
.template-detail-pager button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid #dce3ed;
  background: #fff;
  color: #526178;
  font-size: 20px;
}

.template-detail-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(360px, 0.92fr);
  overflow: auto;
}

.template-preview-panel {
  min-width: 0;
  padding: 22px;
  border-right: 1px solid #e3e8f0;
  background: #f7f9fc;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 12px;
}

.template-preview-main {
  width: 100%;
  height: 100%;
  min-height: 360px;
  max-height: 520px;
  object-fit: contain;
  border: 1px solid #d7e0eb;
  background: #fff;
}

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

.template-preview-thumbs button {
  min-height: 62px;
  padding: 3px;
  border: 1px solid #d8e0eb;
  border-radius: 3px;
  background: #fff;
}

.template-preview-thumbs button.active {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.template-preview-thumbs img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  display: block;
}

.template-detail-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.template-detail-pager span {
  min-width: 62px;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

.template-detail-copy {
  min-width: 0;
  padding: 24px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.template-detail-copy > p {
  margin: 0;
  color: #5f6d82;
  line-height: 1.75;
}

.template-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-detail-tags span {
  padding: 5px 8px;
  border-radius: 4px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
}

.template-ppt-notice {
  padding: 11px 12px;
  border-left: 3px solid #2563eb;
  background: #f1f6ff;
  color: #40516b;
  font-size: 12px;
  line-height: 1.6;
}

.template-feature-list,
.template-config-list {
  display: grid;
  gap: 9px;
}

.template-feature-list h4,
.template-config-list h4 {
  margin: 0 0 2px;
  font-size: 14px;
}

.template-feature-list > span {
  position: relative;
  padding-left: 18px;
  color: #536176;
  font-size: 12px;
  line-height: 1.55;
}

.template-feature-list > span::before {
  position: absolute;
  left: 0;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  content: "";
}

.template-config-list > div {
  padding: 8px 0;
  border-bottom: 1px solid #edf0f5;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
}

.template-config-list span {
  color: #7a8799;
  font-size: 12px;
}

.template-config-list strong {
  color: #28364c;
  font-size: 12px;
  font-weight: 600;
}

.template-detail-actions {
  border-top: 1px solid #e1e7ef;
  justify-content: flex-end;
}

.template-detail-actions button {
  min-height: 40px;
  padding: 0 18px;
}

.recent-projects-head button {
  min-height: 36px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
}

.recent-projects-section .recent-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.recent-project-row {
  position: relative;
  display: block;
}

.recent-card {
  min-height: 82px;
  padding: 14px 54px 14px 14px;
  border-color: #e0e7f0;
  background: #fff;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.recent-card:hover {
  border-color: #9ab7e0;
  background: #f8fbff;
}

.recent-project-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #eef4ff;
  color: #2563eb;
  display: grid !important;
  place-items: center;
  font-weight: 900;
}

.recent-project-copy {
  min-width: 0;
}

.recent-delete {
  position: absolute;
  right: 8px;
  top: 8px;
  width: auto;
  min-height: 28px;
  padding: 0 8px;
  z-index: 2;
}

.project-library {
  display: grid;
  gap: 22px;
}

.project-library-head {
  min-height: 92px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.project-library-head > div {
  min-width: 0;
}

.project-library-head span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.project-library-head h2 {
  margin: 5px 0 7px;
  font-size: 28px;
}

.project-library-head p {
  margin: 0;
  color: #68758a;
  font-size: 13px;
}

.project-library-head > button {
  min-height: 40px;
  padding: 0 18px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

.project-library-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 20px;
}

.project-library-nav {
  align-self: start;
  border-right: 1px solid #e2e8f0;
  display: grid;
}

.project-library-nav button {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: #59687e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  text-align: left;
}

.project-library-nav button > span {
  white-space: nowrap;
}

.project-library-nav button:hover {
  background: #f8fafc;
  color: #1d4ed8;
}

.project-library-nav button.active {
  border-left-color: #2563eb;
  background: #eef4ff;
  color: #1d4ed8;
  font-weight: 700;
}

.project-library-nav b {
  min-width: 24px;
  padding: 3px 6px;
  border-radius: 8px;
  background: #e7edf6;
  color: #657188;
  font-size: 10px;
  text-align: center;
}

.project-library-nav button.active b {
  background: #dbe8ff;
  color: #1d4ed8;
}

.project-library-content {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.project-library-notice {
  min-height: 42px;
  padding: 11px 13px;
  border-left: 3px solid #2563eb;
  background: #f3f7ff;
  color: #526178;
  font-size: 12px;
  line-height: 1.6;
}

.project-table-shell {
  min-width: 0;
  border: 1px solid #dfe6ef;
  overflow-x: auto;
  background: #fff;
}

.project-table {
  width: 100%;
  min-width: 855px;
  border-collapse: collapse;
  table-layout: fixed;
}

.project-table th,
.project-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #e8edf4;
  color: #48566c;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.project-table th {
  background: #f8fafc;
  color: #68758a;
  font-weight: 700;
}

.project-table th:nth-child(1),
.project-table td:nth-child(1) {
  width: 60px;
  text-align: center;
}

.project-table th:nth-child(2),
.project-table td:nth-child(2) {
  width: 210px;
}

.project-table th:nth-child(3),
.project-table td:nth-child(3) {
  width: 115px;
}

.project-table th:nth-child(4),
.project-table td:nth-child(4) {
  width: 75px;
}

.project-table th:nth-child(5),
.project-table td:nth-child(5) {
  width: 145px;
}

.project-table th:nth-child(6),
.project-table td:nth-child(6) {
  width: 250px;
}

.project-table tbody tr:hover {
  background: #fbfdff;
}

.project-table td > strong,
.project-table td > span {
  display: block;
}

.project-table td > strong {
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-table td > strong + span {
  margin-top: 5px;
  overflow: hidden;
  color: #7a8799;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-status {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid #d6e3f7;
  border-radius: 4px;
  background: #f3f7ff;
  color: #2563eb;
  font-weight: 700;
}

.project-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.project-row-actions button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #536176;
  font-size: 11px;
}

.project-row-actions button:hover {
  border-color: #d7e0ec;
  background: #f8fafc;
  color: #1d4ed8;
}

.project-row-actions .danger-link {
  color: #c93535;
}

.project-row-actions .danger-link:hover {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b42318;
}

.project-row-actions .primary-link {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.project-row-actions .primary-link:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.project-library-empty {
  padding: 48px 20px;
  color: #7a8799;
  text-align: center;
}

.project-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1800;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
  display: grid;
  place-items: center;
}

.project-preview-dialog,
.project-rename-dialog {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.project-preview-dialog header,
.project-preview-dialog footer,
.project-rename-dialog header,
.project-rename-dialog footer {
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.project-preview-dialog header,
.project-rename-dialog header {
  border-bottom: 1px solid #e2e8f0;
}

.project-preview-dialog header span,
.project-rename-dialog header span {
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
}

.project-preview-dialog h3,
.project-rename-dialog h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.project-preview-dialog header > button,
.project-rename-dialog header > button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid #dce3ed;
  background: #fff;
  color: #526178;
  font-size: 21px;
}

.project-preview-body {
  min-height: 0;
  padding: 18px;
  overflow: auto;
  display: grid;
  gap: 18px;
}

.project-preview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #dfe6ef;
}

.project-preview-metrics > div {
  min-width: 0;
  padding: 13px;
  border-right: 1px solid #e5eaf1;
  display: grid;
  gap: 5px;
}

.project-preview-metrics > div:last-child {
  border-right: 0;
}

.project-preview-metrics span {
  color: #7a8799;
  font-size: 11px;
}

.project-preview-metrics strong {
  overflow: hidden;
  color: #27364c;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-preview-body section {
  display: grid;
  gap: 8px;
}

.project-preview-body h4 {
  margin: 0;
  font-size: 14px;
}

.project-preview-body p {
  margin: 0;
  max-height: 180px;
  overflow: auto;
  color: #59677d;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.project-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-preview-tags span {
  padding: 6px 9px;
  border: 1px solid #dbe4ef;
  border-radius: 4px;
  background: #f8fafc;
  color: #526178;
  font-size: 11px;
}

.project-preview-dialog footer,
.project-rename-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.project-preview-dialog footer button,
.project-rename-dialog footer button {
  min-height: 38px;
  padding: 0 14px;
}

.project-preview-dialog footer button:not(.secondary),
.project-rename-dialog footer button:not(.secondary) {
  background: #2563eb;
  color: #fff;
}

.project-rename-dialog {
  width: min(520px, 100%);
  grid-template-rows: auto auto auto;
}

.project-rename-dialog > label {
  padding: 20px;
  display: grid;
  gap: 8px;
  color: #36455b;
  font-size: 13px;
  font-weight: 700;
}

.engineering-tool-stage {
  display: grid;
  gap: 18px;
}

.engineering-process {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #dce4ef;
  background: #fff;
}

.engineering-process span {
  min-height: 50px;
  padding: 0 16px;
  color: #7a879b;
  display: flex;
  align-items: center;
  gap: 9px;
  border-right: 1px solid #e5eaf1;
  font-size: 13px;
  font-weight: 700;
}

.engineering-process span:last-child {
  border-right: 0;
}

.engineering-process b {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #cdd6e3;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.engineering-process .active {
  color: #1d4ed8;
  background: #f1f6ff;
}

.engineering-process .complete {
  color: #087f5b;
}

.engineering-process .active b {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.engineering-process .complete b {
  border-color: #0f9f86;
  background: #0f9f86;
  color: #fff;
}

.engineering-tool-head {
  padding: 2px 2px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.engineering-kicker {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.engineering-tool-head h2 {
  margin: 5px 0 7px;
  font-size: 25px;
}

.engineering-tool-head p {
  margin: 0;
  color: #68758a;
  line-height: 1.6;
}

.engineering-history-meta {
  min-width: 96px;
  padding: 10px 14px;
  border-left: 3px solid #2563eb;
  background: #f6f8fc;
  display: grid;
  gap: 2px;
}

.engineering-history-meta strong {
  font-size: 20px;
}

.engineering-history-meta span {
  color: #718096;
  font-size: 12px;
}

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

.engineering-config-panel,
.engineering-preview-panel {
  min-width: 0;
  border: 1px solid #dce4ef;
  background: #fff;
}

.engineering-config-panel {
  padding: 18px;
  display: grid;
  gap: 15px;
}

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

.engineering-field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.engineering-field label {
  color: #26364d;
  font-size: 13px;
  font-weight: 700;
}

.engineering-field input,
.engineering-field textarea,
.engineering-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid #cfd9e7;
  background: #fff;
}

.engineering-field select {
  min-height: 42px;
  padding: 0 34px 0 12px;
  color: #243249;
}

.engineering-field textarea {
  min-height: 88px;
  resize: vertical;
}

.engineering-field .engineering-large-input {
  min-height: 150px;
}

.engineering-output-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.engineering-output-modes label {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #d9e1ec;
  background: #f8fafc;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #324158;
  font-size: 13px;
}

.engineering-output-modes input,
.engineering-ai-toggle input {
  width: 16px;
  height: 16px;
}

.engineering-ai-toggle {
  padding: 12px;
  border: 1px solid #dce5f2;
  background: #f7faff;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  cursor: pointer;
}

.engineering-ai-toggle span {
  display: grid;
  gap: 3px;
}

.engineering-ai-toggle strong {
  font-size: 13px;
}

.engineering-ai-toggle em {
  color: #758196;
  font-size: 11px;
  font-style: normal;
  line-height: 1.45;
}

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

.engineering-preview-panel {
  min-height: 650px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.engineering-preview-head {
  min-height: 62px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.engineering-preview-head > div {
  display: grid;
  gap: 4px;
}

.engineering-preview-head strong {
  font-size: 15px;
}

.engineering-preview-head span {
  color: #748197;
  font-size: 11px;
}

.engineering-warning {
  max-width: 48%;
  color: #b54708 !important;
  text-align: right;
}

.engineering-preview-empty {
  min-height: 570px;
  padding: 24px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: #7b8798;
  text-align: center;
}

.engineering-preview-empty strong {
  color: #435066;
  font-size: 20px;
}

.engineering-svg-wrap {
  min-width: 0;
  padding: 16px;
  overflow: auto;
  background: #f3f6fa;
}

.engineering-svg {
  width: 100%;
  min-width: 760px;
  height: auto;
  display: block;
  border: 1px solid #d6deea;
  background: #fff;
}

.engineering-floor-svg {
  min-width: 660px;
  max-height: 720px;
}

.engineering-diagram-svg {
  min-width: 760px;
  max-height: 820px;
}

.engineering-table-list {
  min-width: 0;
  padding: 14px;
  display: grid;
  gap: 14px;
  align-content: start;
  overflow: auto;
  background: #f5f7fa;
}

.engineering-table-block {
  min-width: 0;
  border: 1px solid #dce4ef;
  background: #fff;
}

.engineering-table-block h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}

.engineering-table-scroll {
  overflow: auto;
}

.engineering-table-block table {
  min-width: 660px;
  margin: 0;
  border: 0;
}

.engineering-table-block th,
.engineering-table-block td {
  padding: 9px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.engineering-history-panel {
  padding: 16px;
  border: 1px solid #dce4ef;
  background: #fff;
  display: grid;
  gap: 13px;
}

.engineering-history-panel > div:first-child {
  display: grid;
  gap: 4px;
}

.engineering-history-panel > div:first-child span {
  color: #758196;
  font-size: 12px;
}

.engineering-history-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.engineering-history-list button {
  min-width: 0;
  min-height: 78px;
  padding: 11px;
  border: 1px solid #dce4ef;
  background: #f8fafc;
  color: #243249;
  display: grid;
  align-content: start;
  gap: 4px;
  text-align: left;
}

.engineering-history-list button:hover {
  border-color: #8bacdf;
  background: #f2f6fd;
}

.engineering-history-list strong,
.engineering-history-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engineering-history-list span {
  color: #78859a;
  font-size: 11px;
}

.engineering-history-list em {
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .template-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .engineering-tool-layout {
    grid-template-columns: minmax(300px, 350px) minmax(0, 1fr);
  }

  .engineering-history-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 8px 12px;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }

  .brand-button {
    flex: 0 0 auto;
    width: 48px;
    padding: 0;
    justify-content: center;
  }

  .brand-text {
    display: none;
  }

  .side-nav {
    width: auto;
    display: flex;
  }

  .side-nav button {
    flex: 0 0 52px;
    width: 52px;
    min-height: 52px;
    padding: 5px 2px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1px;
    text-align: center;
  }

  .side-nav button span {
    font-size: 17px;
  }

  .side-nav button em {
    font-size: 10px;
  }

  .sidebar-user {
    flex: 0 0 36px;
    margin: 0 0 0 auto;
  }

  .main {
    padding: 0 12px 24px;
  }

  .launcher-topbar {
    flex-direction: row;
  }

  .launcher-topbar .header-actions {
    justify-content: flex-end;
  }

  .launcher-topbar .header-actions::before,
  .utility-user {
    display: none;
  }

  .launcher-promo {
    justify-content: space-between;
  }

  .launcher-promo span {
    display: none;
  }

  .launcher-copy {
    min-height: 150px;
    padding: 36px 6px 20px;
    text-align: center;
    justify-items: center;
  }

  .launcher-copy h2 {
    font-size: 30px;
  }

  .workflow-grid,
  .feature-grid,
  .recent-projects-section .recent-list {
    grid-template-columns: 1fr;
  }

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

  .creation-market-card {
    width: 100%;
  }

  .template-detail-body {
    grid-template-columns: 1fr;
  }

  .template-preview-panel {
    border-right: 0;
    border-bottom: 1px solid #e3e8f0;
  }

  .template-preview-main {
    min-height: 320px;
  }

  .market-head,
  .recent-projects-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .market-meta {
    justify-content: flex-start;
  }

  .market-notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 10px 12px;
  }

  .project-library-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-library-nav {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    overflow-x: auto;
  }

  .project-library-nav button {
    flex: 0 0 auto;
    min-width: 160px;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .project-library-nav button.active {
    border-left-color: transparent;
    border-bottom-color: #2563eb;
  }

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

  .project-preview-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .project-preview-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid #e5eaf1;
  }

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

  .engineering-preview-panel {
    min-height: 520px;
  }

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

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

@media (max-width: 560px) {
  .launcher-topbar .utility-button:first-of-type {
    display: none;
  }

  .project-library-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-library-head h2 {
    font-size: 24px;
  }

  .project-library-head > button {
    width: 100%;
  }

  .project-table-shell {
    border: 0;
    overflow: visible;
    background: transparent;
  }

  .project-table {
    min-width: 0;
    display: block;
  }

  .project-table thead {
    display: none;
  }

  .project-table tbody {
    display: grid;
    gap: 12px;
  }

  .project-table tr {
    border: 1px solid #dfe6ef;
    background: #fff;
    display: grid;
  }

  .project-table td {
    width: auto !important;
    min-width: 0;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    text-align: left !important;
  }

  .project-table td::before {
    content: attr(data-label);
    color: #68758a;
    font-size: 11px;
    font-weight: 700;
  }

  .project-table td[colspan] {
    display: block;
  }

  .project-table td[colspan]::before {
    content: none;
  }

  .project-row-actions {
    justify-content: flex-start;
  }

  .project-modal-backdrop {
    padding: 8px;
  }

  .project-preview-dialog,
  .project-rename-dialog {
    max-height: calc(100vh - 16px);
  }

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

  .project-preview-metrics > div {
    border-right: 0;
    border-bottom: 1px solid #e5eaf1;
  }

  .project-preview-metrics > div:last-child {
    border-bottom: 0;
  }

  .project-preview-dialog footer {
    flex-wrap: wrap;
  }

  .project-preview-dialog footer button {
    flex: 1 1 calc(50% - 7px);
  }

  .launcher-copy h2 {
    font-size: 27px;
  }

  .workflow-card {
    padding-right: 94px;
  }

  .workflow-visual {
    right: 15px;
    width: 62px;
    height: 62px;
  }

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

  .market-tabs {
    margin-right: -12px;
    padding-right: 12px;
  }

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

  .creation-market-card > img {
    min-height: 190px;
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .creation-market-copy {
    padding: 20px;
  }

  .template-detail-backdrop {
    padding: 8px;
  }

  .template-detail-dialog {
    max-height: calc(100vh - 16px);
  }

  .template-detail-header,
  .template-detail-copy,
  .template-detail-actions {
    padding: 14px;
  }

  .template-preview-panel {
    padding: 12px;
  }

  .template-preview-main {
    min-height: 220px;
    max-height: 300px;
  }

  .template-config-list > div {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .goods-choice-options {
    grid-template-columns: 1fr;
  }

  .engineering-process {
    grid-template-columns: 1fr;
  }

  .engineering-process span {
    min-height: 42px;
    border-right: 0;
    border-bottom: 1px solid #e5eaf1;
  }

  .engineering-process span:last-child {
    border-bottom: 0;
  }

  .engineering-tool-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .engineering-form-grid {
    grid-template-columns: 1fr;
  }

  .engineering-config-panel {
    padding: 14px;
  }

  .engineering-preview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .engineering-warning {
    max-width: none;
    text-align: left;
  }

  .engineering-history-list {
    grid-template-columns: 1fr;
  }

  .content-card-actions {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .content-history-list {
    grid-template-columns: 1fr;
  }
}

.image-studio {
  display: grid;
  gap: 18px;
}

.image-process {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.image-process span {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-right: 1px solid var(--line);
  color: #718096;
  font-size: 13px;
}

.image-process span:last-child {
  border-right: 0;
}

.image-process span.active {
  background: #eef5ff;
  color: #1d4ed8;
  font-weight: 700;
}

.image-process span.complete {
  color: #087f6f;
}

.image-process b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf1f7;
  font-size: 12px;
}

.image-process .active b {
  background: #2563eb;
  color: #fff;
}

.image-process .complete b {
  background: #d9f6ef;
  color: #087f6f;
}

.image-studio-head,
.image-history-head,
.image-field-head,
.image-result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.image-studio-head {
  padding: 10px 2px 2px;
}

.image-studio-head h2,
.image-history-head h3 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.image-studio-head p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}

.image-kicker,
.image-history-head > div > span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.image-history-count {
  min-width: 100px;
  text-align: right;
}

.image-history-count strong,
.image-history-count span {
  display: block;
}

.image-history-count strong {
  font-size: 28px;
}

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

.image-studio-layout {
  display: grid;
  grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.image-config-panel,
.image-preview-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.image-config-panel {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 18px;
}

.image-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f3f6fa;
}

.image-mode-switch button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: #617086;
  font-size: 13px;
  font-weight: 700;
}

.image-mode-switch button.active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 4px rgba(31, 52, 82, 0.13);
}

.image-field-head label,
.image-setting-block > strong {
  font-size: 13px;
  font-weight: 800;
}

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

.image-config-panel > textarea {
  min-height: 180px;
}

.image-setting-block {
  display: grid;
  gap: 10px;
}

.image-quality-grid,
.image-ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.image-option-card,
.image-ratio-card,
.image-style-toggle label {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.image-option-card,
.image-ratio-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 10px 7px;
  text-align: center;
}

.image-option-card input,
.image-ratio-card input,
.image-style-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-option-card.active,
.image-ratio-card.active,
.image-style-toggle label.active {
  border-color: #2563eb;
  background: #f1f6ff;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.image-option-card strong,
.image-ratio-card strong,
.image-style-toggle strong {
  font-size: 13px;
}

.image-option-card span,
.image-ratio-card span,
.image-style-toggle span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.image-ratio-card i {
  width: 42px;
  display: block;
  border: 2px solid #7c8da3;
  border-radius: 3px;
  background: #edf3f8;
}

.image-ratio-card i[data-ratio-shape="2:1"] {
  height: 21px;
}

.image-ratio-card i[data-ratio-shape="4:3"] {
  height: 31px;
}

.image-ratio-card i[data-ratio-shape="1:1"] {
  width: 34px;
  height: 34px;
}

.image-ratio-card.active i {
  border-color: #2563eb;
  background: #dceaff;
}

.image-style-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.image-style-toggle label {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px 12px;
}

.image-config-panel > button {
  min-height: 46px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
}

.image-config-panel > button:disabled {
  cursor: not-allowed;
  background: #9fb0c6;
}

.image-preview-panel {
  min-height: 620px;
  display: grid;
  overflow: hidden;
}

.image-preview-empty,
.image-generation-state {
  place-self: center;
  width: min(440px, calc(100% - 36px));
  text-align: center;
}

.image-preview-empty > span {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border: 1px solid #b9cff1;
  border-radius: 8px;
  background: #edf5ff;
  color: #2563eb;
  font-size: 24px;
  font-weight: 900;
}

.image-preview-empty strong,
.image-preview-empty p,
.image-generation-state span,
.image-generation-state strong,
.image-generation-state p {
  display: block;
}

.image-preview-empty p,
.image-generation-state p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.image-generation-state > span {
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
}

.image-generation-state > strong {
  font-size: 22px;
}

.image-generation-state.error > span,
.image-generation-state.error > strong {
  color: var(--danger);
}

.image-progress-track {
  height: 10px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 5px;
  background: #e7edf5;
}

.image-progress-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #12a594;
  transition: width 0.25s ease;
}

.image-result {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.image-result-media {
  min-height: 440px;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #eef3f8;
}

.image-result-media img {
  max-width: 100%;
  max-height: 520px;
  display: block;
  border: 1px solid #cad5e2;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

.image-result-copy {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}

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

.image-result-copy p {
  max-height: 74px;
  margin: 0;
  overflow: auto;
  color: #445469;
  line-height: 1.6;
}

.image-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.button-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: var(--radius);
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.image-history-section {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

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

.image-history-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.image-history-card.active {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
}

.image-history-select {
  width: 100%;
  display: grid;
  gap: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.image-history-media {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #edf2f7;
}

.image-history-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-history-media i {
  color: #65758b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.image-history-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.image-history-copy strong {
  min-height: 40px;
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.image-history-copy em {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-history-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #f1b5b5;
  background: #fff;
  color: var(--danger);
  font-size: 19px;
}

@media (max-width: 1180px) {
  .image-studio-layout {
    grid-template-columns: minmax(310px, 350px) minmax(0, 1fr);
  }

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

@media (max-width: 900px) {
  .image-studio-layout {
    grid-template-columns: 1fr;
  }

  .image-preview-panel {
    min-height: 520px;
  }

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

@media (max-width: 560px) {
  .image-process {
    grid-template-columns: 1fr;
  }

  .image-process span {
    min-height: 42px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .image-process span:last-child {
    border-bottom: 0;
  }

  .image-studio-head,
  .image-history-head,
  .image-result-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .image-history-count {
    text-align: left;
  }

  .image-quality-grid,
  .image-ratio-grid {
    grid-template-columns: 1fr;
  }

  .image-option-card,
  .image-ratio-card {
    min-height: 70px;
  }

  .image-history-grid {
    grid-template-columns: 1fr;
  }

  .image-result-media {
    min-height: 320px;
  }
}

@media (max-width: 640px) {
  .catalog-regenerate-control,
  .catalog-workbench-list .catalog-form {
    grid-template-columns: 1fr;
  }

  .catalog-regenerate-control label,
  .catalog-workbench-list .catalog-title-field,
  .catalog-workbench-list .field-full {
    grid-column: auto;
  }

  .catalog-subsection-editor > header {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-subsection-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .catalog-subsection-row [data-role="subsection-brief"],
  .catalog-subsection-row .danger-text {
    grid-column: 2;
  }
}
