:root {
  color-scheme: light;
  --green: #0A84FF;
  --green-dark: #0868D6;
  --green-deep: #0B6BDE;
  --green-soft: rgba(10, 132, 255, 0.09);
  --mint: rgba(10, 132, 255, 0.30);
  --lime: #CFE5FF;
  --ivory: #EDF0F5;
  --white: #FFFFFF;
  --ink: #1D2127;
  --muted: #6E7075;
  --line: #E1E4EA;
  --line-strong: #CBD0D8;
  --red: #E5484D;
  --orange: #E08A3E;
  --shadow: 0 16px 48px rgba(15, 23, 42, 0.10);
  --shadow-small: 0 7px 24px rgba(15, 23, 42, 0.08);
  font-family:
    "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  padding-bottom: 102px;
  background:
    radial-gradient(circle at 10% 5%, rgba(10, 132, 255, 0.06), transparent 28rem),
    radial-gradient(circle at 92% 20%, rgba(10, 132, 255, 0.03), transparent 24rem),
    var(--ivory);
  color: var(--ink);
}

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

button {
  color: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.014;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.shell {
  width: min(1340px, calc(100% - 64px));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--green-deep);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 68px;
  padding: 9px 3.2vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid rgba(10, 132, 255, 0.13);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--green);
  text-decoration: none;
}

.brand-symbol {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 50%;
  font-size: 18.5px;
  font-weight: 900;
}

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

.brand-copy strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy strong i {
  margin-left: 4px;
  color: #6E7075;
  font-style: normal;
  font-weight: 500;
}

.brand-copy small {
  margin-top: 3px;
  color: #6E7075;
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.archive-entry-button {
  gap: 6px;
}

.archive-entry-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.archive-entry-button b {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--green);
  color: #FFFFFF;
  font-size: 10.5px;
  font-weight: 850;
}

.connection-state {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #F2F4F8;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.connection-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #A9ABB0;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
}

.connection-state.verified {
  color: var(--green);
  background: #F2F4F8;
}

.connection-state.verified i {
  background: rgba(10, 132, 255, 0.16);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
}

.connection-state.reachable {
  color: var(--green);
  background: #F2F4F8;
}

.connection-state.reachable i {
  background: rgba(10, 132, 255, 0.16);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
}

.connection-state.configured {
  color: var(--green);
  background: #F2F4F8;
}

.connection-state.configured i {
  background: #A9ABB0;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
}

.connection-state.warning {
  color: var(--orange);
  background: #F2F4F8;
}

.connection-state.warning i {
  background: var(--orange);
}

.connection-state.error {
  color: var(--red);
  background: #FCEDED;
}

.connection-state.error i {
  background: var(--red);
}

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 16px;
  background: none;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease;
}

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

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.button.primary {
  background: var(--green);
  color: #FFFFFF;
  box-shadow: 0 8px 22px rgba(10, 132, 255, 0.19);
}

.button.primary:hover:not(:disabled) {
  background: var(--green-dark);
  box-shadow: 0 10px 26px rgba(10, 132, 255, 0.25);
}

.button.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.button.text-button {
  min-height: 44px;
  padding-inline: 10px;
  color: var(--muted);
}

.button.text-button:hover {
  color: var(--green);
  background: var(--green-soft);
}

.button.large {
  min-height: 50px;
  padding-inline: 22px;
  border-radius: 12px;
}

.danger-text {
  color: #b96a6a !important;
}

.app-main {
  padding-top: 18px;
}

.wizard-progress {
  min-height: 86px;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-small);
}

.wizard-progress > i {
  height: 1px;
  background: var(--line);
}

.step-tab {
  min-width: 132px;
  min-height: 44px;
  display: grid;
  grid-template-columns: 34px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  border: 0;
  padding: 4px;
  background: none;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.step-tab > span {
  width: 34px;
  height: 34px;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--white);
  font-size: 12.5px;
  font-weight: 850;
}

.step-tab strong {
  align-self: end;
  color: #8A8C91;
  font-size: 12.5px;
}

.step-tab small {
  align-self: start;
  margin-top: 2px;
  color: #6E7075;
  font-size: 10.5px;
}

.step-tab.active {
  color: var(--green);
}

.step-tab.active > span {
  border-color: var(--green);
  background: var(--green);
  color: #FFFFFF;
  box-shadow: 0 0 0 5px rgba(10, 132, 255, 0.08);
}

.step-tab.active strong {
  color: var(--green);
}

.step-tab.complete > span {
  border-color: rgba(10, 132, 255, 0.16);
  background: var(--green-soft);
  color: var(--green);
}

.step-tab:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.wizard-frame {
  min-height: calc(100vh - 292px);
  margin-top: 16px;
}

.wizard-panel {
  min-height: calc(100vh - 292px);
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.wizard-panel.active {
  animation: panel-in 220ms ease both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 23px;
}

.panel-heading h1 {
  margin: 7px 0 8px;
  color: var(--green-dark);
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.panel-heading > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.optional-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11.5px;
  font-weight: 800;
}

.optional-badge.required {
  background: var(--lime);
  color: var(--green-deep);
}

.outline-layout {
  display: block;
}

.style-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.7fr);
  gap: 18px;
}

/* ===== STEP 01 v6：选题/教材并排 + 页纲卡在下 ===== */
.outline-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}

@media (max-width: 1020px) {
  .outline-top-grid {
    grid-template-columns: 1fr;
  }
}

.outline-layout .script-card {
  margin-top: 0;
}

.check-card-outline {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.check-card-outline .check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

.check-card-outline .check-row strong {
  color: var(--green-deep);
  font-size: 14.5px;
}

.material-filter-row {
  margin-bottom: 8px;
}

.reference-url-row {
  display: flex;
  gap: 10px;
  margin: 12px 0 4px;
}

.reference-url-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
}

.reference-url-row input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14);
}

.content-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.202);
}

.script-card,
.style-editor {
  overflow: hidden;
  padding: 18px;
}

.card-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
}

.card-toolbar > div:first-child strong,
.card-toolbar > div:first-child small {
  display: block;
}

.card-toolbar > div:first-child strong {
  font-size: 13.5px;
}

.card-toolbar > div:first-child small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.toolbar-actions {
  display: flex;
  gap: 2px;
}

.compact-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-field span {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 750;
}

.compact-field input {
  width: min(370px, 40vw);
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  padding: 0 12px;
  background: #F2F4F8;
  color: var(--ink);
  font-size: 12.5px;
}

.compact-field input:focus {
  border-color: rgba(10, 132, 255, 0.16);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.08);
}

.script-field {
  display: block;
}

.script-field textarea {
  width: 100%;
  min-height: 430px;
  display: block;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(10, 132, 255, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(10, 132, 255, 0.03) 1px, transparent 1px),
    #F2F4F8;
  background-size: 24px 24px;
  color: var(--ink);
  font-family:
    "Cascadia Code", "SFMono-Regular", "Microsoft YaHei UI", monospace;
  font-size: 15px;
  line-height: 1.78;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.script-field textarea::placeholder {
  color: #6E7075;
}

.script-field textarea:focus {
  border-color: rgba(10, 132, 255, 0.16);
  box-shadow: 0 0 0 5px rgba(10, 132, 255, 0.08);
}

.style-script-field textarea {
  min-height: 410px;
}

.inline-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
}

.parse-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.parse-hint::before {
  content: "✓";
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10.5px;
  font-weight: 900;
}

.parse-hint.dirty {
  color: var(--orange);
}

.parse-hint.dirty::before {
  content: "!";
  background: #F2F4F8;
  color: var(--orange);
}

.guide-stack {
  display: grid;
  align-content: start;
  gap: 14px;
}

.guide-card,
.check-card,
.recreate-card,
.export-note-card {
  padding: 20px;
}

.mini-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}

.mini-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13.5px;
  font-weight: 900;
}

.mini-heading h2 {
  margin: 4px 0 0;
  color: var(--green-dark);
  font-size: 18px;
}

.guide-card pre {
  margin: 17px 0 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid #F4F6FA;
  border-radius: 11px;
  background: #F2F4F8;
  color: #6E7075;
  font-family:
    "Cascadia Code", "SFMono-Regular", "Microsoft YaHei UI", monospace;
  font-size: 11.5px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.guide-card pre span {
  color: var(--green);
  font-weight: 900;
}

.guide-card > p {
  margin: 13px 1px 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.65;
}

.check-card {
  background: var(--green-deep);
  color: #FFFFFF;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.check-row span {
  color: #8A8C91;
  font-size: 11.5px;
}

.check-row strong {
  color: var(--lime);
  font-size: 20px;
}

.warning-list {
  margin-top: 9px;
  color: #E08A3E;
  font-size: 10.5px;
  line-height: 1.55;
}

.warning-list:empty {
  display: none;
}

.warning-list p {
  margin: 4px 0 0;
}

.reference-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.7fr);
  gap: 18px;
}

.reference-main {
  padding: 23px;
}

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

.reference-kicker {
  color: var(--green);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.reference-title h2 {
  margin: 7px 0 0;
  font-size: 19px;
}

.auto-pill {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10.5px;
  font-weight: 800;
}

.reference-uploader {
  margin-top: 18px;
}

.reference-dropzone,
.reference-preview {
  width: 100%;
  min-height: 265px;
  border: 1px dashed rgba(10, 132, 255, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.5), transparent 12rem),
    #F2F4F8;
}

.reference-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.reference-dropzone:hover,
.reference-uploader.dragging .reference-dropzone {
  border-color: var(--green);
  background: #F2F4F8;
  transform: translateY(-1px);
}

.upload-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--green);
  color: #FFFFFF;
  font-size: 24px;
  font-weight: 300;
  box-shadow: 0 9px 22px rgba(10, 132, 255, 0.2);
}

.reference-dropzone strong,
.reference-dropzone small {
  display: block;
}

.reference-dropzone strong {
  font-size: 15px;
}

.reference-dropzone small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.reference-preview {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  grid-template-rows: 1fr auto;
  gap: 14px;
  overflow: hidden;
  padding: 12px;
  border-style: solid;
  background: var(--white);
}

.reference-preview img {
  width: 100%;
  height: 210px;
  grid-column: 1 / -1;
  display: block;
  border-radius: 10px;
  object-fit: contain;
  background: #F2F4F8;
}

.reference-file-meta {
  min-width: 0;
  padding-left: 3px;
}

.reference-file-meta strong,
.reference-file-meta small {
  display: block;
}

.reference-file-meta strong {
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-file-meta small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.reference-file-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.reference-file-actions .button {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 11.5px;
}

.reference-status {
  margin: 11px 2px 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.reference-status.active {
  color: var(--green);
}

.reference-status.error {
  color: var(--red);
}

.reference-options {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.reference-options summary {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
}

.reference-options summary span {
  margin-left: 6px;
  color: #6E7075;
  font-size: 10.5px;
  font-weight: 500;
}

.reference-option-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 14px;
  margin-top: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 750;
}

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

.field small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.5;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  padding: 0 12px;
  background: #F2F4F8;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
}

.field input,
.field select {
  height: 43px;
}

.field textarea {
  min-height: 76px;
  padding-block: 10px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(10, 132, 255, 0.16);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.08);
}

.recreate-card {
  background:
    radial-gradient(circle at 100% 0, rgba(10, 132, 255, 0.14), transparent 15rem),
    var(--green-deep);
  color: #FFFFFF;
}

.recreate-card .mini-icon {
  background: var(--lime);
  color: var(--green-deep);
}

.recreate-card .eyebrow {
  color: var(--lime);
}

.recreate-card .mini-heading h2 {
  color: #FFFFFF;
}

.recreate-list {
  display: grid;
  gap: 7px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.recreate-list li {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.recreate-list li > span {
  color: var(--lime);
  font-size: 10.5px;
  font-weight: 900;
}

.recreate-list strong {
  display: block;
  font-size: 12.5px;
}

.recreate-list p {
  margin: 5px 0 0;
  color: #8A8C91;
  font-size: 10.5px;
  line-height: 1.6;
}

.privacy-note {
  margin-top: 17px;
  padding: 11px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #8A8C91;
  font-size: 10.5px;
  line-height: 1.55;
}

.generation-heading {
  align-items: center;
}

.generation-summary {
  display: grid;
  grid-template-columns: 125px 125px 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.generation-summary > div {
  min-height: 75px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.generation-summary strong {
  color: var(--green);
  font-size: 24px;
  line-height: 1;
}

.generation-summary span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
}

.generation-summary .generation-progress {
  gap: 10px;
}

.generation-progress > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.generation-progress > div:first-child span {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
}

.generation-progress small {
  color: var(--muted);
  font-size: 10.5px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #F4F6FA;
}

.progress-track span {
  width: 0;
  height: 100%;
  display: block;
  margin: 0;
  border-radius: inherit;
  background: var(--green);
  transition: width 240ms ease;
}

.empty-state {
  min-height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: #F2F4F8;
}

.empty-state.hidden {
  display: none;
}

.empty-frame {
  width: 132px;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 8px;
  background: var(--white);
  color: var(--green);
  box-shadow: 9px 9px 0 var(--mint);
  font-size: 12.5px;
  font-weight: 900;
}

.empty-state strong {
  display: block;
  font-size: 15px;
}

.empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

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

.slide-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.202);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.slide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

.slide-preview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 82% 17%, rgba(10, 132, 255, 0.16), transparent 9rem),
    var(--green-deep);
}

.slide-preview img {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
}

.slide-preview.has-image img {
  display: block;
}

.slide-preview.has-image .preview-placeholder {
  display: none;
}

.preview-placeholder {
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  color: #6E7075;
}

.preview-placeholder span {
  color: var(--lime);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.preview-placeholder strong {
  font-size: 13.5px;
}

.preview-status {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(237, 240, 245, 0.72);
  color: #8A8C91;
  font-size: 9.5px;
  font-weight: 800;
  backdrop-filter: blur(7px);
}

.preview-status.working {
  color: #6FB2FF;
}

.preview-status.success {
  color: rgba(10, 132, 255, 0.16);
}

.preview-status.error {
  color: #E5484D;
}

.slide-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px 0;
}

.slide-number {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.slide-title {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-excerpt,
.slide-direction {
  margin: 9px 15px 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.slide-direction {
  min-height: 14px;
  margin-bottom: 14px;
  color: var(--green);
  -webkit-line-clamp: 1;
}

.slide-direction:empty {
  display: none;
}

.slide-error {
  margin: 8px 15px 14px;
  color: var(--red);
  font-size: 10.5px;
  line-height: 1.45;
}

.slide-error:empty {
  display: none;
}

.slide-edit-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr);
  gap: 8px;
  padding: 12px 14px 0;
}

.slide-edit-button {
  min-width: 0;
  min-height: 44px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 10px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--green-dark);
  font-size: 13.5px;
  font-weight: 750;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.slide-edit-button:hover:not(:disabled) {
  border-color: var(--green);
  background: #F2F4F8;
  color: var(--green-dark);
}

.slide-edit-button:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.22);
  outline-offset: 2px;
}

.slide-edit-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.slide-history-button {
  grid-column: 1 / -1;
  border-color: rgba(10, 132, 255, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.slide-history-button:not(:disabled) {
  color: var(--green);
}

.slide-actions {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: #F2F4F8;
}

.retry-note {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.retry-button {
  min-height: 36px;
  flex: 0 0 auto;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 9px;
  padding: 0 12px;
  background: var(--white);
  color: var(--green);
  font-size: 10.5px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 150ms ease,
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.retry-button:hover:not(:disabled) {
  border-color: var(--green);
  background: var(--green);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.retry-button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.export-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, 0.65fr);
  gap: 18px;
}

.export-card {
  padding: 32px;
  text-align: center;
}

.export-state-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #F2F4F8;
  color: #6E7075;
  font-size: 24px;
  font-weight: 900;
}

.export-card.ready .export-state-icon {
  background: var(--green);
  color: #FFFFFF;
  box-shadow: 0 10px 28px rgba(10, 132, 255, 0.2);
}

.export-card h2 {
  margin: 8px 0 9px;
  color: var(--green-dark);
  font-size: 25px;
}

.export-card > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.export-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 25px;
  text-align: left;
}

.export-stats > div {
  min-height: 70px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #F2F4F8;
}

.export-stats span,
.export-stats strong {
  display: block;
}

.export-stats span {
  color: var(--muted);
  font-size: 10.5px;
}

.export-stats strong {
  margin-top: 7px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.missing-pages {
  min-height: 20px;
  margin-top: 16px;
  color: var(--orange);
  font-size: 11.5px;
}

.export-button {
  min-width: 260px;
  min-height: 54px;
  margin-top: 17px;
  font-size: 15px;
}

.export-note-card {
  background: #F2F4F8;
}

.export-note-card ul {
  display: grid;
  gap: 13px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.export-note-card li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.export-note-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 900;
}

.export-note-card .button {
  width: 100%;
}

.wizard-footer {
  position: fixed;
  z-index: 45;
  right: 20px;
  bottom: 14px;
  left: 20px;
  min-height: 76px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 11px 14px 11px 18px;
  border: 1px solid rgba(10, 132, 255, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 55px rgba(11, 107, 222, 0.18);
  backdrop-filter: blur(18px);
}

.footer-step {
  text-align: center;
}

.footer-step span,
.footer-step small {
  display: block;
}

.footer-step span {
  color: var(--green);
  font-size: 12.5px;
  font-weight: 850;
}

.footer-step small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

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

.api-dialog {
  width: min(940px, calc(100% - 32px));
  max-height: min(880px, calc(100dvh - 32px));
  overflow: hidden;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 24px;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  box-shadow:
    0 32px 90px rgba(11, 107, 222, 0.24),
    0 10px 28px rgba(11, 107, 222, 0.12);
}

.api-dialog::backdrop {
  background: rgba(237, 240, 245, 0.58);
  backdrop-filter: blur(10px) saturate(0.8);
}

.slide-edit-dialog {
  width: min(680px, calc(100% - 32px));
}

.slide-history-dialog {
  width: min(880px, calc(100% - 32px));
}

.slide-edit-shell {
  max-height: min(760px, calc(100dvh - 32px));
}

.slide-history-shell {
  max-height: min(860px, calc(100dvh - 32px));
}

.slide-edit-content {
  gap: 16px;
}

.slide-history-content {
  gap: 16px;
}

.slide-history-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slide-history-list-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.slide-history-list-heading > span {
  color: var(--muted);
  font-size: 13.5px;
}

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

.slide-history-card {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

.slide-history-card.current {
  border-color: rgba(10, 132, 255, 0.24);
  background: linear-gradient(135deg, #F2F4F8, #FFFFFF);
}

.slide-history-preview {
  overflow: hidden;
  align-self: start;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(10, 132, 255, 0.12);
  border-radius: 11px;
  background: #F2F4F8;
}

.slide-history-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.slide-history-preview.empty {
  display: grid;
  place-items: center;
  padding: 10px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.slide-history-card-content {
  min-width: 0;
}

.slide-history-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slide-history-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #F2F4F8;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
}

.slide-history-badge.current {
  background: #F2F4F8;
  color: var(--green-dark);
}

.slide-history-card-heading time {
  color: var(--muted);
  font-size: 12.5px;
}

.slide-history-card-content > h3 {
  margin: 11px 0 7px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

.slide-history-detail {
  display: -webkit-box;
  overflow: hidden;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.slide-history-detail > strong {
  color: var(--ink);
}

.slide-history-restore-button {
  min-height: 44px;
  margin-top: 12px;
}

.slide-history-footer > p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.slide-edit-fields {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

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

.slide-edit-fields .field {
  display: grid;
  gap: 8px;
}

.slide-edit-fields .field > label {
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
}

.slide-edit-fields .field textarea {
  min-height: 86px;
  resize: vertical;
}

.slide-edit-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(10, 132, 255, 0.28);
  border-radius: 12px;
  background: linear-gradient(135deg, #F2F4F8, #F2F4F8);
  color: var(--green-dark);
  font-size: 15px;
  line-height: 1.65;
}

.slide-edit-footer > p {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.dialog-shell {
  max-height: min(880px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dialog-head,
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dialog-head {
  flex: 0 0 auto;
  align-items: flex-start;
  padding: 26px 30px 24px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 8% 0, rgba(10, 132, 255, 0.42), transparent 17rem),
    linear-gradient(135deg, #F2F4F8, #F2F4F8);
}

.dialog-title-group {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.dialog-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 15px;
  background: linear-gradient(145deg, #F2F4F8, #F4F6FA);
  color: var(--green-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dialog-head .eyebrow {
  margin: 1px 0 0;
  color: var(--green);
  font-size: 10.5px;
  letter-spacing: 0.18em;
}

.dialog-head h2 {
  margin: 5px 0 0;
  color: var(--green-dark);
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.dialog-head p:last-child {
  max-width: 620px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.65;
}

.close-button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.close-button:hover {
  border-color: rgba(10, 132, 255, 0.32);
  background: var(--white);
  color: var(--green-dark);
  box-shadow: var(--shadow-small);
}

.close-button:focus-visible,
.password-control button:focus-visible,
.advanced summary:focus-visible,
.dialog-actions .button:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.2);
  outline-offset: 3px;
}

.dialog-content {
  min-height: 0;
  display: grid;
  gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 30px 24px;
  background: #F2F4F8;
  scrollbar-gutter: stable;
}

.settings-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  background: var(--white);
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.202);
}

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

.section-heading > div,
.advanced-title {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.section-index {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.section-heading h3,
.advanced-title strong {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.4;
}

.section-heading p,
.advanced-title small {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
}

.required-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #F2F4F8;
  color: var(--green);
  font-size: 10.5px;
  font-weight: 800;
}

.api-dialog .field {
  gap: 7px;
  font-size: 13.5px;
}

.api-dialog .field > label,
.api-dialog .field > span {
  color: #8A8C91;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1.4;
}

.api-dialog .field label b {
  margin-left: 4px;
  color: var(--green);
  font-size: 10.5px;
  font-weight: 800;
}

.api-dialog .field label span {
  margin-left: 4px;
  color: #6E7075;
  font-size: 10.5px;
  font-weight: 700;
}

.api-dialog .field small {
  min-height: 15px;
  color: #6E7075;
  font-size: 11.5px;
  line-height: 1.5;
}

.api-dialog .field input,
.api-dialog .field select,
.api-dialog .field textarea {
  border-color: #F4F6FA;
  border-radius: 11px;
  background: #F2F4F8;
  color: #1D2127;
  font-size: 15px;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.api-dialog .field input,
.api-dialog .field select {
  height: 46px;
  padding-inline: 14px;
}

.api-dialog .field textarea {
  min-height: 82px;
  padding: 12px 14px;
  line-height: 1.55;
}

.api-dialog .field input:hover,
.api-dialog .field select:hover,
.api-dialog .field textarea:hover {
  border-color: rgba(10, 132, 255, 0.32);
  background: var(--white);
}

.api-dialog .field input:focus,
.api-dialog .field select:focus,
.api-dialog .field textarea:focus {
  border-color: rgba(10, 132, 255, 0.16);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.11);
}

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

.api-dialog .form-grid {
  gap: 15px 16px;
}

.basic-grid {
  margin-top: 17px;
}

.auto-config-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 17px;
  padding: 13px 14px;
  border: 1px solid rgba(10, 132, 255, 0.28);
  border-radius: 12px;
  background: linear-gradient(135deg, #F2F4F8, #F2F4F8);
  color: var(--green-dark);
}

.auto-config-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 900;
}

.auto-config-note strong {
  display: block;
  font-size: 12.5px;
  line-height: 1.45;
}

.auto-config-note p {
  margin: 3px 0 0;
  color: #6E7075;
  font-size: 11.5px;
  line-height: 1.55;
}

.local-save-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #F4F6FA;
  border-radius: 12px;
  background: #F2F4F8;
}

.local-save-note svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--green);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.local-save-note strong {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
}

.local-save-note p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.wukong-product-field {
  display: grid;
  gap: 8px;
  margin-top: 17px;
  padding: 16px;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 14px;
  background: linear-gradient(135deg, #F2F4F8, #F2F4F8);
}

.wukong-product-field[hidden] {
  display: none;
}

.wukong-product-field > label {
  color: #8A8C91;
  font-size: 16px;
  font-weight: 850;
}

.wukong-product-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 42px 0 14px;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 11px;
  background: var(--white);
  color: #1D2127;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
}

.wukong-product-field select:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.2);
  outline-offset: 2px;
}

.wukong-product-field > small,
.wukong-cost-estimate {
  color: #6E7075;
  font-size: 13.5px;
  line-height: 1.55;
}

.wukong-cost-estimate {
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.76);
}

.wukong-cost-estimate.is-pro {
  border: 1px solid rgba(201, 144, 85, 0.32);
  background: #F2F4F8;
  color: #9a4810;
}

.wukong-billing-note {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid #5AA9FF;
  border-radius: 10px;
  background: #F2F4F8;
  color: #095BB8;
}

.wukong-billing-note strong {
  font-size: 15px;
  font-weight: 850;
}

.wukong-billing-note p {
  margin: 0;
  color: #0B6BDE;
  font-size: 15px;
  line-height: 1.65;
}

.provider-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 0 0 9px;
}

.provider-preset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(10, 132, 255, 0.2);
  border-radius: 14px;
  background: #F2F4F8;
}

.provider-preset.is-selected {
  border-color: rgba(10, 132, 255, 0.48);
  background: linear-gradient(135deg, #F2F4F8, #F2F4F8);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.07);
}

.provider-preset strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.provider-preset p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.provider-preset .button {
  flex: 0 0 auto;
  min-height: 38px;
  padding-inline: 15px;
}

.provider-preset .button.selected {
  border-color: var(--green);
  background: var(--green);
  color: #FFFFFF;
}

.provider-presets-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.password-control {
  position: relative;
}

.password-control input {
  padding-right: 76px !important;
}

.password-control button {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 58px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease;
}

.password-control button:hover {
  background: var(--mint);
}

.advanced {
  padding: 0;
  overflow: clip;
}

.advanced summary {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  color: var(--ink);
  list-style: none;
  cursor: pointer;
  transition: background 180ms ease;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced summary:hover {
  background: #F2F4F8;
}

.summary-chevron {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-right: 4px;
  border-right: 2px solid #6E7075;
  border-bottom: 2px solid #6E7075;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 200ms ease;
}

.advanced[open] .summary-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.advanced[open] summary {
  border-bottom: 1px solid var(--line);
  background: #F2F4F8;
}

.advanced-body {
  padding: 20px;
}

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

.dialog-footer {
  flex: 0 0 auto;
  padding: 15px 30px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.202);
}

.dialog-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 9px;
}

.dialog-actions .button {
  min-height: 46px;
  min-width: 112px;
  border-radius: 12px;
  font-size: 13.5px;
}

.dialog-actions .danger-text {
  min-width: 116px;
  color: #b64b4b;
}

.dialog-actions .danger-text:hover {
  background: #FCEDED;
  color: #923838;
}

.archive-dialog {
  width: min(1060px, calc(100% - 32px));
  max-height: min(860px, calc(100dvh - 32px));
  overflow: hidden;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 24px;
  padding: 0;
  background: #F2F4F8;
  color: var(--ink);
  box-shadow:
    0 32px 90px rgba(11, 107, 222, 0.24),
    0 10px 28px rgba(11, 107, 222, 0.12);
}

.archive-dialog::backdrop {
  background: rgba(237, 240, 245, 0.58);
  backdrop-filter: blur(10px) saturate(0.8);
}

.archive-shell {
  max-height: min(860px, calc(100dvh - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.archive-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px 24px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 8% 0, rgba(255, 255, 255, 0.5), transparent 19rem),
    linear-gradient(135deg, #F2F4F8, #F2F4F8);
}

.archive-title-group {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.archive-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 15px;
  background: linear-gradient(145deg, #F2F4F8, #F4F6FA);
  color: var(--green-dark);
}

.archive-mark svg,
.archive-empty-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.archive-head .eyebrow {
  margin: 1px 0 0;
  color: var(--green);
  font-size: 10.5px;
  letter-spacing: 0.18em;
}

.archive-head h2 {
  margin: 5px 0 0;
  color: var(--green-dark);
  font-size: clamp(23px, 2.4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.archive-head p:last-child {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.archive-overview {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 20px 30px 0;
  padding: 16px 18px;
  border: 1px solid rgba(10, 132, 255, 0.28);
  border-radius: 15px;
  background: linear-gradient(135deg, #F2F4F8, #F2F4F8);
}

.archive-overview > div {
  flex: 0 0 auto;
}

.archive-overview span,
.archive-overview strong {
  display: block;
}

.archive-overview span {
  color: var(--muted);
  font-size: 11.5px;
}

.archive-overview strong {
  margin-top: 3px;
  color: var(--green-dark);
  font-size: 21px;
}

.archive-overview p {
  margin: 0;
  color: #6E7075;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: right;
}

.archive-list-status {
  margin: 18px 30px 0;
  padding: 22px;
  border: 1px dashed rgba(10, 132, 255, 0.24);
  border-radius: 14px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.archive-list {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 30px 22px;
  scrollbar-gutter: stable;
}

.archive-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr);
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 4px 16px rgba(11, 107, 222, 0.055);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.archive-card:hover {
  border-color: rgba(10, 132, 255, 0.26);
  box-shadow: 0 8px 24px rgba(11, 107, 222, 0.09);
}

.archive-cover {
  position: relative;
  min-height: 78px;
  align-self: start;
  overflow: hidden;
  border: 1px solid #F4F6FA;
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(10, 132, 255, 0.08), rgba(10, 132, 255, 0.02)),
    #F2F4F8;
  aspect-ratio: 16 / 9;
}

.archive-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.archive-cover span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #6E7075;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.archive-card-body {
  min-width: 0;
}

.archive-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.archive-card h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-state-pill {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #F2F4F8;
  color: var(--green);
  font-size: 9.5px;
  font-weight: 850;
}

.archive-state-pill.partial {
  background: #F2F4F8;
  color: #0868D6;
}

.archive-meta {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.archive-updated {
  margin: 3px 0 0;
  color: #6E7075;
  font-size: 10.5px;
}

.archive-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.archive-card-actions .button {
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 10.5px;
}

.archive-card-actions .delete-archive-button {
  margin-left: auto;
  color: #ad4b4b;
}

.archive-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 28px;
  text-align: center;
}

.archive-empty[hidden] {
  display: none;
}

.archive-empty-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin-bottom: 3px;
  border-radius: 15px;
  background: #F2F4F8;
  color: var(--green);
}

.archive-empty strong {
  color: var(--green-dark);
  font-size: 15px;
}

.archive-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.archive-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 30px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
}

.archive-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.archive-footer .button {
  min-width: 96px;
  min-height: 44px;
}

.archive-dialog button:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.2);
  outline-offset: 3px;
}

.test-result {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid #F4F6FA;
  border-radius: 12px;
  background: #F2F4F8;
  color: #6E7075;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.45;
}

.test-result::before {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #A9ABB0;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.13);
  content: "";
}

.test-result.working {
  border-color: rgba(10, 132, 255, 0.26);
  background: #F2F4F8;
  color: #CFE5FF;
}

.test-result.working::before {
  background: #4A97FF;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.13);
  animation: status-pulse 1.2s ease-in-out infinite;
}

.test-result.success {
  border-color: rgba(10, 132, 255, 0.16);
  background: #F2F4F8;
  color: var(--green);
}

.test-result.success::before {
  background: rgba(10, 132, 255, 0.16);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.13);
}

.test-result.warning {
  border-color: rgba(201, 144, 85, 0.30);
  background: #F2F4F8;
  color: var(--orange);
}

.test-result.warning::before {
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(202, 128, 78, 0.13);
}

.test-result.error {
  border-color: rgba(194, 94, 94, 0.30);
  background: #FCEDED;
  color: var(--red);
}

.test-result.error::before {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(196, 95, 95, 0.13);
}

.button.is-loading::before {
  width: 13px;
  height: 13px;
  display: inline-block;
  margin-right: 7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  content: "";
  animation: button-spin 700ms linear infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

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

.toast {
  position: fixed;
  z-index: 80;
  top: 82px;
  left: 50%;
  max-width: min(560px, calc(100% - 36px));
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--green-deep);
  color: #FFFFFF;
  box-shadow: 0 14px 38px rgba(11, 107, 222, 0.23);
  font-size: 11.5px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #F2F4F8;
}

.workspace-tab {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.workspace-tab svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.workspace-tab:hover {
  color: var(--green);
  background: var(--green-soft);
}

.workspace-tab.active {
  background: var(--white);
  color: var(--green-dark);
  box-shadow: 0 2px 10px rgba(11, 107, 222, 0.1);
}

.topbar.tool-mode .top-actions {
  visibility: hidden;
  pointer-events: none;
}

.tool-workspace {
  padding-block: 22px 42px;
}

.tool-hero {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 34px;
  border: 1px solid rgba(10, 132, 255, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.94)),
    var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.tool-hero::after {
  width: 240px;
  height: 240px;
  position: absolute;
  right: -60px;
  bottom: -140px;
  border: 34px solid rgba(10, 132, 255, 0.06);
  border-radius: 50%;
  content: "";
}

.tool-hero h1 {
  margin: 8px 0 9px;
  color: var(--green-dark);
  font-size: clamp(28px, 3.3vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.tool-hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.local-only-badge {
  z-index: 1;
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 999px;
  background: #F2F4F8;
  color: var(--green);
  font-size: 12.5px;
  font-weight: 800;
}

.tool-step-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.tool-step-strip li {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
}

.tool-step-strip li > span {
  width: 32px;
  height: 32px;
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--green);
  font-size: 11.5px;
  font-weight: 900;
}

.tool-step-strip strong {
  color: #8A8C91;
  font-size: 12.5px;
}

.tool-step-strip small {
  margin-top: 2px;
  color: #6E7075;
  font-size: 10.5px;
}

.tool-step-strip li.active {
  border-color: rgba(10, 132, 255, 0.16);
  background: #F2F4F8;
}

.tool-step-strip li.active > span {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.tool-editor-layout {
  display: grid;
  grid-template-columns: minmax(285px, 0.72fr) minmax(0, 1.8fr);
  align-items: start;
  gap: 14px;
}

.tool-control-card,
.tool-preview-card {
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow-small);
}

.tool-control-card {
  min-width: 0;
  padding: 22px;
}

.tool-preview-card {
  min-width: 0;
  padding: 22px;
}

.tool-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 14px;
}

.tool-card-heading.compact {
  margin-bottom: 10px;
}

.tool-index {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10.5px;
  font-weight: 900;
}

.tool-card-heading h2,
.tool-preview-heading h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.tool-card-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.tool-upload-button {
  width: 100%;
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px dashed rgba(10, 132, 255, 0.16);
  border-radius: 14px;
  padding: 14px;
  background: #F2F4F8;
  color: var(--green-dark);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.tool-upload-button:hover {
  border-color: var(--green);
  background: #F2F4F8;
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.07);
}

.tool-upload-button svg {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.tool-upload-button span,
.tool-upload-button strong,
.tool-upload-button small {
  min-width: 0;
  display: block;
}

.tool-upload-button > span {
  overflow: hidden;
}

.tool-upload-button strong {
  font-size: 13.5px;
}

.tool-upload-button small {
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-upload-button.compact-upload {
  min-height: 72px;
  margin-top: 9px;
  border-style: solid;
  background: var(--white);
}

.tool-upload-button.compact-upload svg {
  width: 25px;
  height: 25px;
}

.replacement-queue {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
  background: #F2F4F8;
}

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

.replacement-queue-head strong,
.replacement-queue-head small {
  display: block;
}

.replacement-queue-head strong {
  color: var(--green-dark);
  font-size: 11.5px;
}

.replacement-queue-head small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.replacement-nav-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.replacement-nav-actions .button {
  min-width: 62px;
  min-height: 36px;
  padding: 0 8px;
  font-size: 10.5px;
}

.replacement-thumb-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-height: 164px;
  margin-top: 10px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.replacement-thumb {
  min-width: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  outline: none;
  background: var(--white);
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.replacement-thumb:hover {
  border-color: rgba(10, 132, 255, 0.16);
  background: #F2F4F8;
}

.replacement-thumb:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14);
}

.replacement-thumb.active {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px var(--green);
}

.replacement-thumb img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  object-fit: cover;
}

.replacement-thumb span {
  min-width: 24px;
  min-height: 18px;
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(237, 240, 245, 0.88);
  color: white;
  font-size: 7px;
  font-weight: 850;
}

.tool-field,
.range-field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.tool-field > span:first-child,
.range-field > span:first-child {
  color: #8A8C91;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 800;
}

.tool-field > span i {
  color: #6E7075;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 500;
}

.tool-field input[type="text"],
.tool-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 12px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-size: 12.5px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tool-field input[type="text"]:focus,
.tool-field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
}

.tool-field > small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.color-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 5px 10px;
  background: var(--white);
}

.color-field input[type="color"] {
  width: 34px;
  height: 30px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

.color-field output {
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 11.5px;
}

.tool-wide-button {
  width: 100%;
  margin-top: 15px;
}

.collage-template-fieldset {
  min-width: 0;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}

.collage-template-fieldset legend {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.collage-template-options {
  display: grid;
  gap: 8px;
}

.collage-template-card {
  position: relative;
  min-height: 72px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.collage-template-card:hover {
  border-color: rgba(10, 132, 255, 0.16);
  background: #F2F4F8;
}

.collage-template-card:has(input:checked) {
  border-color: var(--green);
  background: #F2F4F8;
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.12);
}

.collage-template-card:has(input:focus-visible) {
  outline: 3px solid rgba(10, 132, 255, 0.24);
  outline-offset: 2px;
}

.collage-template-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.collage-template-card > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.collage-template-card strong {
  color: var(--ink);
  font-size: 15px;
}

.collage-template-card small {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.collage-template-diagram {
  width: 42px;
  height: 52px;
  display: grid;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(10, 132, 255, 0.32);
  border-radius: 5px;
  background: var(--white);
}

.collage-template-diagram i,
.collage-template-diagram b,
.collage-template-diagram em,
.collage-template-diagram u {
  display: block;
  border-radius: 1px;
  background: rgba(10, 132, 255, 0.26);
  text-decoration: none;
}

.collage-template-diagram.classic {
  grid-template-columns: 10px 1fr;
  grid-template-rows: repeat(3, 1fr);
}

.collage-template-diagram.classic i { grid-row: 1 / 4; }

.collage-template-diagram.showcase {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1.8fr 1fr 1fr 1fr;
}

.collage-template-diagram.showcase i { grid-column: 1 / 4; }

.collage-template-diagram.showcase u { grid-column: 1 / 4; }

.collage-mode-fieldset,
.batch-pill-fieldset {
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.collage-mode-fieldset legend,
.batch-pill-fieldset legend {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.collage-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #F2F4F8;
}

.collage-mode-switch label {
  min-width: 0;
  position: relative;
  cursor: pointer;
}

.collage-mode-switch input,
.batch-layout-options input,
.batch-pill-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.collage-mode-switch span {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--muted);
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.collage-mode-switch strong,
.collage-mode-switch small {
  display: block;
}

.collage-mode-switch strong {
  color: inherit;
  font-size: 13.5px;
}

.collage-mode-switch small {
  font-size: 11.5px;
}

.collage-mode-switch input:checked + span {
  border-color: rgba(10, 132, 255, 0.16);
  background: var(--white);
  color: var(--green-dark);
  box-shadow: var(--shadow-small);
}

.collage-mode-switch input:focus-visible + span,
.batch-layout-options input:focus-visible + span,
.batch-pill-options input:focus-visible + span {
  outline: 3px solid rgba(0, 102, 214, 0.28);
  outline-offset: 2px;
}

.batch-layout-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.batch-layout-options label {
  min-width: 0;
  position: relative;
  cursor: pointer;
}

.batch-layout-options label:first-child {
  grid-column: 1 / -1;
}

.batch-layout-options label > span {
  min-height: 84px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.76);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.batch-layout-options input:checked + span {
  border-color: var(--green);
  background: #F2F4F8;
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.1);
}

.batch-layout-options strong,
.batch-layout-options small {
  min-width: 0;
  grid-column: 2;
}

.batch-layout-options strong {
  align-self: end;
  color: var(--ink);
  font-size: 13.5px;
}

.batch-layout-options small {
  align-self: start;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}

.batch-layout-icon {
  width: 34px;
  height: 43px;
  grid-row: 1 / 3;
  display: grid;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 5px;
  background: var(--white);
}

.batch-layout-icon::before,
.batch-layout-icon::after {
  content: "";
  display: block;
  border-radius: 1px;
  background: rgba(10, 132, 255, 0.16);
}

.batch-layout-icon.theme-grid {
  grid-template-rows: 1.4fr 1fr;
}

.batch-layout-icon.theme-grid::after {
  background: repeating-linear-gradient(90deg, rgba(10, 132, 255, 0.16) 0 8px, transparent 8px 10px);
}

.batch-layout-icon.two { grid-template-rows: repeat(2, 1fr); }
.batch-layout-icon.three { grid-template-rows: 1.3fr 1fr; }
.batch-layout-icon.three::after { background: linear-gradient(90deg, rgba(10, 132, 255, 0.16) 48%, transparent 48% 52%, rgba(10, 132, 255, 0.16) 52%); }
.batch-layout-icon.four::before { background: linear-gradient(90deg, rgba(10, 132, 255, 0.16) 48%, transparent 48% 52%, rgba(10, 132, 255, 0.16) 52%); }
.batch-layout-icon.four::after { background: linear-gradient(90deg, rgba(10, 132, 255, 0.16) 48%, transparent 48% 52%, rgba(10, 132, 255, 0.16) 52%); }
.batch-layout-icon.five { grid-template-rows: 1.35fr 1fr; }
.batch-layout-icon.five::after { background: linear-gradient(90deg, rgba(10, 132, 255, 0.16) 48%, transparent 48% 52%, rgba(10, 132, 255, 0.16) 52%); }

.batch-pill-fieldset {
  margin-top: 15px;
  margin-bottom: 0;
}

.batch-pill-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.batch-pill-options.two-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.batch-pill-options label {
  position: relative;
  cursor: pointer;
}

.batch-pill-options span {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 7px;
  background: var(--white);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.batch-pill-options input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}

.batch-group-summary {
  min-height: 34px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.tool-export-actions:has(.batch-zip-button:not([hidden])) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.batch-preview-nav,
.batch-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #F2F4F8;
}

.batch-preview-nav {
  width: min(100%, 540px);
  min-height: 48px;
  margin: 0 auto 12px;
  padding: 6px;
}

.batch-preview-nav .button {
  min-height: 36px;
  padding-inline: 12px;
}

.batch-preview-nav span {
  color: var(--green-dark);
  font-size: 11.5px;
  font-weight: 800;
  text-align: center;
}

.batch-page-toolbar {
  margin-top: 16px;
  padding: 10px 12px;
}

.batch-page-toolbar > div:first-child {
  min-width: 0;
}

.batch-page-toolbar strong,
.batch-page-toolbar small {
  display: block;
}

.batch-page-toolbar strong {
  color: var(--green-dark);
  font-size: 12.5px;
}

.batch-page-toolbar small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.batch-page-toolbar > div:last-child {
  display: flex;
  gap: 6px;
}

.batch-page-toolbar .button {
  min-height: 38px;
  padding-inline: 12px;
}

.tool-divider {
  height: 1px;
  margin: 20px 0;
  background: var(--line);
}

.tool-status {
  min-height: 40px;
  margin: 10px 0 0;
  border-radius: 9px;
  padding: 9px 11px;
  background: #F2F4F8;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.tool-status.success {
  background: #F2F4F8;
  color: var(--green);
}

.tool-status.error {
  background: #F2F4F8;
  color: var(--red);
}

.tool-status.working {
  background: #F2F4F8;
  color: #a36236;
}

.tool-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.tool-preview-heading h2 {
  margin-top: 5px;
}

.tool-export-actions,
.perspective-export-grid,
.perspective-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.collage-canvas-stage {
  width: min(100%, 540px);
  margin: 0 auto;
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #F2F4F8;
  box-shadow: 0 12px 34px rgba(11, 107, 222, 0.1);
}

.collage-canvas-stage canvas,
.perspective-canvas-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.canvas-empty-state strong {
  margin-top: 14px;
  color: #8A8C91;
  font-size: 15px;
}

.canvas-empty-state p {
  margin: 7px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
}

.empty-layout-mark {
  width: 74px;
  height: 92px;
  display: grid;
  grid-template-columns: 21px 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 5px;
  padding: 6px;
  border: 2px solid #A9ABB0;
  border-radius: 10px;
}

.empty-layout-mark i,
.empty-layout-mark b,
.empty-layout-mark em {
  border-radius: 3px;
  background: rgba(10, 132, 255, 0.28);
}

.empty-layout-mark i {
  grid-row: 1 / 3;
}

.extracted-page-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  max-height: 210px;
  margin-top: 16px;
  overflow-y: auto;
}

.extracted-page-card {
  min-width: 0;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px;
  background: var(--white);
}

.extracted-page-card.selectable {
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.extracted-page-card.selectable:hover {
  border-color: rgba(10, 132, 255, 0.16);
  background: #F2F4F8;
}

.extracted-page-card.current-group {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.extracted-page-card.selectable input {
  width: 22px;
  height: 22px;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(11, 107, 222, 0.24));
}

.extracted-page-card.selectable:has(input:focus-visible) {
  outline: 3px solid rgba(0, 102, 214, 0.28);
  outline-offset: 2px;
}

.extracted-page-card.selectable:has(input:not(:checked)) img {
  opacity: 0.48;
  filter: saturate(0.35);
}

.extracted-page-card.hero {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.1);
}

.extracted-page-card img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  object-fit: cover;
}

.extracted-page-card span {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 9.5px;
}

.extracted-page-card b {
  color: var(--green);
  font-weight: 800;
}

.perspective-editor-layout {
  grid-template-columns: minmax(300px, 0.74fr) minmax(0, 1.8fr);
}

.scene-template-panel {
  margin-top: 12px;
  border: 1px solid rgba(10, 132, 255, 0.16);
  border-radius: 14px;
  padding: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.88));
}

.scene-template-heading,
.scene-template-save-row,
.scene-template-card,
.scene-template-card-actions {
  display: flex;
  align-items: center;
}

.scene-template-heading {
  justify-content: space-between;
  gap: 10px;
}

.scene-template-heading > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.scene-template-heading strong {
  color: var(--green-deep);
  font-size: 16px;
}

.scene-template-heading small,
.scene-template-hint,
.scene-template-empty,
.scene-template-card-copy small {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.scene-template-count {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13.5px;
  font-weight: 800;
}

.scene-template-save-row {
  gap: 8px;
  margin-top: 11px;
}

.scene-template-save-row input {
  min-width: 0;
  min-height: 46px;
  flex: 1 1 auto;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 0 12px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
}

.scene-template-save-row input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

.scene-template-save-row .button {
  min-width: 116px;
  padding-inline: 12px;
}

.scene-template-hint {
  margin: 8px 0 0;
}

.scene-template-hint.success {
  color: var(--green);
}

.scene-template-hint.error,
.scene-template-empty.error {
  color: var(--red);
}

.scene-template-list {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}

.scene-template-empty {
  border: 1px dashed rgba(10, 132, 255, 0.24);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.scene-template-card {
  min-width: 0;
  align-items: stretch;
  gap: 10px;
  border: 1px solid rgba(10, 132, 255, 0.14);
  border-radius: 11px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.scene-template-card.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.11);
}

.scene-template-thumb {
  width: 76px;
  min-height: 58px;
  flex: 0 0 76px;
  overflow: hidden;
  border-radius: 8px;
  background: #F2F4F8;
}

.scene-template-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scene-template-card-body {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 7px;
}

.scene-template-card-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.scene-template-card-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-template-rename-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 0 9px;
  outline: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
}

.scene-template-card-actions {
  flex-wrap: wrap;
  gap: 5px;
}

.scene-template-card-actions button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: #F2F4F8;
  color: var(--green-dark);
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.scene-template-card-actions button:hover {
  background: #F4F6FA;
}

.scene-template-card-actions button:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.24);
  outline-offset: 2px;
}

.scene-template-card-actions .delete {
  background: transparent;
  color: var(--red);
}

.simple-settings {
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #F2F4F8;
}

.simple-settings summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #8A8C91;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

.simple-settings-body {
  padding: 0 12px 13px;
}

.simple-settings .tool-field {
  margin-top: 10px;
}

.range-field input[type="range"] {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}

.range-field > span:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.range-field output {
  color: var(--green);
  font-size: 10.5px;
}

.perspective-export-grid {
  margin-top: 12px;
}

.perspective-canvas-stage {
  width: 100%;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    linear-gradient(45deg, #F2F4F8 25%, transparent 25%),
    linear-gradient(-45deg, #F2F4F8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #F2F4F8 75%),
    linear-gradient(-45deg, transparent 75%, #F2F4F8 75%),
    #F2F4F8;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  touch-action: none;
}

.perspective-canvas-stage canvas {
  cursor: crosshair;
  touch-action: none;
}

.perspective-canvas-stage.dragging canvas {
  cursor: grabbing;
}

.screen-corner-mark {
  width: 112px;
  height: 70px;
  position: relative;
  border: 2px solid #A9ABB0;
  border-radius: 8px;
}

.screen-corner-mark i {
  width: 10px;
  height: 10px;
  position: absolute;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: white;
}

.screen-corner-mark i:nth-child(1) { left: -6px; top: -6px; }
.screen-corner-mark i:nth-child(2) { right: -6px; top: -6px; }
.screen-corner-mark i:nth-child(3) { right: -6px; bottom: -6px; }
.screen-corner-mark i:nth-child(4) { left: -6px; bottom: -6px; }

.canvas-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
  text-align: center;
}

.resolution-label {
  padding: 7px 10px;
  border-radius: 999px;
  background: #F2F4F8;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 10.5px;
}

:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid rgba(0, 102, 214, 0.36);
  outline-offset: 3px;
}

@media (max-width: 1120px) {
  .shell {
    width: min(100% - 40px, 960px);
  }

  .wizard-progress {
    overflow-x: auto;
    grid-template-columns: repeat(9, auto);
  }

  .wizard-progress > i {
    width: 35px;
  }

  .outline-layout,
  .style-layout,
  .reference-layout,
  .export-layout {
    grid-template-columns: 1fr;
  }

  .guide-stack {
    grid-template-columns: 1fr 1fr;
  }

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

  .topbar {
    flex-wrap: wrap;
  }

  .workspace-switcher {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .workspace-tab {
    flex: 1 1 0;
    justify-content: center;
  }

  .tool-editor-layout,
  .perspective-editor-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: 164px;
  }

  .shell {
    width: calc(100% - 24px);
  }

  .topbar {
    align-items: flex-start;
    padding: 10px 12px;
  }

  .workspace-switcher {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .workspace-tab {
    min-width: max-content;
    min-height: 44px;
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong i {
    display: none;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .connection-state {
    width: 100%;
    justify-content: flex-end;
    order: -1;
    margin: 0;
    padding: 0;
    background: transparent;
  }

  .topbar .button {
    min-height: 44px;
    padding-inline: 8px;
    font-size: 10.5px;
  }

  #importButton,
  #exportPlanButton {
    display: none;
  }

  .wizard-progress {
    min-height: 72px;
    padding: 10px;
  }

  .step-tab {
    min-width: 102px;
  }

  .step-tab small {
    display: none;
  }

  .wizard-panel {
    padding: 19px;
  }

  .panel-heading,
  .generation-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-heading h1 {
    font-size: 29px;
  }

  .guide-stack {
    grid-template-columns: 1fr;
  }

  .tool-workspace {
    width: calc(100% - 24px);
    padding-top: 12px;
  }

  body.tool-workspace-active {
    overflow-x: hidden;
    padding-bottom: 0;
  }

  .tool-hero {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 15px;
    padding: 22px;
  }

  .tool-hero h1 {
    font-size: 30px;
  }

  .tool-step-strip {
    max-width: 100%;
    grid-template-columns: repeat(4, minmax(118px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .tool-editor-layout,
  .perspective-editor-layout,
  .tool-editor-layout > *,
  .perspective-editor-layout > * {
    min-width: 0;
  }

  .tool-step-strip li {
    padding: 11px;
  }

  .tool-control-card,
  .tool-preview-card {
    padding: 17px;
  }

  .tool-preview-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-export-actions {
    width: 100%;
  }

  .tool-export-actions .button,
  .perspective-export-grid .button,
  .perspective-action-grid .button {
    min-height: 44px;
  }

  .replacement-queue-head {
    align-items: stretch;
    flex-direction: column;
  }

  .replacement-nav-actions .button {
    min-height: 44px;
  }

  .scene-template-save-row {
    align-items: stretch;
    flex-direction: column;
  }

  .scene-template-save-row .button,
  .scene-template-card-actions button {
    min-height: 44px;
  }

  .replacement-thumb-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .perspective-preview-card {
    order: -1;
  }

  .card-toolbar,
  .inline-action {
    align-items: stretch;
    flex-direction: column;
  }

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

  .compact-field input {
    width: 100%;
  }

  .script-field textarea {
    min-height: 390px;
    padding: 17px;
    font-size: 12.5px;
  }

  .reference-option-grid,
  .generation-summary,
  .export-stats {
    grid-template-columns: 1fr;
  }

  .generation-summary .generation-progress {
    min-height: 82px;
  }

  .slide-grid {
    grid-template-columns: 1fr;
  }

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

  .retry-button {
    width: 100%;
  }

  .slide-history-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .slide-history-restore-button {
    width: 100%;
  }

  .empty-state {
    flex-direction: column;
    padding: 30px;
    text-align: center;
  }

  .wizard-footer {
    right: 8px;
    bottom: 8px;
    left: 8px;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  #saveDraftButton {
    display: none;
  }

  .footer-actions {
    display: grid;
    grid-template-columns: 0.72fr 1.28fr;
  }

  .footer-actions .button {
    width: 100%;
    min-height: 44px;
    padding-inline: 10px;
    font-size: 10.5px;
  }

  .api-dialog,
  .archive-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .dialog-shell,
  .archive-shell {
    max-height: calc(100dvh - 16px);
    padding: 0;
  }

  .dialog-head {
    gap: 14px;
    padding: 20px;
  }

  .dialog-title-group {
    gap: 12px;
  }

  .dialog-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .dialog-head .eyebrow {
    display: none;
  }

  .dialog-head h2 {
    margin-top: 0;
    font-size: 22px;
  }

  .dialog-head p:last-child {
    font-size: 12.5px;
  }

  .dialog-content {
    gap: 12px;
    padding: 16px;
    scrollbar-gutter: auto;
  }

  .settings-section {
    padding: 16px;
    border-radius: 15px;
  }

  .api-dialog .form-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .advanced {
    padding: 0;
  }

  .advanced summary {
    min-height: 70px;
    padding: 14px 16px;
  }

  .advanced-body {
    padding: 16px;
  }

  .dialog-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 13px 16px 16px;
  }

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

  .dialog-actions .button,
  .test-result {
    width: 100%;
    min-width: 0;
  }

  .archive-head {
    gap: 14px;
    padding: 20px;
  }

  .archive-title-group {
    gap: 12px;
  }

  .archive-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .archive-head .eyebrow {
    display: none;
  }

  .archive-head h2 {
    margin-top: 0;
    font-size: 22px;
  }

  .archive-head p:last-child {
    font-size: 12.5px;
  }

  .archive-overview {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin: 14px 16px 0;
    padding: 14px;
  }

  .archive-overview p {
    text-align: left;
  }

  .archive-list-status {
    margin: 14px 16px 0;
  }

  .archive-list {
    grid-template-columns: 1fr;
    padding: 14px 16px 18px;
    scrollbar-gutter: auto;
  }

  .archive-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 13px 16px 16px;
  }

  .archive-footer .button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .provider-presets {
    grid-template-columns: 1fr;
  }

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

  .provider-preset .button {
    width: 100%;
  }
}

/* ===== Readability + parallel generation controls ===== */
.generation-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.concurrency-control {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 7px 5px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--green-dark);
  box-shadow: 0 7px 20px rgba(11, 107, 222, 0.05);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.concurrency-control select {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  outline: 0;
  padding: 0 30px 0 10px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
}

.concurrency-control select:disabled {
  cursor: wait;
  opacity: 0.6;
}

.brand-copy small,
.step-tab small,
.eyebrow,
.dialog-head .eyebrow,
.archive-head .eyebrow,
.tool-step-strip small,
.reference-kicker,
.reference-file-meta small,
.reference-options summary span,
.field small,
.recreate-list li > span,
.recreate-list p,
.slide-error,
.footer-step small,
.tool-upload-button span,
.tool-field > small,
.canvas-help,
.resolution-label {
  font-size: 12.5px;
  line-height: 1.55;
}

.connection-state,
.optional-badge,
.card-toolbar > div:first-child small,
.parse-hint,
.guide-card pre,
.guide-card > p,
.check-row span,
.warning-list,
.reference-dropzone small,
.reference-status,
.reference-options summary,
.field,
.generation-summary span,
.generation-progress small,
.preview-placeholder span,
.slide-excerpt,
.export-stats span,
.export-warning,
.footer-note,
.api-dialog .field small,
.auto-config-note p,
.local-save-note p,
.archive-overview span,
.archive-meta,
.archive-footer p,
.tool-card-heading p,
.replacement-queue-head strong,
.tool-field > span:first-child,
.range-field > span:first-child,
.color-field output,
.canvas-empty-state p,
.range-field output {
  font-size: 13.5px;
  line-height: 1.55;
}

.workspace-tab,
.step-tab > span,
.step-tab strong,
.compact-field span,
.empty-state p,
.preview-status,
.export-card > p:not(.eyebrow),
.export-stats strong,
.footer-step span,
.auto-config-note strong,
.local-save-note strong,
.archive-overview p,
.archive-empty p,
.tool-hero-badge,
.tool-step-strip strong,
.tool-card-heading strong,
.canvas-empty-state strong {
  font-size: 15px;
}

.button,
.card-toolbar > div:first-child strong,
.compact-field input,
.field input,
.field textarea,
.field select,
.api-dialog .field,
.api-dialog .field > label,
.api-dialog .field > span,
.api-dialog .field input,
.api-dialog .field textarea,
.archive-card h3,
.tool-upload-button strong,
.tool-field input,
.tool-field select,
.range-field input {
  font-size: 16px;
}

.panel-heading > div > p:last-child,
.tool-hero p:last-child,
.script-field textarea,
.slide-title,
.dialog-head p:last-child,
.archive-head p:last-child {
  font-size: 15px;
}

.panel-heading > div > p:last-child,
.tool-hero p:last-child,
.dialog-head p:last-child,
.archive-head p:last-child {
  line-height: 1.7;
}

@media (max-width: 760px) {
  .generation-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .concurrency-control,
  .generation-actions .button {
    width: 100%;
  }

  .concurrency-control {
    justify-content: space-between;
  }

  .concurrency-control select {
    flex: 1 1 auto;
  }

  .topbar .button {
    font-size: 13.5px;
  }

  .script-field textarea {
    font-size: 16px;
    line-height: 1.72;
  }
}

@media (max-width: 480px) {
  .dialog-mark {
    display: none;
  }

  .archive-mark {
    display: none;
  }

  .dialog-head {
    padding: 18px 16px;
  }

  .close-button {
    width: 40px;
    height: 40px;
  }

  .archive-card {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .archive-card-actions .button {
    min-height: 44px;
  }

  .section-heading {
    gap: 9px;
  }

  .section-heading p {
    display: none;
  }

  .required-pill {
    margin-left: auto;
  }

  .reference-preview {
    grid-template-columns: 1fr;
  }

  .reference-file-actions {
    justify-content: flex-end;
  }

  .export-button {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 课擎 Keqing / 2026 visual refresh（黑金版） ===== */
:root {
  --green: #0A84FF; --green-dark: #0868D6; --green-deep: #0B6BDE;
  --green-soft: rgba(10, 132, 255, 0.09); --mint: rgba(10, 132, 255, 0.30); --lime: #CFE5FF;
  --ivory: #EDF0F5; --white: #FFFFFF; --ink: #1D2127; --muted: #6E7075;
  --line: #E1E4EA; --line-strong: #CBD0D8; --red: #E5484D; --orange: #E08A3E;
  --shadow: 0 16px 48px rgba(15, 23, 42, 0.10); --shadow-small: 0 7px 24px rgba(15, 23, 42, 0.08);
  --glass: rgba(255, 255, 255, 0.78); --glass-strong: rgba(255, 255, 255, 0.9);
}

body {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse 66% 58% at 50% -5%, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.9) 38%, transparent 76%),
    radial-gradient(circle at -4% 38%, rgba(255, 255, 255, 0.52), transparent 39%),
    radial-gradient(circle at 104% 52%, rgba(10, 132, 255, 0.46), transparent 42%),
    linear-gradient(142deg, rgba(10, 132, 255, 0.16) 0%, #F2F4F8 34%, #F2F4F8 52%, rgba(10, 132, 255, 0.32) 76%, rgba(10, 132, 255, 0.16) 100%);
  background-attachment: fixed;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 24%, transparent 76%, rgba(255, 255, 255, 0.1)),
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.8), transparent 28rem);
}

.noise {
  z-index: 90;
  opacity: 0.028;
  mix-blend-mode: soft-light;
}

.shell {
  width: min(1380px, calc(100% - 56px));
}

.topbar {
  top: 12px;
  width: min(1500px, calc(100% - 32px));
  min-height: 78px;
  margin: 12px auto 0;
  padding: 11px 18px;
  border: 1px solid rgba(77, 150, 255, 0.32);
  border-radius: 22px;
  background: rgba(240, 243, 248, 0.78);
  box-shadow: 0 16px 45px rgba(11, 107, 222, 0.1);
  backdrop-filter: blur(22px) saturate(135%);
}

.brand {
  gap: 13px;
  color: var(--green-dark);
}

.brand-symbol {
  width: 48px;
  height: 48px;
  border-color: rgba(10, 132, 255, 0.55);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(10, 132, 255, 0.35));
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.28),
    0 8px 22px rgba(11, 107, 222, 0.12);
}

.brand-copy strong {
  color: var(--green-deep);
  font-size: 18.5px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.brand-copy strong i {
  margin-left: 2px;
  color: var(--green);
  font-weight: 780;
}

.brand-copy small {
  margin-top: 4px;
  color: rgba(237, 240, 245, 0.54);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.workspace-switcher {
  padding: 5px;
  border-color: rgba(0, 102, 214, 0.13);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.workspace-tab {
  min-height: 42px;
  border-radius: 11px;
  padding-inline: 15px;
}

.workspace-tab:hover {
  background: rgba(255, 255, 255, 0.54);
}

.workspace-tab.active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-dark);
  box-shadow:
    0 8px 22px rgba(11, 107, 222, 0.09),
    inset 0 0 0 1px rgba(255, 255, 255, 0.76);
}

.connection-state,
.button.ghost {
  border-color: rgba(0, 102, 214, 0.13);
  background: rgba(255, 255, 255, 0.66);
}

.app-main {
  padding-top: 26px;
}

.wizard-progress {
  min-height: 94px;
  padding: 15px 24px;
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: var(--glass);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(20px) saturate(125%);
}

.wizard-progress > i {
  background: linear-gradient(90deg, rgba(0, 102, 214, 0.22), rgba(0, 102, 214, 0.08));
}

.step-tab > span {
  border-color: rgba(0, 102, 214, 0.22);
  background: rgba(255, 255, 255, 0.72);
}

.step-tab.active > span {
  border-color: var(--green);
  background: linear-gradient(145deg, #0868D6, #4A97FF);
  box-shadow:
    0 0 0 6px rgba(0, 102, 214, 0.09),
    0 8px 18px rgba(11, 107, 222, 0.16);
}

.wizard-frame {
  margin-top: 19px;
}

.wizard-panel {
  position: relative;
  overflow: hidden;
  padding: 32px;
  border-color: rgba(255, 255, 255, 0.74);
  border-radius: 24px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(120%);
}

.wizard-panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, #0A84FF, rgba(10, 132, 255, 0.16) 40%, rgba(255, 255, 255, 0.8), transparent 88%);
}

.panel-heading h1,
.tool-hero h1 {
  color: var(--green-deep);
}

.panel-heading > div > p:last-child,
.tool-hero p:last-child {
  font-size: 15px;
}

.optional-badge,
.required-pill {
  border: 1px solid rgba(0, 102, 214, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.content-card,
.tool-card,
.slide-card,
.export-card,
.archive-card,
.guide-card,
.recreate-card,
.export-note-card {
  border-color: rgba(0, 102, 214, 0.13);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(11, 107, 222, 0.06);
}

.script-card,
.style-editor,
.reference-main {
  border-radius: 19px;
}

.compact-field input,
.script-field textarea,
.field input,
.field textarea,
.field select {
  border-color: rgba(0, 102, 214, 0.16);
  background-color: rgba(255, 255, 255, 0.82);
}

.compact-field input:focus,
.script-field textarea:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(0, 102, 214, 0.62);
  box-shadow: 0 0 0 5px rgba(0, 102, 214, 0.09);
}

.button {
  border-radius: 12px;
}

.button.primary {
  background: linear-gradient(135deg, #4A97FF, #0A84FF);
  box-shadow: 0 10px 24px rgba(11, 107, 222, 0.19);
}

.button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0A84FF, #0B6BDE);
  box-shadow: 0 13px 30px rgba(11, 107, 222, 0.24);
}

.tool-workspace {
  padding-block: 26px 48px;
}

.tool-hero {
  border-color: rgba(255, 255, 255, 0.74);
  background:
    radial-gradient(circle at 88% 15%, rgba(10, 132, 255, 0.3), transparent 16rem),
    linear-gradient(115deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.8));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.wizard-footer {
  border-top-color: rgba(0, 102, 214, 0.12);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 -12px 35px rgba(11, 107, 222, 0.06);
  backdrop-filter: blur(20px);
}

.dialog-shell,
.archive-shell {
  backdrop-filter: blur(9px);
}

.dialog-card,
.archive-dialog {
  border-color: rgba(255, 255, 255, 0.76);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 34px 90px rgba(11, 107, 222, 0.2);
}

.dialog-head,
.archive-head {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.88));
}

@media (max-width: 1120px) {
  .shell {
    width: min(100% - 40px, 960px);
  }

  .topbar {
    width: calc(100% - 28px);
  }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 50% -4%, rgba(255, 255, 255, 0.98), transparent 24rem),
      linear-gradient(155deg, rgba(10, 132, 255, 0.16), #F2F4F8 45%, rgba(10, 132, 255, 0.16));
    background-attachment: fixed;
  }

  .shell {
    width: calc(100% - 24px);
  }

  .topbar {
    top: 8px;
    width: calc(100% - 16px);
    margin-top: 8px;
    padding: 10px;
    border-radius: 18px;
  }

  .brand-symbol {
    width: 44px;
    height: 44px;
  }

  .brand-copy strong {
    max-width: 180px;
    font-size: 16px;
  }

  .brand-copy strong i {
    display: inline;
  }

  .workspace-switcher {
    border-radius: 13px;
  }

  .app-main {
    padding-top: 18px;
  }

  .wizard-progress {
    min-height: 76px;
    padding: 11px;
    border-radius: 18px;
  }

  .wizard-panel {
    padding: 20px;
    border-radius: 20px;
  }

  .panel-heading h1 {
    font-size: 29px;
  }

  .content-card,
  .tool-card,
  .slide-card,
  .export-card,
  .archive-card {
    border-radius: 16px;
  }
}

/* Final readability overrides must stay after the visual theme layer. */
.brand-copy small {
  font-size: 12.5px;
}

.panel-heading > div > p:last-child,
.tool-hero p:last-child,
.dialog-head p:last-child,
.archive-head p:last-child {
  font-size: 15px;
  line-height: 1.7;
}

/* ===== Official logo + author attribution ===== */
.brand-symbol {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  position: relative;
  border: none;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  box-shadow:
    0 8px 22px rgba(11, 107, 222, 0.14),
    0 2px 6px rgba(11, 107, 222, 0.1);
}

.brand-symbol img {
  width: 46px;
  height: 46px;
  max-width: none;
  position: static;
  top: 0;
  left: 0;
  display: block;
  border-radius: 8px;
}

.brand-copy .brand-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(237, 240, 245, 0.5);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.brand-author {
  color: var(--green-dark);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-author::before {
  margin-right: 7px;
  color: rgba(0, 102, 214, 0.36);
  content: "·";
}

@media (max-width: 760px) {
  .brand-symbol {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .brand-symbol img {
    width: 40px;
    height: 40px;
    top: 0;
    left: 0;
  }

  .brand-copy .brand-meta {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    letter-spacing: 0.035em;
  }

  .brand-workbench {
    display: none;
  }

  .brand-author::before {
    display: none;
  }
}

/* ===== mini航海 · clear professional UI ===== */
:root {
  --voyage-teal: #0A84FF;
  --voyage-deep: #0B6BDE;
  --voyage-mint: #F2F4F8;
  --voyage-sky: rgba(10, 132, 255, 0.34);
  --voyage-beacon: #F4F6FA;
  --voyage-surface: rgba(255, 255, 255, 0.92);
  --voyage-focus: rgba(10, 132, 255, 0.2);
}

body {
  background:
    radial-gradient(ellipse 58% 46% at 50% -7%, rgba(255, 255, 255, 0.98), transparent 76%),
    radial-gradient(circle at 5% 34%, rgba(255, 255, 255, 0.5), transparent 34%),
    radial-gradient(circle at 96% 48%, rgba(10, 132, 255, 0.43), transparent 38%),
    linear-gradient(145deg, rgba(10, 132, 255, 0.16) 0%, #F2F4F8 32%, #F2F4F8 53%, #F4F6FA 76%, rgba(10, 132, 255, 0.16) 100%);
}

.topbar {
  border-color: rgba(77, 150, 255, 0.36);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.74)),
    rgba(255, 255, 255, 0.72);
  box-shadow:
    0 18px 52px rgba(11, 107, 222, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.brand-copy .brand-workbench {
  padding: 3px 8px;
  border: 1px solid rgba(0, 102, 214, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--voyage-deep);
  letter-spacing: 0.045em;
}

.workspace-switcher {
  padding: 6px;
  background: rgba(255, 255, 255, 0.64);
}

.workspace-tab {
  min-height: 44px;
  gap: 8px;
  font-weight: 800;
  white-space: nowrap;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.workspace-tab.active {
  box-shadow:
    0 9px 24px rgba(11, 107, 222, 0.1),
    inset 0 -2px 0 rgba(0, 102, 214, 0.16);
}

.connection-state {
  min-height: 38px;
  padding-inline: 12px;
  font-size: 13.5px;
  font-weight: 750;
}

.wizard-progress {
  position: relative;
  min-height: 104px;
  gap: 9px;
  padding: 14px 18px;
  border-color: rgba(255, 255, 255, 0.86);
  background:
    radial-gradient(circle at 8% 18%, rgba(10, 132, 255, 0.2), transparent 8rem),
    linear-gradient(120deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.78));
  box-shadow:
    0 16px 42px rgba(11, 107, 222, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.wizard-progress > i {
  height: 2px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    90deg,
    rgba(0, 102, 214, 0.32) 0 7px,
    transparent 7px 13px
  );
}

.step-tab {
  min-width: 148px;
  min-height: 64px;
  grid-template-columns: 40px auto;
  column-gap: 11px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 8px 10px;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.step-tab:not(:disabled):hover {
  border-color: rgba(0, 102, 214, 0.12);
  background: rgba(255, 255, 255, 0.62);
}

.step-tab > span {
  width: 40px;
  height: 40px;
  border-width: 2px;
  border-color: rgba(0, 102, 214, 0.22);
  background: rgba(255, 255, 255, 0.86);
  color: #6E7075;
  font-size: 15px;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.62);
}

.step-tab strong {
  color: #8A8C91;
  font-size: 16px;
  font-weight: 850;
}

.step-tab small {
  color: #6E7075;
  font-size: 12.5px;
  font-weight: 650;
}

.step-tab.active {
  border-color: rgba(0, 102, 214, 0.15);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.84));
  box-shadow:
    0 10px 24px rgba(11, 107, 222, 0.09),
    inset 0 -2px 0 rgba(0, 102, 214, 0.1);
}

.step-tab.active > span {
  border-color: rgba(255, 255, 255, 0.86);
  background: linear-gradient(145deg, rgba(10, 132, 255, 0.16), var(--voyage-deep));
  box-shadow:
    0 0 0 5px rgba(0, 102, 214, 0.09),
    0 8px 18px rgba(11, 107, 222, 0.2);
}

.step-tab.complete > span {
  border-color: rgba(0, 102, 214, 0.18);
  background: var(--voyage-mint);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.5);
}

.step-tab:disabled {
  opacity: 0.66;
}

.wizard-panel {
  border-color: rgba(255, 255, 255, 0.88);
  background:
    radial-gradient(circle at 96% 2%, rgba(10, 132, 255, 0.25), transparent 16rem),
    var(--voyage-surface);
  box-shadow:
    0 28px 72px rgba(11, 107, 222, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.wizard-panel::before {
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--voyage-deep),
    rgba(10, 132, 255, 0.16) 34%,
    var(--voyage-beacon) 62%,
    rgba(10, 132, 255, 0) 92%
  );
}

.panel-heading {
  position: relative;
  z-index: 1;
  padding-bottom: 20px;
  border-bottom: 1px dashed rgba(0, 102, 214, 0.15);
}

.panel-heading::after {
  width: 76px;
  height: 24px;
  position: absolute;
  right: 4px;
  bottom: -12px;
  content: "";
  opacity: 0.65;
  background-image: radial-gradient(circle, rgba(0, 102, 214, 0.32) 2px, transparent 2.5px);
  background-position: 0 50%;
  background-size: 13px 13px;
  pointer-events: none;
}

.panel-heading h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(29px, 2.6vw, 38px);
  letter-spacing: -0.035em;
}

.panel-heading h1::after {
  width: 34px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  content: "";
  background: linear-gradient(90deg, var(--voyage-beacon), rgba(10, 132, 255, 0.16));
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.14);
}

.optional-badge,
.required-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-color: rgba(0, 102, 214, 0.13);
  background: rgba(255, 255, 255, 0.88);
  color: var(--voyage-deep);
  font-size: 13.5px;
  font-weight: 850;
}

.content-card,
.tool-card,
.slide-card,
.export-card,
.archive-card,
.guide-card,
.recreate-card,
.export-note-card {
  border-color: rgba(0, 102, 214, 0.15);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.84));
  box-shadow:
    0 14px 36px rgba(11, 107, 222, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.button {
  min-height: 46px;
  border-radius: 13px;
  font-size: 16px;
  font-weight: 800;
  touch-action: manipulation;
}

.button.primary {
  border-color: rgba(11, 107, 222, 0.1);
  background:
    radial-gradient(circle at 84% 8%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(10, 132, 255, 0.16), var(--voyage-deep));
  box-shadow:
    0 12px 28px rgba(11, 107, 222, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.button.primary:hover:not(:disabled) {
  background:
    radial-gradient(circle at 84% 8%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(10, 132, 255, 0.16), #0B6BDE);
  box-shadow:
    0 15px 34px rgba(11, 107, 222, 0.27),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.button:focus-visible,
.step-tab:focus-visible,
.workspace-tab:focus-visible {
  outline: 3px solid var(--voyage-focus);
  outline-offset: 3px;
}

.button.ghost {
  border-color: rgba(0, 102, 214, 0.17);
  background: rgba(255, 255, 255, 0.78);
}

.button.text-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.84);
}

.inline-action {
  border-top-color: rgba(0, 102, 214, 0.12);
  background: linear-gradient(90deg, rgba(10, 132, 255, 0.28), transparent 64%);
}

.concurrency-control {
  border-color: rgba(0, 102, 214, 0.16);
  background: rgba(255, 255, 255, 0.84);
}

.concurrency-control select {
  background: var(--voyage-mint);
}

.wizard-footer {
  border-top-color: rgba(0, 102, 214, 0.14);
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 -14px 40px rgba(11, 107, 222, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

@media (max-width: 1120px) {
  .step-tab {
    min-width: 144px;
  }
}

@media (max-width: 1340px) {
  .brand-copy .brand-workbench {
    display: none;
  }

  .workspace-tab {
    padding-inline: 12px;
  }

  .top-actions .button {
    padding-inline: 11px;
  }
}

@media (max-width: 760px) {
  .brand-copy .brand-workbench {
    display: none;
  }

  .workspace-switcher,
  .wizard-progress {
    scrollbar-width: none;
  }

  .workspace-switcher::-webkit-scrollbar,
  .wizard-progress::-webkit-scrollbar {
    display: none;
  }

  .wizard-progress {
    min-height: 82px;
    padding: 9px;
  }

  .step-tab {
    min-width: 124px;
    min-height: 56px;
    grid-template-columns: 38px auto;
    padding: 6px 8px;
  }

  .step-tab > span {
    width: 38px;
    height: 38px;
  }

  .step-tab strong {
    font-size: 15px;
  }

  .panel-heading::after {
    display: none;
  }

  .panel-heading h1 {
    font-size: 28px;
  }

  .panel-heading h1::after {
    width: 24px;
  }

  .collage-mode-switch,
  .batch-layout-options {
    grid-template-columns: 1fr;
  }

  .batch-layout-options label:first-child {
    grid-column: auto;
  }

  .batch-pill-options {
    grid-template-columns: 1fr;
  }

  .batch-pill-options.two-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-export-actions:has(.batch-zip-button:not([hidden])) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-zip-button {
    grid-column: 1 / -1;
  }

  .batch-page-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-page-toolbar > div:last-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-page-toolbar .button {
    min-height: 44px;
  }

  .batch-preview-nav span {
    font-size: 10.5px;
  }
}

/* ===== 课擎 · 关键词点选面板 ===== */
.keyword-picker {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--green-soft);
}

.kp-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.kp-summary::-webkit-details-marker {
  display: none;
}

.kp-summary::before {
  content: "▸";
  color: var(--green);
  font-size: 13.5px;
  transition: transform 0.15s ease;
}

.keyword-picker[open] .kp-summary::before {
  transform: rotate(90deg);
}

.kp-summary strong {
  font-size: 16px;
  color: var(--green-deep);
}

.kp-summary small {
  color: var(--muted);
  font-size: 13.5px;
}

.kp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 0;
}

.kp-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--ink);
}

.kp-target input[type="number"] {
  width: 64px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
}

.kp-message {
  margin: 10px 14px 0;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12.5px;
}

.kp-message.is-ok {
  background: var(--white);
  border: 1px solid var(--mint);
  color: var(--green-dark);
}

.kp-message.is-warn {
  background: #F2F5FA;
  border: 1px solid #0A5FC8;
  color: var(--orange);
}

.kp-preview {
  margin: 10px 14px 0;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--white);
}

.kp-preview-line {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
}

.kp-preview-line:first-child {
  color: var(--green-dark);
}

.kp-preview-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.kp-groups {
  padding: 6px 14px 4px;
}

.kp-group {
  padding: 8px 0 2px;
  border-bottom: 1px solid rgba(10, 132, 255, 0.45);
}

.kp-group:last-child {
  border-bottom: none;
}

.kp-group-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.kp-group-name {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green-dark);
}

.kp-group-desc {
  color: var(--muted);
  font-size: 12.5px;
}

.kp-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kp-chip {
  padding: 4px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.kp-chip:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.kp-chip.is-selected {
  background: var(--green);
  border-color: var(--green);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.28);
}

.kp-custom-row {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
}

.kp-custom-row input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  font-size: 15px;
}

/* ===== 课擎 · 黑金鎏金主题润色 ===== */
::selection {
  background: rgba(10, 132, 255, 0.35);
  color: #1D2127;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #FFFFFF;
}

::-webkit-scrollbar-thumb {
  background: #CBD0D8;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #0A84FF;
}

input::placeholder,
textarea::placeholder {
  color: #A9ABB0;
}

.kp-chip {
  background: #F7F8FB;
}

.kp-chip.is-selected {
  box-shadow: 0 2px 10px rgba(10, 132, 255, 0.35);
}

/* ===== 黑金 · 原生控件接管（消灭系统蓝）2026-08-28 ===== */
::selection {
  background: rgba(10, 132, 255, 0.4);
  color: #1D2127;
}

a {
  color: var(--green);
}

a:hover {
  color: #CFE5FF;
}

input[type="checkbox"],
input[type="radio"],
input[type="range"],
progress,
meter {
  accent-color: #0A84FF;
}

:is(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.32);
  outline-offset: 2px;
}

details summary::marker,
details summary::-webkit-details-marker {
  color: var(--green);
}

input[type="color"] {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
}

/* ===== iOS · 系统显示字体与液态玻璃质感 2026-08-28 v3 ===== */
:root {
  --font-display:
    "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei UI",
    "PingFang SC", system-ui, sans-serif;
}

.brand-copy strong,
.panel-heading h1,
.panel-heading h2,
.step-tab strong,
.dialog h2,
.dialog h3 {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

.brand-copy strong {
  font-weight: 650;
  color: #0A84FF;
  text-shadow: 0 1px 2px rgba(10, 132, 255, 0.18);
}

/* 液态玻璃：主按钮统一为 iOS 蓝药丸（加深版，避免偏浅） */
.button.primary {
  background: linear-gradient(180deg, #0A7AFF, #0A63E8 55%, #0855C8);
  color: #FFFFFF;
  border-color: rgba(11, 107, 222, 0.4);
  box-shadow:
    0 8px 20px rgba(10, 132, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 1px rgba(11, 107, 222, 0.4);
  transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.button.primary:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow:
    0 12px 26px rgba(10, 132, 255, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.button.primary:active:not(:disabled) {
  transform: scale(0.97);
  filter: brightness(0.96);
  box-shadow: 0 4px 10px rgba(10, 132, 255, 0.22);
}

/* 液态玻璃：卡片面统一玻璃质感 */
.check-card,
.export-card,
.recreate-card,
.api-dialog,
.dialog {
  backdrop-filter: blur(24px) saturate(170%);
}

/* 液态玻璃：顶栏 */
.app-header,
.site-header {
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom-color: rgba(10, 132, 255, 0.10);
}

/* iOS 微交互：全局按压缩放 */
.button:not(:disabled):active,
.step-tab:active {
  transform: scale(0.97);
}

/* iOS 链接与选区 */
a {
  color: #0A84FF;
}

::selection {
  background: rgba(10, 132, 255, 0.18);
  color: #1D2127;
}

/* iOS 滚动条 */
::-webkit-scrollbar-track {
  background: #EDF0F5;
}

::-webkit-scrollbar-thumb {
  background: rgba(120, 128, 140, 0.35);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(10, 132, 255, 0.55);
}

/* ===== 课擎库教材选择器 ===== */
.material-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.material-card .muted-text {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  margin: -4px 0 0;
}

.material-field {
  display: flex;
  gap: 8px;
}

.material-field input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.material-field input[type="search"]:focus {
  border-color: rgba(10, 132, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

.material-field .button.small {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
}

.material-count {
  font-size: 11.5px;
  color: var(--muted);
}

.material-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.material-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.material-item:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-small);
}

.material-meta {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 4px;
}

.material-name {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
  word-break: break-all;
  margin-bottom: 4px;
}

.material-name mark {
  background: rgba(10, 132, 255, 0.18);
  color: inherit;
  border-radius: 2px;
}

.material-path {
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.material-use {
  width: 100%;
  padding: 7px 0;
  font-size: 12.5px;
  border-radius: 10px;
}

.material-empty {
  font-size: 12.5px;
  color: var(--muted);
  padding: 12px 0;
  text-align: center;
}

/* ===== 课擎 · 爆款选题面板（topic-picker） ===== */
.topic-picker {
  margin: 0 0 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-small);
}

.topic-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topic-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0 4px;
}

.topic-row-label {
  font-size: 12.5px;
  color: var(--muted);
  margin-right: 2px;
}

.topic-chip-row .kp-chip {
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.topic-chip-row .kp-chip:hover {
  border-color: rgba(10, 132, 255, 0.5);
  box-shadow: 0 2px 10px rgba(10, 132, 255, 0.18);
}

.topic-chip-row .kp-chip:active {
  transform: scale(0.96);
}

.topic-chip-row .kp-chip.is-selected {
  background: linear-gradient(180deg, #3E9BFF, #0A63E8);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 12px rgba(10, 100, 232, 0.35);
}

.topic-chip-row .kp-chip .topic-heat {
  margin-left: 8px;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: #C9A25E;
  opacity: 0.9;
  vertical-align: 1px;
}

.topic-chip-row .kp-chip.is-selected .topic-heat {
  color: #FFE9B8;
  opacity: 0.95;
}

.topic-extra-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.topic-extra-row .compact-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
}

.topic-extra-row .compact-field span {
  font-size: 12.5px;
  color: var(--muted);
}

.topic-extra-row select,
.topic-extra-row input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
}

.topic-benchmarks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.topic-benchmark {
  display: inline-flex;
  flex-direction: column;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(10, 132, 255, 0.08);
  font-size: 13px;
  color: var(--ink);
}

.topic-benchmark small {
  font-size: 11.5px;
  color: var(--muted);
}

.topic-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}

.topic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.topic-prompt-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.topic-prompt-field span {
  font-size: 12.5px;
  color: var(--muted);
}

.topic-prompt-field textarea {
  width: 100%;
  min-height: 220px;
  max-height: 420px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #F7F8FB;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  font-family: "Segoe UI Variable Text", "Microsoft YaHei", sans-serif;
}

/* ===== 品牌区最终版 2026-08-28 v4：方形 logo + 课擎放大 + 小字后退 ===== */
.brand-copy strong {
  font-size: 23px;
  font-weight: 850;
}

.brand-copy strong i {
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(0, 102, 214, 0.52);
}

.brand-copy small,
.brand-copy .brand-meta {
  margin-top: 3px;
  color: rgba(110, 112, 117, 0.72);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
}

.brand-author {
  color: rgba(11, 107, 222, 0.62);
  font-weight: 750;
}

@media (max-width: 760px) {
  .brand-copy strong {
    font-size: 19px;
  }

  .brand-copy small,
  .brand-copy .brand-meta {
    font-size: 9.5px;
  }
}

/* ===== 2026-08-28 v5：STEP 03 AI 逐页提示词面板 ===== */
.style-ai-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 6px;
}

.style-ai-row input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
}

.style-ai-row input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14);
}

/* ===== 2026-08-28 v7：STEP 01 页纲制作 · 模型选择侧卡 + 接口四槽位 ===== */
.outline-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.62fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 1020px) {
  .outline-bottom-grid {
    grid-template-columns: 1fr;
  }
}

.model-side-card {
  position: sticky;
  top: 14px;
}

.model-slot {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.model-slot-ghost {
  background: rgba(255, 255, 255, 0.4);
  border-style: dashed;
}

.model-slot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.model-slot-head strong {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
}

.model-slot-tag {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.model-slot input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
}

.model-slot input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14);
}

.model-status {
  margin-top: 7px;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.5;
}

.model-status.ok {
  color: #248a3d;
}

.model-status.fallback {
  color: #b25000;
}

.model-status.none {
  color: var(--muted);
}

.model-side-card .button {
  width: 100%;
  margin-top: 14px;
}

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

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

.optional-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.1);
  color: var(--green-deep);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ===== 2026-08-28 参考图片制作工作台 + 画风滑块 + 教材预览 v8 ===== */

/* STEP 01/02 头部工具区：项目名称 + 模型选择 */
.panel-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  max-width: 620px;
}

.panel-tool-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 170px;
}

.panel-tool-field > span {
  font-size: 12.5px;
  color: var(--muted);
}

.panel-tool-field input,
.panel-tool-field select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
}

.panel-tool-field .model-status {
  margin-top: 2px;
}

/* 教材条目操作按钮 */
.material-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* 教材 PDF 预览对话框 */
.pdf-preview-dialog {
  width: min(920px, 92vw);
  height: min(88vh, 900px);
  border: none;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(15, 35, 70, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-preview-dialog::backdrop {
  background: rgba(10, 20, 40, 0.45);
  backdrop-filter: blur(6px);
}

.pdf-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(10, 132, 255, 0.08);
}

.pdf-preview-bar strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-preview-dialog iframe {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
}

.pdf-preview-hint {
  padding: 8px 16px;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
}

/* 参考图找图入口 */
.reference-find-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.reference-find-row input {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13.5px;
}

/* 创作要求下拉 */
.reference-req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.reference-req-grid .compact-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reference-req-grid .compact-field span {
  font-size: 12.5px;
  color: var(--muted);
}

.reference-req-grid select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.reference-req-preview {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 132, 255, 0.07);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
}

/* 智能转换 */
.reference-smart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.reference-smart textarea {
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13.5px;
  font-family: inherit;
}

.reference-smart textarea:focus,
.reference-find-row input:focus {
  outline: 2px solid rgba(10, 132, 255, 0.4);
  outline-offset: 1px;
}

/* 裁切对话框 */
.crop-dialog {
  width: min(860px, 92vw);
  border: none;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 24px 70px rgba(15, 35, 70, 0.35);
}

.crop-dialog::backdrop {
  background: rgba(10, 20, 40, 0.45);
  backdrop-filter: blur(6px);
}

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

.crop-hint {
  margin: 8px 0;
  font-size: 12.5px;
  color: var(--muted);
}

.crop-stage {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:
    repeating-conic-gradient(#f0f2f5 0% 25%, #ffffff 0% 50%) 50% / 20px 20px;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
}

.crop-stage img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.crop-box {
  position: absolute;
  border: 2px solid #0a84ff;
  background: rgba(10, 132, 255, 0.14);
  box-shadow: 0 0 0 9999px rgba(10, 20, 40, 0.28);
}

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

/* 画风滑块 */
.style-slider-panel {
  margin-top: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 16px;
}

.style-slider-axes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px 18px;
  margin-top: 10px;
}

.slider-axis {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-axis-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.slider-axis-head strong {
  font-size: 13.5px;
}

.slider-axis-label {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.slider-axis input[type="range"] {
  width: 100%;
  accent-color: #0a84ff;
  height: 22px;
  cursor: pointer;
}

.slider-swatches {
  display: flex;
  gap: 6px;
}

.slider-swatch {
  flex: 1;
  height: 30px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.slider-swatch:hover {
  transform: translateY(-2px);
}

.slider-swatch.is-active {
  border-color: #0a84ff;
  box-shadow: 0 3px 10px rgba(10, 132, 255, 0.35);
}

.style-slider-output {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.style-slider-output .kp-preview {
  flex: 1;
  min-width: 240px;
  margin: 0;
}

/* 逐页审核开关 */
.review-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  background: rgba(10, 132, 255, 0.07);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.review-toggle input {
  accent-color: #0a84ff;
  width: 16px;
  height: 16px;
}

.slide-grid.no-review .slide-edit-actions {
  display: none;
}

/* 每页提示词展示 */
.slide-direction strong {
  margin-right: 6px;
  color: var(--ink);
  font-weight: 700;
}
