* {
  box-sizing: border-box;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  margin: 0;
  padding: 24px;
  background: linear-gradient(135deg, #f3f7ff, #fdf6ef);
  color: #27303f;
}

.page {
  max-width: 960px;
  margin: 0 auto;
}

h1, h2 {
  margin-top: 0;
}

.card {
  background: #ffffffcc;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px #1b2b4f14;
}

.notice {
  margin-bottom: 16px;
  font-size: 14px;
  color: #5d6a80;
}

.helper {
  margin-top: -8px;
  color: #65748b;
  font-size: 13px;
}

label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
}

.field-note {
  display: block;
  margin-top: 5px;
  color: #66758f;
  font-size: 12px;
}

.history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.history-chips button {
  padding: 5px 8px;
  border: 1px solid #d2dceb;
  border-radius: 999px;
  background: #f8fbff;
  color: #34506f;
  font-size: 12px;
}

.size-preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: -4px 0 12px;
  color: #4c5e78;
  font-size: 13px;
}

.size-preview-row > span:not(.field-note) {
  padding: 6px 9px;
  border: 1px solid #d7e0ef;
  border-radius: 999px;
  background: #fff;
}

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #bac9e0;
  border-radius: 6px;
  margin-top: 4px;
  font-size: 14px;
}

input[readonly] {
  background-color: #f5f5f8;
}

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

.row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

button {
  background: #1f64d1;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
}

button:disabled {
  background: #94a8c8;
  cursor: wait;
}

.lookup-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

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

.task-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #d6e0ee;
  border-radius: 12px;
  background: #f8fbff;
  color: #27303f;
  text-align: left;
}

.task-card strong {
  font-size: 17px;
}

.task-card span {
  color: #627086;
  font-size: 13px;
  line-height: 1.5;
}

.task-card.active {
  border-color: #1f64d1;
  background: #eaf2ff;
  box-shadow: 0 0 0 2px #1f64d11f;
}

.error {
  color: #b42335;
  font-size: 14px;
}

.success {
  color: #1f7a3a;
  font-size: 14px;
}

.hidden {
  display: none;
}

.stats {
  display: grid;
  gap: 10px;
}

.product-lookup {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #d8e4f5;
  border-radius: 10px;
  background: #f8fbff;
}

.mode-panel {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #e4d4a8;
  border-radius: 10px;
  background: #fffaf0;
}

.mode-panel h3 {
  margin: 0 0 8px;
}

.warning-note {
  margin: 0 0 12px;
  padding: 9px 10px;
  border: 1px solid #ecd18f;
  border-radius: 8px;
  background: #fff4cc;
  color: #6f4d00;
  font-size: 13px;
  line-height: 1.5;
}

.print-copy-panel {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #d7e0ef;
  border-radius: 10px;
  background: #ffffffcc;
}

.print-copy-panel h4 {
  margin: 0 0 8px;
}

.print-section-title {
  margin: 14px 0 8px;
  padding-top: 10px;
  border-top: 1px dashed #d5deee;
  color: #1f3761;
  font-weight: 700;
}

.print-copy-panel textarea {
  font-family: inherit;
}

.product-summary h3 {
  margin: 0 0 8px;
}

.product-fields {
  display: grid;
  gap: 4px 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.product-fields p {
  margin: 3px 0;
}

.product-images {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin-top: 12px;
}

.product-image-card {
  display: grid;
  gap: 5px;
  align-content: start;
  padding: 8px;
  background: #fff;
  color: #2b3447;
  border: 1px solid #d5deee;
  border-radius: 10px;
  text-align: left;
}

.product-image-card.selected {
  border-color: #1f64d1;
  box-shadow: 0 0 0 2px #1f64d126;
}

.product-image-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 7px;
  background: #eef3fb;
}

.product-image-card span,
.product-image-card small {
  overflow-wrap: anywhere;
}

.product-image-card small {
  color: #65748b;
}

.stat-card {
  background: #f5f8ff;
  border: 1px solid #d4def4;
  border-radius: 8px;
  padding: 10px;
}

.results {
  display: grid;
  gap: 10px;
}

.result-row {
  border: 1px solid #dae3f2;
  border-radius: 8px;
  padding: 10px;
}

.result-title {
  margin: 0 0 10px;
  font-weight: 600;
}

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

.output-dir {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 10px;
  padding: 8px;
  background: #f7f9fd;
  border: 1px solid #dbe5f5;
  border-radius: 8px;
  font-size: 13px;
}

.output-dir code {
  flex: 1;
  min-width: 220px;
  overflow-wrap: anywhere;
  color: #1f3761;
}

.output-dir button {
  padding: 7px 10px;
}

.image-card {
  border-top: 1px dashed #d8e0ef;
  padding-top: 10px;
  margin-top: 10px;
}

.image-grid .image-card {
  border: 1px solid #d8e0ef;
  border-radius: 10px;
  margin-top: 0;
  padding: 10px;
  background: #fff;
}

.image-card img {
  max-width: 320px;
  width: 100%;
  cursor: zoom-in;
  border-radius: 8px;
  border: 1px solid #d8deea;
}

.image-grid .image-card img {
  max-width: none;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.file-name {
  margin: 6px 0 0;
  font-size: 12px;
  color: #607089;
  overflow-wrap: anywhere;
}

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

.compact-actions {
  margin: 6px 0 10px;
}

.download-btn {
  color: #114ca3;
}

.row-status {
  margin: 8px 0 0;
}

.reject-picker {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
  margin-top: 8px;
}

.reject-picker select {
  max-width: 220px;
  margin-top: 0;
}

.recent-records {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.recent-card {
  border: 1px solid #d7e0ef;
  border-radius: 10px;
  padding: 10px;
  background: #ffffffb8;
}

.recent-head {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
  color: #5d6a80;
}

.recent-head strong {
  color: #253047;
  font-size: 15px;
}

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

.thumb-link {
  display: block;
  color: #244c8f;
  text-decoration: none;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.thumb-link img {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d8deea;
  background: #f4f6fb;
}

.recent-image-card {
  border: 1px solid #d8e0ef;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.recent-image-card > span {
  display: block;
  margin-top: 6px;
  color: #5d6a80;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.image-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.image-preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d8deea;
  background: #f4f6fb;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 20, 35, 0.76);
}

.lightbox.hidden {
  display: none;
}

.lightbox-panel {
  width: min(92vw, 980px);
  max-height: 92vh;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.lightbox-panel img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 8px auto;
  object-fit: contain;
  border-radius: 10px;
}

.lightbox-panel p {
  margin: 8px 0 0;
  color: #5d6a80;
  overflow-wrap: anywhere;
}

.lightbox-close {
  float: right;
}

@media (max-width: 760px) {
  .image-grid,
  .thumb-list,
  .task-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .image-grid,
  .thumb-list,
  .task-switch {
    grid-template-columns: 1fr;
  }
}

.dimension-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dimension-group-full {
  margin-bottom: 12px;
}

.dimension-title {
  font-weight: 700;
  color: #1f2a44;
}

.dimension-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 10px;
}

.dimension-group-full .dimension-line {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
}

.dimension-line label {
  margin: 0;
}

.dimension-times {
  padding-bottom: 12px;
  color: #65758b;
  font-weight: 700;
}

@media (max-width: 720px) {
  .dimension-line,
  .dimension-group-full .dimension-line {
    grid-template-columns: 1fr;
  }

  .dimension-times {
    display: none;
  }
}

.dimension-board {
  margin-top: 10px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid #d9e4f5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 14px;
}

.dimension-board .dimension-title {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.2;
}

.dimension-board .dimension-line-label {
  max-width: 560px;
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
}

.dimension-board .dimension-line-box {
  grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr);
}

.dimension-board .dimension-times {
  align-self: end;
  justify-self: center;
  padding-bottom: 14px;
  color: #344767;
}

@media (max-width: 720px) {
  .dimension-board .dimension-line-label,
  .dimension-board .dimension-line-box {
    max-width: none;
    grid-template-columns: 1fr;
  }
}

.print-proof-result {
  margin-top: 14px;
}

.print-proof-card {
  border: 1px solid #d7e2f0;
  border-radius: 14px;
  background: #ffffff;
  padding: 14px;
}

.print-proof-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.print-proof-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #1f65d6;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.print-proof-card img {
  display: block;
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  border: 1px solid #edf1f7;
  border-radius: 10px;
  background: #f7f5ef;
}

.required-compliance-panel {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid #d9e4f5;
  border-radius: 12px;
  background: #f8fbff;
}

.required-compliance-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #c9d8ee;
  border-radius: 999px;
  background: #ffffff;
  font-size: 14px;
  color: #233047;
}

.check-pill input {
  margin: 0;
}

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

.packaging-main-col {
  min-width: 0;
}

.packaging-side-col {
  position: sticky;
  top: 14px;
  padding: 16px;
  border: 1px solid #d9e4f5;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 10px 30px rgba(31, 65, 110, 0.08);
}

.packaging-side-col h3 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #1f2a44;
}

.packaging-side-col dl {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.packaging-side-col dl > div {
  display: grid;
  gap: 4px;
  padding-bottom: 9px;
  border-bottom: 1px dashed #d9e4f5;
}

.packaging-side-col dt {
  font-size: 12px;
  color: #63718a;
}

.packaging-side-col dd {
  margin: 0;
  color: #172033;
  font-weight: 700;
  line-height: 1.45;
}

.compact-details {
  border: 1px solid #d9e4f5;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.compact-details > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  list-style: none;
  color: #1f2a44;
  font-weight: 800;
}

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

.compact-details > summary::after {
  content: '+';
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #edf4ff;
  color: #1f65d6;
}

.compact-details[open] > summary::after {
  content: '-';
}

.compact-details > summary small {
  margin-left: auto;
  color: #7b8798;
  font-size: 12px;
  font-weight: 500;
}

.compact-details-content {
  padding: 0 16px 16px;
}

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

  .packaging-side-col {
    position: static;
  }
}

body {
  padding-bottom: 92px;
}

.workspace-details {
  margin-bottom: 16px;
}

.workspace-details > summary {
  background: linear-gradient(90deg, #ffffff 0%, #f7fbff 100%);
}

.fixed-generate-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 80;
  transform: translateX(-50%);
  width: min(1040px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid rgba(32, 94, 190, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 50px rgba(23, 45, 83, 0.18);
  backdrop-filter: blur(12px);
}

.fixed-generate-bar > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.fixed-generate-bar strong {
  color: #182235;
  font-size: 15px;
}

.fixed-generate-bar span {
  color: #63718a;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixed-generate-bar button {
  min-width: 176px;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: #1f65d6;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.fixed-generate-bar button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

@media (max-width: 720px) {
  .fixed-generate-bar {
    align-items: stretch;
    flex-direction: column;
    bottom: 10px;
  }

  .fixed-generate-bar button {
    width: 100%;
  }
}

/* Wide workspace layout */
.page {
  max-width: 1440px;
}

#main-section.card {
  padding: 22px;
  border-radius: 18px;
}

#generate-form {
  display: block;
}

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

.row {
  gap: 16px;
}

.compact-packaging-layout {
  grid-template-columns: minmax(760px, 1fr) 380px;
  gap: 22px;
}

.packaging-side-col {
  top: 22px;
  border-radius: 20px;
  padding: 18px;
}

.packaging-main-col .compact-details,
.packaging-main-col .dimension-board,
.packaging-main-col .print-copy-panel {
  border-radius: 18px;
}

.workspace-details > summary,
.compact-details > summary {
  padding: 18px 20px;
}

.compact-details-content {
  padding: 0 20px 20px;
}

.dimension-board {
  padding: 18px;
}

.fixed-generate-bar {
  width: min(1280px, calc(100vw - 48px));
}

@media (max-width: 1180px) {
  .compact-packaging-layout {
    grid-template-columns: 1fr;
  }

  .packaging-side-col {
    position: static;
  }
}

@media (max-width: 780px) {
  body {
    padding: 14px;
  }

  #main-section.card {
    padding: 14px;
  }

  .task-switch {
    grid-template-columns: 1fr;
  }
}

.hidden,
.compact-packaging-layout.hidden {
  display: none !important;
}

.label-first-panel {
  grid-column: 1 / -1;
  margin: 4px 0 14px;
  padding: 16px;
  border: 1px solid #d9e4f5;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.label-first-title {
  margin-bottom: 4px;
  color: #1f2a44;
  font-size: 17px;
  font-weight: 800;
}

.label-first-panel .row {
  margin-top: 12px;
}

.optional-dimension-note {
  opacity: 0.88;
}

.product-images {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  align-items: start;
}

.product-image-card {
  min-width: 0;
  padding: 7px;
  border-radius: 12px;
}

.product-image-card img {
  height: 112px;
  object-fit: contain;
  background: #f1f5fb;
}

.product-image-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.product-image-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.product-lookup .product-images {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.sales-prompt-panel {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #d9e4f5;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.sales-prompt-panel h3 {
  margin: 0 0 6px;
  color: #1f2a44;
  font-size: 18px;
}

.sales-prompt-panel .row {
  margin-top: 12px;
}

.sales-prompt-panel textarea {
  min-height: 76px;
}

.sales-text-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #cbdaf0;
  border-radius: 14px;
  background: #ffffffcc;
}

.final-prompt-panel {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #d9e4f5;
  border-radius: 16px;
  background: #f8fbff;
}

.final-prompt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.final-prompt-head strong {
  color: #1f2a44;
}

#final-prompt-preview {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  background: #ffffff;
}

.final-prompt-head button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #1f65d6;
  border-radius: 999px;
  background: #ffffff;
  color: #1f65d6;
  font-weight: 800;
  cursor: pointer;
}

.final-prompt-head button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

@media (max-width: 720px) {
  .final-prompt-head {
    align-items: stretch;
    flex-direction: column;
  }
}

.history-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 8px 0 8px;
}

.history-tools label {
  margin: 0;
  min-width: 180px;
}

.history-tools button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #c9d8ee;
  border-radius: 999px;
  background: #ffffff;
  color: #1f65d6;
  font-weight: 800;
  cursor: pointer;
}

.history-record-details {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #dce6f4;
  border-radius: 14px;
  background: #f8fbff;
}

.history-source {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
}

.history-source strong {
  color: #1f2a44;
}

.history-source-preview {
  padding: 0;
  border: 1px solid #d4dfef;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  overflow: hidden;
}

.history-source-preview img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: contain;
  background: #eef3fb;
}

.history-source span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #53627a;
  font-size: 12px;
}

.muted-source {
  color: #7b8798;
}

.history-prompt summary {
  cursor: pointer;
  color: #1f65d6;
  font-weight: 800;
}

.history-prompt textarea {
  margin-top: 8px;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  background: #ffffff;
}

@media (max-width: 760px) {
  .history-tools,
  .history-record-details {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
}

/* Image type picker */
.image-type-picker {
  display: block;
  margin: 16px 0;
}

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

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

.image-type-option {
  position: relative;
  display: flex;
  min-height: 76px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #c6d3e6;
  border-radius: 14px;
  background: #fff;
  color: #1c2a3f;
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}

.image-type-option strong {
  padding-right: 26px;
  font-size: 15px;
}

.image-type-option span {
  color: #62718a;
  font-size: 13px;
}

.image-type-option::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  border: 2px solid #b9c7dc;
  border-radius: 999px;
  background: #fff;
}

.image-type-option.active {
  border-color: #2467d8;
  background: #eef5ff;
  box-shadow: 0 10px 24px rgba(36, 103, 216, .14);
}

.image-type-option.active::before {
  border-color: #2467d8;
  background: radial-gradient(circle at center, #2467d8 0 42%, #fff 46% 100%);
}

.image-type-option:hover:not(:disabled) {
  border-color: #2467d8;
  transform: translateY(-1px);
}

.image-type-option:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 20;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 8px);
  padding: 10px 12px;
  border-radius: 12px;
  background: #142033;
  color: #fff;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 14px 34px rgba(20, 32, 51, .22);
  pointer-events: none;
}

.image-type-option:disabled,
.image-type-option[hidden] {
  display: none;
}

.packaging-only {
  opacity: .78;
}

@media (max-width: 900px) {
  .image-type-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .image-type-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .image-type-options {
    grid-template-columns: 1fr;
  }
}

.sales-text-panel input:disabled {
  background: #eef2f7;
  color: #8a96a8;
  cursor: not-allowed;
}

/* Workspace two-column layout */
.workspace-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
  gap: 22px;
}

.workspace-left {
  min-width: 0;
}

.workspace-preview-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding-right: 2px;
}

.preview-card,
.workspace-preview-panel .final-prompt-panel {
  border: 1px solid #d8e3f2;
  border-radius: 18px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 14px 34px rgba(31, 42, 68, .07);
}

.preview-card h3,
.workspace-preview-panel .final-prompt-panel strong {
  margin: 0 0 10px;
}

.workspace-preview-image-box {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.workspace-preview-image-box img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid #d8e3f2;
  border-radius: 14px;
  background: #f3f7fc;
}

.preview-summary {
  display: grid;
  gap: 8px;
  margin: 0;
}

.preview-summary div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed #d8e3f2;
}

.preview-summary dt {
  color: #65748b;
  font-size: 12px;
}

.preview-summary dd {
  margin: 0;
  color: #17233a;
  font-weight: 800;
  word-break: break-word;
}

.workspace-preview-panel .final-prompt-panel {
  margin: 0;
}

.workspace-preview-panel .final-prompt-head {
  display: grid;
  gap: 8px;
}

.workspace-preview-panel #final-prompt-preview {
  min-height: 160px;
}

.workspace-preview-panel .stats {
  display: grid;
  gap: 8px;
}

.workspace-preview-panel .recent-card {
  padding: 12px;
}

.workspace-preview-panel .thumb-list,
.workspace-preview-panel .recent-image-grid,
.workspace-preview-panel .image-grid {
  grid-template-columns: 1fr;
}

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

  .workspace-preview-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

.preview-live-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e4ebf5;
}

.preview-live-block h4 {
  margin: 0 0 8px;
  color: #17233a;
  font-size: 14px;
}

.preview-filled-list .field-note {
  margin: 0;
}

.preview-live-fields div {
  grid-template-columns: 92px minmax(0, 1fr);
}

.preview-live-fields dd {
  font-weight: 700;
}

.inline-generate-hidden {
  display: none !important;
}

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

#fixed-preview-prompt-btn {
  border: 1px solid #2f6fda;
  background: #ffffff;
  color: #1f5fc8;
}

#fixed-preview-prompt-btn:hover {
  background: #eef5ff;
}

@media (max-width: 720px) {
  .fixed-generate-actions {
    width: 100%;
  }

  .fixed-generate-actions button {
    flex: 1;
  }
}

.inline-preview-hidden,
.soft-hidden {
  display: none !important;
}

.advanced-settings {
  border: 1px dashed #cdd9eb;
  border-radius: 16px;
  background: #f8fbff;
  margin: 16px 0;
  padding: 0;
}

.advanced-settings summary {
  cursor: pointer;
  padding: 14px 16px;
  color: #365477;
  font-weight: 800;
}

.advanced-settings label {
  display: block;
  padding: 0 16px 16px;
}

.preview-details-card summary {
  cursor: pointer;
  color: #17233a;
  font-weight: 900;
  list-style-position: inside;
}

.preview-details-card[open] summary {
  margin-bottom: 10px;
}

.sales-text-pure-mode .sales-text-panel::after {
  content: '当前选择纯图：不会生成图中文字，标题和卖点无需填写。';
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d8e3f2;
  border-radius: 12px;
  background: #f6f9ff;
  color: #506683;
  font-size: 13px;
}

.history-bottom-card {
  margin-top: 22px;
  border: 1px solid #d8e3f2;
  border-radius: 20px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 16px 38px rgba(31, 42, 68, .06);
}

.history-bottom-card h2 {
  margin-top: 0;
}

/* Lighten optional image-text settings inside sales prompt */
.sales-text-panel {
  margin-top: 12px;
  padding: 12px 12px 10px;
  border: 1px solid #e4ebf5;
  border-radius: 12px;
  background: #f8fbff;
}

.sales-text-panel .label-first-title {
  font-size: 14px;
  font-weight: 900;
  color: #24344d;
}

.sales-text-panel .label-first-title::after {
  content: '（可选）';
  color: #73839a;
  font-weight: 700;
}

.sales-text-panel > .field-note {
  margin: 4px 0 8px;
  font-size: 12px;
}

.sales-text-panel .row {
  margin-top: 8px;
}

.sales-text-pure-mode .sales-text-panel {
  background: #fafcff;
}

.sales-text-pure-mode .sales-text-panel::after {
  margin-top: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: #eef5ff;
  color: #506683;
  font-size: 12px;
}
