:root {
  --page-bg: #20212b;
  --panel-bg: #292a3a;
  --card-bg: #33354a;
  --card-border: #464c68;
  --input-bg: #22243a;
  --button-bg: #2b2e42;
  --button-border: #626a8a;
  --text: #eef3ff;
  --muted: #cbd5ef;
  --blue: #08aaff;
  --blue-deep: #067fe0;
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--page-bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 13px;
}

body.app-initializing {
  background: #0c0e11;
}

body.app-initializing .web-panel {
  opacity: 0;
  pointer-events: none;
}

button,
input,
textarea {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button {
  cursor: pointer;
}

.web-panel {
  display: flex;
  flex-direction: column;
  width: calc(100% - 24px);
  max-width: 450px;
  min-width: 260px;
  margin: 20px auto;
  padding: 12px;
  border: 1px solid #383d55;
  border-radius: 14px;
  background: var(--panel-bg);
}

.panel-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
}

.logged-out {
  opacity: 0.42;
  filter: blur(1px);
  pointer-events: none;
  user-select: none;
}

.generate-btn.logged-out {
  background: #394054;
  color: #8894b2;
  cursor: default;
}

.three-d-card {
  display: none;
  --three-d-preview-height: 536px;
  --three-d-control-stack: 46px;
}

.three-d-model-card {
  display: none;
}

.three-d-history-card {
  display: none;
}

.three-d-head,
.three-d-layout,
.three-d-core-panel,
.three-d-view-meta {
  display: flex;
}

.three-d-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.three-d-subtitle,
.three-d-note,
.three-d-view-meta span {
  color: #8b98ad;
  font-size: 12px;
  line-height: 18px;
}

.three-d-input-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.three-d-mode-switch {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 0;
  padding: 6px;
  border: 1px solid #d6e1ee;
  border-radius: 8px;
  background: #f8fbff;
}

.three-d-mode-btn {
  min-width: 118px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #324157;
  font-size: 13px;
  font-weight: 900;
}

.three-d-mode-btn.active {
  border-color: #2f7cf6;
  background: #eaf2ff;
  color: #1f63d3;
}

.three-d-layout {
  align-items: stretch;
  gap: 16px;
}

.three-d-layout.hidden {
  display: none;
}

.three-d-manual-panel.hidden {
  display: none;
}

.three-d-manual-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.three-d-manual-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.three-d-manual-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid #98bfff;
  border-radius: 8px;
  background: #2f7cf6;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.three-d-manual-preview {
  display: grid;
  height: 260px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #bed0e8;
  border-radius: 8px;
  background: #f8fafc;
  color: #8090a6;
  font-weight: 900;
}

.three-d-manual-preview.is-clickable {
  cursor: zoom-in;
}

.three-d-manual-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.three-d-upload-panel {
  display: grid;
  grid-template-rows: auto var(--three-d-preview-height);
  flex: 0 0 360px;
  gap: 12px;
}

.three-d-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid #98bfff;
  border-radius: 8px;
  background: #2f7cf6;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.three-d-input-toolbar > .three-d-upload {
  width: 360px;
  flex: 0 0 360px;
}

.three-d-input-toolbar > .three-d-upload.hidden {
  display: none;
}

.three-d-layout-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid #d6e1ee;
  border-radius: 8px;
  background: #f8fbff;
}

.three-d-layout-switch span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.three-d-layout-btn {
  min-width: 84px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #c9d7eb;
  border-radius: 6px;
  background: #ffffff;
  color: #324157;
  font-size: 13px;
  font-weight: 800;
}

.three-d-layout-btn.active {
  border-color: #2f7cf6;
  background: #eaf2ff;
  color: #1f63d3;
}

.three-d-upload-icon {
  font-size: 20px;
  line-height: 1;
}

.three-d-original-preview {
  display: grid;
  height: var(--three-d-preview-height);
  place-items: center;
  overflow: hidden;
  border: 1px dashed #bed0e8;
  border-radius: 8px;
  background: linear-gradient(180deg, #edf3f8 0%, #e5ecf4 100%);
  color: #8090a6;
  font-weight: 800;
}

.three-d-original-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.three-d-original-preview.is-clickable {
  cursor: zoom-in;
}

.three-d-result-panel {
  flex: 1 1 auto;
  min-width: 0;
}

.three-d-section-title {
  margin-bottom: 10px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.three-d-result-title {
  display: flex;
  min-height: var(--three-d-control-stack);
  align-items: flex-end;
  margin-bottom: 12px;
}

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

.three-d-empty {
  display: grid;
  min-height: var(--three-d-preview-height);
  grid-column: 1 / -1;
  place-items: center;
  border: 1px dashed #bed0e8;
  border-radius: 8px;
  background: #f8fafc;
  color: #8090a6;
  font-weight: 800;
}

.three-d-view-item {
  overflow: hidden;
  border: 1px solid #d6e1ee;
  border-radius: 8px;
  background: #ffffff;
  cursor: zoom-in;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.three-d-view-item.is-core {
  border-color: #78a8ff;
  box-shadow: 0 0 0 2px rgba(47, 124, 246, 0.12);
}

.three-d-view-item:hover,
.three-d-view-item:focus-visible {
  border-color: #2f7cf6;
  box-shadow: 0 10px 26px rgba(47, 124, 246, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.three-d-view-item img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #f8fafc;
}

.three-d-view-meta {
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
}

.three-d-view-meta strong {
  color: #172033;
  font-size: 12px;
  line-height: 18px;
}

.three-d-core-panel {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #d6e1ee;
  border-radius: 8px;
  background: #f8fbff;
}

.three-d-start-btn {
  width: 210px;
  min-height: 46px;
}

.three-d-model-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #d6e1ee;
  border-radius: 8px;
  background: #ffffff;
}

.three-d-model-panel.hidden {
  display: none;
}

.three-d-model-head,
.three-d-quality-controls,
.three-d-model-actions {
  display: flex;
  align-items: center;
}

.three-d-model-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.three-d-quality-controls {
  gap: 10px;
}

.three-d-quality-controls label {
  display: grid;
  gap: 6px;
  color: #65748a;
  font-size: 12px;
  font-weight: 800;
}

.three-d-quality-controls select {
  min-width: 118px;
  height: 36px;
  border: 1px solid #c9d7eb;
  border-radius: 6px;
  background: #ffffff;
  color: #172033;
  font-weight: 800;
}

.three-d-model-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 14px;
}

.three-d-model-preview {
  position: relative;
  display: grid;
  min-height: 600px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #bed0e8;
  border-radius: 8px;
  background: #f8fafc;
  color: #8090a6;
  font-weight: 800;
}

.three-d-model-preview img,
.three-d-model-preview model-viewer {
  display: block;
  width: 100%;
  height: 600px;
  object-fit: contain;
}

.three-d-fallback-image {
  transition: filter 160ms ease, opacity 160ms ease;
}

.three-d-fallback-image.style-texture {
  filter: none;
}

.three-d-fallback-image.style-white {
  filter: grayscale(1) brightness(1.08) contrast(1.06);
}

.three-d-fallback-image.style-normal {
  filter: hue-rotate(150deg) saturate(2.6) contrast(1.18) brightness(1.12);
}

.three-d-fallback-image.style-unlit {
  filter: saturate(0.8) contrast(0.92) brightness(1.08);
}

.three-d-fallback-image.style-toon {
  filter: saturate(1.15) contrast(1.26) brightness(0.98);
}

.three-d-fallback-image.style-clay {
  filter: grayscale(0.9) sepia(0.18) contrast(1.12) brightness(0.96);
}

.three-d-fallback-image.style-holo {
  filter: hue-rotate(116deg) saturate(1.85) contrast(1.18) brightness(1.04);
}

.three-d-preview-canvas {
  position: absolute;
  inset: 0;
}

.three-d-preview-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.three-d-style-bar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 3;
  display: flex;
  max-width: calc(100% - 32px);
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(43, 54, 70, 0.86);
  box-shadow: 0 12px 34px rgba(40, 58, 80, 0.22);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.three-d-style-btn {
  min-width: 54px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.three-d-style-btn.active {
  border-color: #72d6da;
  background: #72d6da;
  color: #102631;
}

.three-d-model-preview.is-image-fallback {
  background: linear-gradient(180deg, #edf3f8 0%, #e5ecf4 100%);
}

.three-d-preview-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 5px 10px;
  border: 1px solid #c9d7eb;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.three-d-model-actions {
  align-items: stretch;
  justify-content: flex-end;
  flex-direction: column;
  gap: 10px;
}

.three-d-model-actions .admin-btn,
.three-d-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  text-decoration: none;
}

.three-d-download-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.three-d-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

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

.three-d-history-item {
  overflow: hidden;
  border: 1px solid #d6e1ee;
  border-radius: 8px;
  background: #ffffff;
}

.three-d-history-preview {
  position: relative;
  display: grid;
  height: 360px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid #e2eaf4;
  background: #f8fafc;
  color: #8090a6;
  font-size: 13px;
  font-weight: 900;
}

.three-d-history-preview img,
.three-d-history-preview model-viewer {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: contain;
}

.three-d-history-preview .three-d-style-bar {
  bottom: 10px;
  gap: 5px;
  padding: 6px;
  border-radius: 18px;
}

.three-d-history-preview .three-d-style-btn {
  min-width: 46px;
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.three-d-history-info {
  display: grid;
  gap: 4px;
  padding: 12px 14px 4px;
}

.three-d-history-info strong {
  color: #172033;
  font-size: 14px;
}

.three-d-history-info span {
  color: #64748b;
  font-size: 12px;
}

.three-d-history-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
}

.compact-card {
  padding-bottom: 10px;
}

.section-title {
  margin: 0 0 10px 0;
  color: #f4f7ff;
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
}

.brand-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#brandAdminEntry {
  cursor: default;
  user-select: none;
}

#brandAdminEntry .brand-logo-box {
  cursor: default;
}

#desktopBrandAdminEntry {
  cursor: default;
  user-select: none;
}

#brandAdminEntry,
#brandAdminEntry *,
#desktopBrandAdminEntry,
#desktopBrandAdminEntry * {
  cursor: default;
}

.brand-logo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 46px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.brand-logo {
  display: block;
  width: 68px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-title {
  margin-bottom: 0;
  color: #f7fbff;
  font-size: 17px;
  font-weight: 900;
  line-height: 22px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.brand-tagline {
  color: #aebbe1;
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
  white-space: nowrap;
}

.account-row,
.model-tabs,
.source-tabs,
.reference-grid,
.prompt-head,
.prompt-tags,
.resolution-tabs,
.history-grid {
  display: flex;
  flex-direction: row;
}

.account-row,
.model-tabs,
.source-tabs,
.reference-grid,
.prompt-tags,
.resolution-tabs,
.history-grid {
  flex-wrap: wrap;
}

.account-row {
  gap: 8px;
}

.account-row.hidden,
.account-summary.hidden,
.account-status.hidden,
.login-btn.hidden,
.modal-backdrop.hidden {
  display: none;
}

.account-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid #4c5574;
  border-radius: 12px;
  background: #25283d;
}

.summary-name {
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  line-height: 20px;
}

.summary-meta {
  margin-top: 2px;
  color: #8fdcaf;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
}

.account-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: row;
  gap: 8px;
}

.login-btn.password-action-btn {
  min-width: 86px;
  border-color: #697297;
  background: #2b2e42;
  color: #eef3ff;
}

.login-btn.password-action-btn:hover {
  border-color: #12b8ff;
  color: #ffffff;
}

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

.password-row .text-input {
  flex: 1 1 120px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(62, 151, 255, 0.16), transparent 38%),
    rgba(7, 10, 22, 0.58);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.password-modal {
  width: 100%;
  max-width: 390px;
  padding: 16px;
  border: 1px solid rgba(153, 179, 230, 0.38);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(46, 51, 78, 0.86), rgba(20, 24, 40, 0.78)),
    rgba(32, 35, 54, 0.72);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

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

.modal-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  line-height: 20px;
}

.modal-subtitle {
  margin-top: 2px;
  color: #9fb0d8;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
}

.modal-close-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(146, 166, 213, 0.52);
  border-radius: 8px;
  background: rgba(35, 41, 64, 0.68);
  color: #ffffff;
  font-size: 20px;
  line-height: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.modal-close-btn:hover {
  border-color: rgba(40, 189, 255, 0.78);
  background: rgba(28, 74, 107, 0.74);
}

.modal-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 10px;
}

.image-preview-modal {
  width: calc(100vw - 32px);
  max-width: none;
  height: calc(100vh - 32px);
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
}

.image-preview-stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  align-items: flex-start;
  justify-content: flex-start;
  border: 1px solid rgba(153, 179, 230, 0.32);
  border-radius: 12px;
  background: #05070d;
  padding: 8px;
}

.image-preview-canvas-wrap {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  margin: auto;
  max-width: none;
  max-height: none;
  transform-origin: center center;
  touch-action: none;
}

.image-preview-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffffff;
  cursor: inherit;
  touch-action: none;
}

.image-preview-canvas-wrap canvas + canvas {
  position: absolute;
  inset: 0;
  background: transparent;
}

.image-preview-canvas-wrap.is-panning {
  cursor: grabbing;
}

.image-preview-stage.is-texting .image-preview-canvas-wrap {
  cursor: text;
}

.image-editor-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(153, 179, 230, 0.34);
  border-radius: 10px;
  background: rgba(247, 250, 255, 0.96);
}

.image-editor-toolbar .admin-btn {
  min-width: auto;
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
}

.image-editor-toolbar .admin-btn.active {
  border-color: rgba(47, 124, 246, 0.78);
  background: #2f7cf6;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(47, 124, 246, 0.16);
}

.preview-active-tool {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(153, 179, 230, 0.48);
  border-radius: 8px;
  background: #ffffff;
  color: #243656;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.preview-active-tool {
  margin-left: auto;
  border-color: rgba(47, 124, 246, 0.32);
  background: rgba(47, 124, 246, 0.1);
  color: #1d5fd0;
}

.preview-tool-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(153, 179, 230, 0.48);
  border-radius: 8px;
  background: #ffffff;
  color: #243656;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.preview-tool-field input[type="color"] {
  width: 28px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
}

.preview-color-palette {
  gap: 7px;
}

.preview-color-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.22);
  border-radius: 4px;
  background: var(--swatch-color, #ff3b4f);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.preview-color-swatch:hover {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.preview-color-swatch.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(37, 99, 235, 0.88), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.preview-tool-field input[type="range"] {
  width: 120px;
}

.image-editor-toolbar .preview-zoom-value {
  min-width: 66px;
}

.image-editor-toolbar .ghost-danger {
  color: #b42318;
  border-color: rgba(244, 63, 94, 0.34);
  background: rgba(255, 247, 247, 0.94);
}

.image-editor-toolbar .ghost-danger:hover:not(:disabled) {
  color: #991b1b;
  border-color: rgba(244, 63, 94, 0.58);
  background: #fff1f2;
}

.image-editor-toolbar .plugin-download-primary {
  height: 34px;
  min-height: 34px;
}

.image-refine-panel {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(153, 179, 230, 0.3);
  border-radius: 10px;
  background: rgba(247, 250, 255, 0.96);
}

.image-refine-panel.hidden {
  display: none;
}

.image-refine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-refine-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.image-refine-cost {
  flex: 0 0 auto;
  padding: 2px 8px;
  border: 1px solid rgba(47, 124, 246, 0.28);
  border-radius: 5px;
  background: rgba(239, 246, 255, 0.92);
  color: #245ba7;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
}

.image-refine-title {
  flex: 0 0 auto;
  color: #172033;
  font-size: 13px;
  font-weight: 900;
  line-height: 18px;
}

.image-refine-status {
  min-width: 0;
  color: #627089;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: right;
}

.image-refine-status.success {
  color: #16744c;
}

.image-refine-status.error {
  color: #b42318;
}

.image-refine-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.image-refine-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(153, 179, 230, 0.66);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

.image-refine-input:focus {
  border-color: rgba(47, 124, 246, 0.82);
  box-shadow: 0 0 0 3px rgba(47, 124, 246, 0.14);
}

.image-refine-btn {
  min-width: 92px;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
}

.image-preview-modal.is-refining .image-refine-panel {
  border-color: rgba(56, 140, 111, 0.5);
  background: rgba(241, 249, 246, 0.98);
}

.image-preview-modal.is-refining .image-refine-status::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #38906f;
  box-shadow: 0 0 0 0 rgba(56, 144, 111, 0.38);
  content: "";
  animation: refine-status-pulse 1.4s ease-out infinite;
}

.image-preview-modal.is-refining .image-refine-btn:disabled {
  border-color: #46665b;
  background: #253b34;
  color: #d8e8e2;
  opacity: 1;
  cursor: not-allowed;
}

.image-preview-modal.is-refining .image-editor-toolbar button:disabled,
.image-preview-modal.is-refining .image-editor-toolbar input:disabled,
.image-preview-modal.is-refining .image-refine-input:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.image-preview-modal.is-refining .preview-tool-field {
  opacity: 0.48;
}

@keyframes refine-status-pulse {
  70% { box-shadow: 0 0 0 7px rgba(56, 144, 111, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 144, 111, 0); }
}

@media (max-width: 760px) {
  .image-refine-head,
  .image-refine-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

.refine-guide-backdrop {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.66);
}

.refine-guide-backdrop.hidden {
  display: none;
}

.refine-guide-card {
  width: min(420px, calc(100vw - 36px));
  padding: 22px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.34);
}

.refine-guide-kicker {
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
}

.refine-guide-title {
  margin-top: 4px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.refine-guide-text {
  margin-top: 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.75;
}

.refine-guide-ok {
  width: 100%;
  height: 38px;
  margin-top: 16px;
  border-radius: 8px;
}

.refine-guide-focus {
  position: relative;
  z-index: 116;
  border-color: #ffffff !important;
  box-shadow: 0 0 0 4px #ffffff, 0 0 0 8px rgba(47, 124, 246, 0.9), 0 20px 50px rgba(15, 23, 42, 0.34) !important;
}

.image-preview-close-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  margin-left: 0;
}

.preview-text-editor {
  position: absolute;
  z-index: 3;
  display: flex;
  gap: 6px;
  max-width: min(360px, calc(100% - 24px));
  padding: 8px;
  border: 1px solid rgba(47, 124, 246, 0.42);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
}

.preview-text-editor input {
  width: 180px;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #cbd7ea;
  border-radius: 8px;
  outline: none;
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.preview-text-editor input:focus {
  border-color: #2f7cf6;
}

.preview-text-editor button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #cbd7ea;
  border-radius: 8px;
  background: #f8fbff;
  color: #213656;
  font-size: 12px;
  font-weight: 900;
}

.preview-text-editor [data-preview-text-ok] {
  border-color: #2f7cf6;
  background: #2f7cf6;
  color: #ffffff;
}

.text-input {
  flex: 1 1 120px;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #555d7d;
  border-radius: 10px;
  outline: none;
  background: rgba(27, 30, 50, 0.84);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.text-input:focus {
  border-color: rgba(36, 190, 255, 0.86);
  box-shadow: 0 0 0 3px rgba(36, 190, 255, 0.12);
}

.text-input::placeholder {
  color: #8f9abf;
}

.remember-password-row {
  color: #8b96a5;
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
}

.remember-password-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  user-select: none;
}

.remember-password-row input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #1f7f62;
}

.login-btn {
  flex: 0 0 auto;
  min-width: 74px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid #12b8ff;
  border-radius: 10px;
  background: var(--blue);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.login-btn:disabled {
  border-color: #56618a;
  background: #52607a;
  color: #d7def0;
  cursor: default;
}

.logout-btn {
  border-color: #697297;
  background: #2b2e42;
  color: #eef3ff;
}

.logout-btn:hover {
  border-color: #12b8ff;
  color: #ffffff;
}

.login-btn.has-pending {
  border-color: rgba(255, 184, 77, 0.85);
  background: rgba(70, 47, 18, 0.82);
  color: #ffe1a1;
}

.account-status,
.points-status {
  margin-top: 10px;
  color: #b8c6ef;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.login-welcome-title {
  margin-top: 12px;
  color: #2c3e58;
  font-size: 15px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

.login-welcome-title.hidden {
  display: none;
}

.account-status.success {
  color: #7ee2a8;
}

.account-status.warning {
  color: #ffd166;
}

.user-recharge-notice {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 184, 77, 0.62);
  border-radius: 10px;
  background: rgba(64, 44, 18, 0.72);
  color: #ffe7b5;
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
}

.user-recharge-notice.hidden {
  display: none;
}

.user-recharge-notice.success {
  border-color: rgba(126, 226, 168, 0.55);
  background: rgba(20, 58, 44, 0.68);
  color: #93efb8;
}

.user-recharge-notice.warning {
  border-color: rgba(255, 184, 77, 0.72);
  background: rgba(74, 47, 16, 0.78);
  color: #ffe0a1;
}

.user-recharge-notice.pending,
.user-recharge-notice.info {
  border-color: rgba(42, 183, 255, 0.5);
  background: rgba(12, 58, 86, 0.58);
  color: #bfe9ff;
}

.admin-panel.hidden {
  display: none;
}

.user-workspace {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.user-workspace.hidden {
  display: none;
}

.user-workspace.logged-out {
  opacity: 0.42;
  filter: blur(1px);
  pointer-events: none;
  user-select: none;
}

.admin-panel {
  border-color: #168bd8;
}

.admin-block {
  padding: 10px 0;
  border-top: 1px solid #454b66;
}

.admin-block:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.admin-block-title {
  margin-bottom: 8px;
  color: #f4f7ff;
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
}

.admin-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-row .text-input {
  flex: 1 1 120px;
}

.admin-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #12b8ff;
  border-radius: 10px;
  background: var(--blue);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.admin-btn.secondary {
  border-color: #697297;
  background: #2b2e42;
}

.admin-btn.warning {
  border-color: #ffb84d;
  background: #8a5a13;
}

.admin-btn:disabled {
  border-color: #56618a;
  background: #52607a;
  color: #d7def0;
  cursor: default;
}

.admin-status {
  color: #b8c6ef;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.admin-status.success {
  color: #7ee2a8;
}

.admin-status.error {
  color: #ff8fa3;
}

.admin-status.warning {
  color: #ffe6ad;
}

.admin-action-grid {
  display: flex;
  flex-direction: row;
  gap: 5px;
  margin-bottom: 12px;
}

.admin-action-card {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 0 4px;
  border: 1px solid #56618a;
  border-radius: 10px;
  background: #2b2e42;
  color: #eef3ff;
  text-align: center;
}

.admin-action-grid .admin-action-card:only-child {
  max-width: 128px;
}

.admin-action-grid .admin-action-card {
  max-width: 132px;
}

.admin-action-card:hover {
  border-color: #12b8ff;
}

.admin-action-card.has-pending {
  border-color: rgba(255, 184, 77, 0.85);
  background: rgba(58, 43, 22, 0.72);
  color: #ffe6ad;
}

.admin-action-card.has-pending .admin-action-title {
  color: #ffe6ad;
}

.admin-action-title {
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  white-space: nowrap;
}

.admin-action-modal {
  max-width: 410px;
}

.user-list-modal {
  max-width: 430px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.permission-modal {
  width: min(920px, calc(100vw - 40px));
  max-width: 920px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.permission-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #454b66;
  border-radius: 10px;
  background: #25283d;
}

.permission-field {
  display: grid;
  flex: 1 1 auto;
  gap: 6px;
  color: #b9c5e5;
  font-size: 12px;
  font-weight: 900;
}

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

.permission-group-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 260px;
  padding: 12px;
  border: 1px solid #454b66;
  border-radius: 10px;
  background: #2b2e42;
}

.permission-group-head,
.permission-feature-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.permission-group-check,
.permission-feature-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: #2f7cf6;
}

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

.permission-label-input {
  min-width: 0;
  height: 34px;
  border-color: #56618a;
  background: #202338;
  color: #f5f8ff;
  font-weight: 900;
}

.permission-feature-row .permission-label-input {
  color: #dce7ff;
  font-size: 12px;
}

.recharge-package-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.recharge-package {
  flex: 1 1 96px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #56618a;
  border-radius: 10px;
  background: #25283d;
  color: #eef3ff;
  font-size: 12px;
  font-weight: 900;
}

.recharge-package.active {
  border-color: #12b8ff;
  background: #08aaff;
  color: #ffffff;
}

.modal-divider {
  height: 1px;
  margin: 12px 0;
  background: rgba(112, 125, 171, 0.34);
}

.recharge-record-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-title.small {
  font-size: 13px;
}

.recharge-orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-recharge-orders-list {
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.recharge-order-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid #454b66;
  border-radius: 10px;
  background: #2b2e42;
}

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

.recharge-order-user {
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 20px;
}

.recharge-order-meta {
  margin-top: 2px;
  color: #aebbe1;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
}

.recharge-order-note {
  color: #d9e6ff;
}

.recharge-order-note.reject-reason {
  color: #ffe0a1;
}

.recharge-order-status {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 184, 77, 0.15);
  color: #ffe6ad;
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
}

.recharge-order-status.approved {
  background: rgba(126, 226, 168, 0.14);
  color: #7ee2a8;
}

.recharge-order-status.rejected {
  background: rgba(255, 143, 163, 0.13);
  color: #ff9aaf;
}

.recharge-order-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.recharge-order-actions .admin-inline-btn {
  min-height: 32px;
}

.admin-modal-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.admin-modal-form.hidden {
  display: none;
}

.admin-modal-form .text-input {
  width: 100%;
  flex: 0 0 auto;
}

.admin-user-select {
  appearance: auto;
}

.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid #454b66;
  border-radius: 10px;
  background: #2b2e42;
}

.admin-user-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-user-info {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-user-info:hover .admin-user-name {
  color: #8fdcff;
}

.admin-user-name {
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-meta {
  margin-top: 2px;
  color: #aebbe1;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-detail {
  display: none;
  margin-top: 4px;
  color: #cbd5ef;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  word-break: break-word;
}

.admin-user-row.expanded .admin-user-detail {
  display: block;
}

.admin-user-status {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(126, 226, 168, 0.14);
  color: #7ee2a8;
  font-size: 11px;
  font-weight: 900;
  line-height: 16px;
}

.admin-user-status.disabled {
  background: rgba(255, 143, 163, 0.13);
  color: #ff9aaf;
}

.admin-user-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-inline-btn {
  flex: 1 1 auto;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #697297;
  border-radius: 9px;
  background: #25283d;
  color: #eef3ff;
  font-size: 12px;
  font-weight: 900;
}

.admin-inline-btn:hover {
  border-color: #12b8ff;
}

.admin-inline-btn.warning {
  border-color: #ffb84d;
  color: #ffdca0;
}

.admin-empty {
  padding: 10px;
  border: 1px dashed #56618a;
  border-radius: 10px;
  color: #aebbe1;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.admin-modal-form .admin-btn {
  width: 100%;
  min-height: 38px;
}

.tag-editor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-template-editor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-template-editor-item {
  padding: 10px;
  border: 1px solid #454b66;
  border-radius: 12px;
  background: #2b2e42;
}

.mode-template-editor-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.mode-template-editor-title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 18px;
}

.mode-template-editor-hint {
  color: #aebbe1;
  font-size: 12px;
  font-weight: 800;
  line-height: 17px;
}

.mode-template-input {
  width: 100%;
  min-height: 86px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid #56618a;
  border-radius: 10px;
  outline: none;
  background: rgba(22, 25, 41, 0.62);
  color: #eef3ff;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
}

.mode-template-input:focus {
  border-color: #12b8ff;
  box-shadow: 0 0 0 3px rgba(18, 184, 255, 0.10);
}

.mode-template-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.mode-template-save-btn {
  min-width: 74px;
  min-height: 34px;
}

.tag-manager-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-manager-tab {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #56618a;
  border-radius: 10px;
  background: #2b2e42;
  color: #eef3ff;
  font-size: 12px;
  font-weight: 900;
}

.tag-manager-tab.active {
  border-color: #12b8ff;
  background: #08aaff;
  color: #ffffff;
}

.tag-manager-panel {
  padding: 10px;
  border: 1px solid #454b66;
  border-radius: 12px;
  background: #2b2e42;
}

.tag-manager-summary {
  margin-bottom: 8px;
  color: #d9e6ff;
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
}

.tag-manager-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-manager-hint {
  flex: 1 1 100%;
  padding: 7px 9px;
  border: 1px solid rgba(126, 144, 196, 0.34);
  border-radius: 9px;
  background: rgba(22, 25, 41, 0.42);
  color: #aebbe1;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
}

.category-save-btn {
  min-height: 34px;
  padding: 0 12px;
}

.tag-manager-section-title {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #454b66;
  color: #d9e6ff;
  font-size: 12px;
  font-weight: 900;
  line-height: 18px;
}

.tag-editor-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid #454b66;
  border-radius: 10px;
  background: #2b2e42;
}

.tag-label-input {
  flex: 0 0 96px;
  width: 96px;
  height: 34px;
  text-align: center;
}

.tag-preset-input {
  flex: 1 1 220px;
  min-width: 180px;
  min-height: 46px;
  padding: 10px 12px;
  resize: vertical;
  border: 1px solid #56618a;
  border-radius: 10px;
  outline: none;
  background: var(--input-bg);
  color: #f1f5ff;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.tag-editor-item .admin-btn {
  flex: 0 0 auto;
}

.tag-option-editor-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 100%;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #454b66;
}

.tag-option-editor-list.compact {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.tag-option-editor-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-option-label-input {
  flex: 0 0 96px;
  width: 96px;
  height: 34px;
  text-align: center;
}

.tag-option-preset-input {
  flex: 1 1 190px;
  min-width: 180px;
  min-height: 42px;
  padding: 9px 11px;
  resize: vertical;
  border: 1px solid #56618a;
  border-radius: 10px;
  outline: none;
  background: var(--input-bg);
  color: #f1f5ff;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.option-save-btn {
  flex: 0 0 72px;
  min-width: 72px;
  min-height: 46px;
  border-color: #12b8ff;
  background: #08aaff;
  color: #ffffff;
}

.tag-save-status {
  min-height: 20px;
  color: #b8c6ef;
  font-size: 12px;
  font-weight: 800;
  line-height: 20px;
}

.tag-save-status.success {
  color: #7ee2a8;
}

.tag-save-status.error {
  color: #ff8fa3;
}

.points-status {
  margin-top: 2px;
  color: #d9e6ff;
}

.billing-card {
  gap: 10px;
  border-color: rgba(18, 184, 255, 0.5);
  background: linear-gradient(135deg, #33354a 0%, #2c314a 58%, #20354b 100%);
}

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

.billing-title {
  margin-bottom: 0;
}

  .billing-badge {
    flex: 0 0 auto;
    min-width: 116px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 184, 77, 0.64);
    border-radius: 12px;
  background: rgba(58, 43, 22, 0.72);
  color: #ffe6ad;
  font-size: 14px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
}

.billing-status {
  margin-top: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 184, 77, 0.5);
  border-radius: 10px;
  background: rgba(58, 43, 22, 0.72);
  color: #ffe6ad;
}

.model-tab,
.soft-tab,
.prompt-tag,
.resolution-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 8px 14px;
  border: 1px solid var(--button-border);
  border-radius: 12px;
  background: var(--button-bg);
  color: #dce6ff;
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.soft-tab,
.prompt-tag {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 10px;
}

.model-tab.active,
.soft-tab.active,
.prompt-tag.active,
.resolution-tab.active {
  border-color: #12b8ff;
  background: var(--blue);
  color: #ffffff;
}

.model-tab:disabled,
.model-tab.is-locked,
.mode-tab:disabled,
.mode-tab.is-locked {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.7);
}

.batch-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.generation-mode-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(98, 106, 138, 0.45);
}

.generation-mode-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-tab {
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--button-border);
  border-radius: 10px;
  background: var(--button-bg);
  color: #dce6ff;
  font-size: 13px;
  font-weight: 800;
}

.mode-tab.active {
  border-color: #12b8ff;
  background: linear-gradient(90deg, #08aaff, #087fdc);
  color: #ffffff;
}

.mode-note {
  padding: 7px 9px;
  border: 1px solid rgba(255, 184, 77, 0.55);
  border-radius: 9px;
  background: rgba(58, 43, 22, 0.75);
  color: #ffe6ad;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
}

.batch-control.mode-locked {
  opacity: 0.78;
}

.batch-control.mode-locked .batch-tab,
.batch-control.mode-locked .batch-custom-control {
  pointer-events: none;
}

.batch-control.single-output-only .batch-tab:not([data-count="1"]),
.batch-control.single-output-only .batch-custom-control {
  display: flex;
}

.batch-control.single-output-only .batch-buttons {
  gap: 8px;
}

.batch-control.mode-locked .batch-tab:not(.active),
.batch-control.mode-locked .batch-custom-control {
  filter: saturate(0.35);
  opacity: 0.46;
}

.composition-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 4px;
}

.batch-label {
  color: #cbd5ef;
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
}

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

.composition-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.composition-tab {
  flex: 1 1 150px;
  min-height: 30px;
  padding: 0 14px;
  border: 1px solid var(--button-border);
  border-radius: 10px;
  background: var(--button-bg);
  color: #dce6ff;
  font-size: 13px;
  font-weight: 800;
}

.composition-tab.active {
  border-color: #12b8ff;
  background: var(--blue);
  color: #ffffff;
}

.batch-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--button-border);
  border-radius: 14px;
  background: var(--button-bg);
  color: #dce6ff;
  font-size: 12px;
  font-weight: 800;
}

.batch-tab.active {
  border-color: #12b8ff;
  background: var(--blue);
  color: #ffffff;
}

.batch-count-input {
  width: 62px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #555d7d;
  border-radius: 9px;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.reference-grid {
  align-items: center;
  width: 100%;
  margin-top: 6px;
}

.reference-thumb,
.reference-placeholder,
.add-reference {
  width: 74px;
  height: 74px;
  margin-right: 10px;
  margin-bottom: 8px;
  border-radius: 9px;
}

.reference-thumb,
.reference-placeholder {
  position: relative;
  overflow: hidden;
  border: 1px solid #6d7491;
  background: #f0f2ff;
}

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

.remove-reference {
  position: absolute;
  z-index: 3;
  top: 4px;
  right: 4px;
  display: flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: rgba(185, 28, 28, 0.94);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  color: #ffffff;
  font-size: 19px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}

.remove-reference:hover,
.remove-reference:focus-visible {
  background: #dc2626;
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

.add-reference {
  padding: 0;
  border: 1px dashed #858cab;
  background: #303249;
  color: #edf2ff;
  font-size: 34px;
  font-weight: 400;
  line-height: 68px;
  text-align: center;
}

.batch-custom-control {
  display: inline-flex;
  height: 30px;
  padding-left: 9px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--button-border);
  border-radius: 7px;
  background: var(--button-bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.batch-custom-control .batch-count-input {
  width: 42px;
  height: 28px;
  padding: 0 4px;
  border: 0;
  border-left: 1px solid var(--button-border);
  border-radius: 0 6px 6px 0;
  background: var(--input-bg);
  font-size: 12px;
  font-weight: 500;
}

.reference-placeholder {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  border-style: dashed;
  color: #2f3b58;
  cursor: pointer;
}

.reference-placeholder span {
  font-size: 28px;
  line-height: 24px;
}

.reference-placeholder strong {
  font-size: 12px;
  line-height: 14px;
}

.material-library-btn {
  border-color: rgba(35, 190, 255, 0.72);
  background: rgba(9, 116, 177, 0.54);
  color: #dff6ff;
}

.material-library-modal {
  max-width: 430px;
}

.material-library-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-bottom: 12px;
}

.material-library-tabs {
  display: flex;
  gap: 8px;
}

.material-library-tab {
  flex: 1 1 0;
  height: 34px;
  border: 1px solid rgba(126, 144, 196, 0.58);
  border-radius: 10px;
  background: rgba(31, 36, 59, 0.72);
  color: #dce7ff;
  font-size: 13px;
  font-weight: 900;
}

.material-library-tab.active {
  border-color: rgba(38, 190, 255, 0.95);
  background: rgba(8, 170, 255, 0.88);
  color: #ffffff;
}

.material-search-input,
.material-type-filter {
  width: 100%;
  flex: 0 0 auto;
}

.material-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  max-height: 355px;
  overflow: auto;
  padding-right: 2px;
}

.material-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(132, 154, 210, 0.46);
  border-radius: 12px;
  background: rgba(24, 29, 50, 0.72);
  color: #eef4ff;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.material-card:hover {
  border-color: rgba(38, 190, 255, 0.86);
  background: rgba(22, 50, 78, 0.74);
}

.material-card-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 9px;
  background: rgba(10, 13, 25, 0.72);
}

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

.material-card-body {
  display: block;
  min-width: 0;
  padding-top: 7px;
}

.material-card-name {
  display: block;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-card-meta {
  display: block;
  margin-top: 2px;
  color: #aebce2;
  font-size: 11px;
  font-weight: 800;
  line-height: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-card-add {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.material-empty {
  grid-column: 1 / -1;
  padding: 18px 10px;
  border: 1px dashed rgba(132, 154, 210, 0.42);
  border-radius: 12px;
  color: #aebce2;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.material-library-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(126, 144, 196, 0.28);
}

.material-library-count {
  color: #bfe9ff;
  font-size: 12px;
  font-weight: 900;
}

.prompt-editor-tool {
  border-color: rgba(38, 190, 255, 0.95);
  background: rgba(8, 170, 255, 0.88);
  color: #ffffff;
}

.prompt-editor-modal {
  max-width: 620px;
}

.prompt-editor-textarea {
  display: block;
  width: 100%;
  min-height: 280px;
  max-height: 58vh;
  padding: 14px;
  resize: vertical;
  border: 1px solid rgba(126, 154, 220, 0.62);
  border-radius: 14px;
  outline: none;
  background: rgba(18, 23, 42, 0.82);
  color: #f4f8ff;
  font-size: 14px;
  font-weight: 800;
  line-height: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.02);
}

.prompt-editor-textarea:focus {
  border-color: rgba(38, 190, 255, 0.9);
  box-shadow:
    0 0 0 3px rgba(38, 190, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.prompt-editor-actions {
  justify-content: flex-end;
}

.hidden-file {
  display: none;
}

.prompt-head {
  align-items: flex-start;
  width: 100%;
}

.prompt-label {
  width: 52px;
  min-width: 52px;
  margin-right: 8px;
  margin-bottom: 0;
}

.prompt-tags {
  flex: 1;
  position: relative;
  gap: 8px;
}

.prompt-tag-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  margin-right: 8px;
  margin-bottom: 8px;
}

.prompt-tag-wrap .prompt-tag {
  margin-right: 0;
  margin-bottom: 0;
}

.prompt-dropdown {
  position: absolute;
  top: 38px;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 126px;
  padding: 6px;
  border: 1px solid rgba(126, 145, 196, 0.56);
  border-radius: 10px;
  background: rgba(25, 29, 49, 0.68);
  box-shadow: 0 10px 24px rgba(6, 9, 22, 0.24);
}

.prompt-dropdown.hidden {
  display: none;
}

.prompt-dropdown-item {
  position: relative;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #eef3ff;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.prompt-dropdown-item:hover {
  background: rgba(8, 170, 255, 0.78);
  color: #ffffff;
}

.prompt-dropdown-item.user-override {
  color: #ffe6ad;
}

.prompt-dropdown-item[data-tooltip]:hover::after {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  z-index: 40;
  width: 320px;
  max-height: 148px;
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
  color: #334155;
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
}

.prompt-choice {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  width: auto;
  max-width: 520px;
  margin-top: 0;
  padding: 5px;
  border: 1px solid rgba(104, 215, 161, 0.24);
  border-radius: 10px;
  background: rgba(24, 31, 42, 0.86);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.prompt-choice-flash {
  animation:
    prompt-choice-rise 0.18s ease-out,
    prompt-choice-attention 0.82s ease-in-out 0.18s 2;
}

.prompt-choice-text {
  flex: 0 0 auto;
  padding: 0 6px 0 2px;
  color: #9fb0c8;
  font-size: 12px;
  font-weight: 800;
  line-height: 28px;
}

.prompt-choice-btn {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(133, 148, 170, 0.42);
  border-radius: 7px;
  background: rgba(36, 44, 58, 0.78);
  color: #dce6f5;
  font-size: 12px;
  font-weight: 900;
}

.prompt-choice-btn.primary {
  border-color: rgba(104, 215, 161, 0.7);
  background: #68d7a1;
  color: #102219;
}

@keyframes prompt-choice-rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes prompt-choice-attention {
  0%,
  100% {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  }
  50% {
    border-color: rgba(var(--user-accent-rgb), 0.72);
    box-shadow:
      0 14px 34px rgba(0, 0, 0, 0.22),
      0 0 0 4px rgba(var(--user-accent-rgb), 0.16);
  }
}

@media (max-width: 680px) {
  .prompt-choice {
    flex-wrap: wrap;
    max-width: 100%;
  }
}

.prompt-input-wrap {
  position: relative;
  width: 100%;
  margin-top: 8px;
}

.prompt-input-wrap.has-prompt-choice .prompt-input {
  filter: blur(1.2px);
  opacity: 0.72;
}

.prompt-input {
  width: 100%;
  min-height: 126px;
  padding: 13px;
  resize: vertical;
  border: 1px solid #56618a;
  border-radius: 10px;
  outline: none;
  background: var(--input-bg);
  color: #f1f5ff;
  font-size: 14px;
  font-weight: 700;
  line-height: 22px;
}

.prompt-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.prompt-tool-btn {
  min-height: 27px;
  padding: 4px 10px;
  border: 1px solid rgba(126, 144, 196, 0.55);
  border-radius: 8px;
  background: rgba(30, 34, 55, 0.82);
  color: #cfd9f6;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.prompt-tool-btn.hidden {
  display: none;
}

.prompt-tool-btn:hover {
  border-color: rgba(26, 181, 255, 0.72);
  color: #f0f7ff;
}

.prompt-tool-btn.save-tool {
  min-width: 76px;
  border-color: rgba(132, 188, 218, 0.48);
  background: rgba(38, 46, 69, 0.82);
  color: #d8e7f7;
}

.custom-prompt-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(98, 106, 138, 0.45);
}

.custom-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.custom-prompt-title {
  color: #f3f7ff;
  font-size: 13px;
  font-weight: 900;
  line-height: 18px;
}

.custom-prompt-subtitle {
  color: #9eacd1;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
}

.custom-prompt-save-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 7px;
  margin-bottom: 9px;
}

.custom-prompt-name {
  flex: 1 1 260px;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
}

.custom-prompt-save-row .prompt-tool-btn {
  min-height: 42px;
  padding: 0 14px;
}

.custom-prompt-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 7px;
}

.custom-prompt-empty {
  color: #9eacd1;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.custom-prompt-item {
  display: flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid rgba(126, 174, 231, 0.56);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(25, 31, 54, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.custom-prompt-use {
  max-width: 230px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #e6eeff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-prompt-delete {
  width: 32px;
  min-height: 34px;
  border: 0;
  border-left: 1px solid rgba(126, 144, 196, 0.32);
  background: rgba(18, 21, 35, 0.35);
  color: #ffb7c2;
  font-size: 16px;
  font-weight: 900;
}

.custom-prompt-use:hover,
.custom-prompt-delete:hover {
  background: rgba(26, 181, 255, 0.12);
}

.app-dialog-backdrop {
  z-index: 180;
}

.app-dialog-card {
  max-width: 430px;
  transform: translateY(-6px);
  animation: dialog-rise 0.18s ease-out;
}

.app-dialog-head {
  margin-bottom: 14px;
}

.app-dialog-message {
  max-width: 100%;
  margin-top: 8px;
  color: #e7efff;
  font-size: 13px;
  font-weight: 800;
  line-height: 20px;
  white-space: pre-line;
}

.app-dialog-input {
  width: 100%;
  flex: 0 0 auto;
  margin: 2px 0 4px;
}

.app-dialog-input.hidden {
  display: none;
}

.app-dialog-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.app-dialog-actions .admin-btn {
  min-width: 86px;
}

@keyframes dialog-rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(-6px) scale(1);
  }
}

.generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  margin-bottom: 12px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--blue), var(--blue-deep));
  color: #17204b;
  font-size: 23px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}

.generate-btn:disabled {
  cursor: default;
}

.generate-btn.is-generating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(90deg, #17aeea, #0d8fd1);
  color: #102944;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.generate-btn .generate-main {
  color: #102944;
  font-size: 18px;
  font-weight: 900;
}

.generate-btn .generate-time {
  padding: 3px 8px;
  border: 1px solid rgba(155, 98, 16, 0.28);
  border-radius: 999px;
  background: rgba(255, 218, 143, 0.78);
  color: #6d4308;
  font-size: 11px;
  font-weight: 900;
  line-height: 14px;
}

.history-card {
  padding: 10px;
}

.history-title {
  margin-bottom: 8px;
  color: #c7d2f3;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
}

.history-grid {
  width: 100%;
  gap: 5px;
}

.history-item {
  position: relative;
  overflow: visible;
  width: 42px;
  height: 42px;
  margin-right: 0;
  margin-bottom: 0;
  padding: 0;
  border: 1px solid #6b7390;
  border-radius: 6px;
  background: #eef0ff;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.history-item:hover {
  border-color: #12b8ff;
  transform: translateY(-1px);
}

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

.history-preview-btn {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.history-index {
  position: absolute;
  left: 3px;
  bottom: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(16, 20, 40, 0.72);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.history-action-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 30px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid rgba(47, 124, 246, 0.42);
  border-radius: 999px;
  background: #2f7cf6;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.history-action-btn:hover:not(.is-selected) {
  border-color: rgba(30, 64, 175, 0.62);
  background: #1d4ed8;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.32);
  transform: translateY(-2px);
}

.history-action-btn:active:not(.is-selected) {
  transform: translateY(0);
}

.history-action-btn.is-selected {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  cursor: default;
}

.history-action-btn.danger {
  border-color: rgba(220, 38, 38, 0.35);
  background: #dc2626;
}

.history-action-btn.danger:hover:not(.is-selected) {
  border-color: rgba(185, 28, 28, 0.65);
  background: #b91c1c;
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.28);
}

.history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(112, 124, 165, 0.28);
  color: #c7d2f3;
  font-size: 13px;
  font-weight: 800;
}

.history-download-link {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid rgba(244, 177, 67, 0.65);
  border-radius: 8px;
  background: rgba(80, 51, 15, 0.7);
  color: #ffe1a1;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.history-download-link:disabled {
  border-color: rgba(112, 124, 165, 0.3);
  background: rgba(31, 34, 52, 0.75);
  color: #727b9e;
  cursor: default;
}

@media (max-width: 340px) {
  .web-panel {
    width: 100%;
    min-width: 0;
    margin: 0;
    border-radius: 0;
  }

  .prompt-head {
    flex-direction: column;
  }

  .prompt-label {
    width: 100%;
    margin-right: 0;
    margin-bottom: 8px;
  }

  .model-tab,
  .soft-tab,
  .prompt-tag,
  .resolution-tab {
    flex: 1 1 auto;
  }

  .login-btn {
    flex: 1 1 100%;
  }

  .generate-btn {
    font-size: 20px;
  }
}

/* PC creative studio shell. The Photoshop panel keeps its separate stylesheet. */
.desktop-sidebar,
.desktop-topbar {
  display: none;
}

.desktop-content {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
}

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

.history-subtitle {
  color: #8f99aa;
  font-size: 12px;
  line-height: 18px;
}

@media (min-width: 900px) {
  :root {
    --page-bg: #111318;
    --panel-bg: #151820;
    --card-bg: #1b1f27;
    --card-border: #303640;
    --input-bg: #12151c;
    --button-bg: #242933;
    --button-border: #414957;
    --text: #f2f5f7;
    --muted: #a7b0bd;
    --blue: #68d7a1;
    --blue-deep: #4cbd87;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    display: block;
    min-width: 900px;
    background: var(--page-bg);
    color: var(--text);
    font-size: 15px;
  }

  .web-panel {
    display: grid;
    width: 100%;
    max-width: none;
    min-width: 900px;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    grid-template-columns: 216px minmax(0, 1fr);
    border: 0;
    border-radius: 0;
    background: var(--page-bg);
  }

  .desktop-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    width: 216px;
    height: 100vh;
    min-height: 640px;
    padding: 22px 14px 18px;
    flex-direction: column;
    border-right: 1px solid #282d36;
    background: #151820;
  }

  .desktop-brand {
    display: flex;
    min-height: 56px;
    padding: 0 8px 18px;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid #2a3039;
  }

  .desktop-brand-logo {
    display: block;
    width: 56px;
    height: 36px;
    flex: 0 0 auto;
    object-fit: contain;
  }

  .desktop-brand-name {
    color: #f5f8f7;
    font-size: 18px;
    font-weight: 800;
    line-height: 24px;
  }

  .desktop-brand-tagline {
    color: #8f9b9f;
    font-size: 9px;
    font-weight: 600;
    line-height: 14px;
    white-space: nowrap;
  }

  .desktop-nav {
    display: flex;
    margin-top: 22px;
    flex-direction: column;
    gap: 4px;
  }

  .desktop-nav-section {
    margin: 18px 2px 7px;
    color: #d8c99a;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 24px;
    cursor: default;
    user-select: none;
  }

  .desktop-nav-section:first-child {
    margin-top: 0;
  }

  .desktop-nav.is-disabled {
    opacity: 0.42;
    filter: blur(1px);
    user-select: none;
  }

  .desktop-nav-item {
    display: flex;
    min-height: 38px;
    padding: 0 14px;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #aab3bf;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }

  .desktop-nav-section + .desktop-nav-item {
    margin-top: 1px;
  }

  .desktop-nav-item:hover {
    border-color: #343b45;
    background: #1d222a;
    color: #f1f5f3;
  }

  .desktop-nav.is-disabled .desktop-nav-item {
    border-color: transparent;
    background: transparent;
    color: #657181;
    cursor: default;
    pointer-events: none;
  }

  .desktop-nav.is-disabled .desktop-nav-section {
    color: #768290;
  }

  .desktop-nav-item-disabled {
    color: #66717f;
    cursor: default;
    opacity: 0.72;
    pointer-events: none;
  }

  .desktop-nav-item.active {
    border-color: rgba(104, 215, 161, 0.3);
    background: rgba(64, 151, 109, 0.14);
    color: #8be4b7;
  }

  .desktop-sidebar-footer {
    display: flex;
    margin-top: auto;
    padding: 13px 4px 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-top: 1px solid #2a3039;
    color: #88929f;
    font-size: 11px;
    font-weight: 700;
  }

  .plugin-download-entry {
    display: flex;
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(104, 215, 161, 0.28);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(104, 215, 161, 0.11), rgba(47, 124, 246, 0.08));
    color: #c8f1dc;
    font: inherit;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  }

  .plugin-download-entry:hover {
    border-color: rgba(104, 215, 161, 0.5);
    background: linear-gradient(135deg, rgba(104, 215, 161, 0.17), rgba(47, 124, 246, 0.12));
    transform: translateY(-1px);
  }

  .plugin-download-entry-main {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .plugin-coming-soon {
    flex: 0 0 auto;
    color: #8f99a6;
    font-size: 10px;
    font-weight: 600;
  }

  .plugin-download-entry-arrow {
    color: #68d7a1;
    font-size: 14px;
  }

  .desktop-service-status {
    display: flex;
    padding: 2px 6px 0;
    align-items: center;
    gap: 8px;
  }

  .desktop-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #68d7a1;
    box-shadow: 0 0 0 3px rgba(104, 215, 161, 0.1);
  }

  .plugin-download-modal {
    max-width: 520px;
  }

  .plugin-download-card {
    padding: 18px;
    border: 1px solid rgba(104, 215, 161, 0.24);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(104, 215, 161, 0.1), rgba(47, 124, 246, 0.07));
  }

  .plugin-download-name {
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
  }

  .plugin-download-meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
  }

  .plugin-download-note {
    margin-top: 14px;
    color: #8994a3;
    font-size: 12px;
    line-height: 20px;
  }

  .plugin-download-actions {
    margin-top: 18px;
    justify-content: flex-start;
    gap: 10px;
  }

  .plugin-download-actions .admin-btn {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 128px;
    height: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
  }

  .plugin-download-primary {
    border-color: #2f7cf6;
    background: #2f7cf6;
    color: #ffffff;
  }

  .plugin-cloud-btn {
    border-color: rgba(47, 124, 246, 0.35);
    background: rgba(47, 124, 246, 0.08);
    color: #2f7cf6;
  }

  .plugin-install-notes {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(104, 215, 161, 0.22);
    border-radius: 8px;
    background: rgba(10, 14, 22, 0.22);
  }

  .plugin-install-notes.hidden {
    display: none;
  }

  .plugin-install-title {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
  }

  .plugin-install-notes ol {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 22px;
  }

  .plugin-creative-cloud-link {
    display: inline-flex;
    margin-top: 10px;
    color: #2f7cf6;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
  }

  .desktop-content {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    padding: 0 24px 36px;
  }

  .desktop-topbar {
    display: flex;
    min-height: 78px;
    margin: 0 -24px 18px;
    padding: 15px 26px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid #292f38;
    background: #151820;
  }

  .desktop-topbar-kicker {
    color: #74dba8;
    font-size: 10px;
    font-weight: 800;
    line-height: 14px;
  }

  .desktop-topbar-title {
    margin: 1px 0 0;
    color: #f5f7f6;
    font-size: 20px;
    font-weight: 800;
    line-height: 28px;
  }

  .desktop-topbar-meta {
    color: #8e98a6;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
  }

  .panel-card {
    margin-bottom: 0;
    padding: 16px;
    border-color: var(--card-border);
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: none;
  }

  .section-title {
    margin-bottom: 14px;
    color: #f3f6f5;
    font-size: 16px;
    line-height: 22px;
  }

  .account-panel {
    display: flex;
    width: 100%;
    max-width: 1480px;
    min-height: 72px;
    margin: 0 auto 16px;
    padding: 12px 14px;
    flex-flow: row wrap;
    align-items: center;
    gap: 10px 16px;
    border-color: #2c333d;
    background: #181c23;
  }

  .account-panel .brand-head {
    display: none;
  }

  .account-panel .account-status {
    order: -1;
    margin: 0 auto 0 0;
    color: #96a1ae;
    font-size: 12px;
  }

  .account-panel .account-row {
    flex-wrap: nowrap;
    margin-left: auto;
  }

  .account-panel .account-row .text-input {
    width: 168px;
    min-width: 0;
    height: 34px;
  }

  .login-visual {
    display: none;
  }

  .account-panel .account-summary {
    width: 100%;
    min-height: 40px;
    align-items: center;
  }

  .account-panel .summary-name {
    font-size: 16px;
    line-height: 22px;
  }

  .account-panel .summary-meta {
    margin-top: 1px;
    color: #77dda9;
    font-size: 13px;
    line-height: 19px;
  }

  .account-panel .user-recharge-notice {
    width: 100%;
    margin: 0;
  }

  .account-actions,
  .account-panel .account-actions {
    gap: 7px;
  }

  .login-btn,
  .password-action-btn,
  .logout-btn {
    min-height: 36px;
    padding: 6px 18px;
    border-color: #454e5b;
    border-radius: 6px;
    background: #232832;
    color: #e7ece9;
  }

  .user-workspace {
    display: grid;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "flow"
      "history";
    gap: 14px;
    align-items: start;
  }

  .user-workspace.hidden {
    display: none;
  }

  body.auth-locked {
    overflow: hidden;
    background: #f7f8fa;
  }

  body.auth-locked .web-panel {
    display: block;
    min-width: 900px;
    min-height: 100vh;
    background: #f7f8fa;
  }

  body.auth-locked .desktop-sidebar,
  body.auth-locked .desktop-topbar,
  body.auth-locked .user-workspace,
  body.auth-locked .theme-picker,
  body.auth-locked .desktop-sidebar-footer {
    display: none;
  }

  body.auth-locked .desktop-content {
    min-height: 100vh;
    padding: 0;
    background: #f7f8fa;
  }

  body.auth-locked .account-panel {
    position: relative;
    display: grid;
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    grid-template-columns: minmax(500px, 54vw) minmax(440px, 46vw);
    border: 0;
    border-radius: 0;
    background: #f7f8fa;
    box-shadow: none;
  }

  body.auth-locked .account-panel .brand-head {
    position: absolute;
    top: 34px;
    left: 42px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  body.auth-locked .brand-logo-box {
    display: block;
    width: 64px;
    height: 42px;
    background: transparent;
  }

  body.auth-locked .brand-logo {
    width: 64px;
    height: 42px;
    object-fit: contain;
    filter: brightness(0.22) saturate(1.1);
  }

  body.auth-locked .brand-copy {
    display: block;
  }

  body.auth-locked .brand-title {
    margin: 0;
    color: #101722;
    font-size: 22px;
    line-height: 28px;
  }

  body.auth-locked .brand-tagline {
    margin-top: 1px;
    color: #6e7784;
    font-size: 11px;
    font-weight: 700;
  }

  body.auth-locked .account-status {
    position: absolute;
    top: calc(50% - 120px);
    left: 29%;
    width: min(320px, 34vw);
    margin: 0;
    transform: translateX(-50%);
    color: #5f6f84;
    font-size: 13px;
    font-weight: 750;
    line-height: 20px;
    text-align: center;
  }

body.auth-locked .account-status::before {
  content: none;
}

body.auth-locked .login-welcome-title {
  position: absolute;
  top: calc(50% - 162px);
  left: 29%;
  width: min(320px, 34vw);
  margin: 0;
  transform: translateX(-50%);
  color: #132033;
  font-size: 24px;
  font-weight: 900;
  line-height: 32px;
  text-align: center;
}

body.auth-locked .account-row {
  position: absolute;
  top: calc(50% + 20px);
    left: 29%;
    display: grid;
    width: min(320px, 34vw);
    margin: 0;
    transform: translate(-50%, -50%);
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.auth-locked .account-panel .account-row .text-input {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    border: 1px solid #d9dde5;
    border-radius: 9px;
    background: #ffffff;
    color: #141b27;
    font-size: 14px;
    box-shadow: 0 1px 0 rgba(14, 21, 32, 0.03);
  }

  body.auth-locked .account-panel .account-row .remember-password-row {
    margin: -1px 0 0 4px;
    color: #667386;
  }

  body.auth-locked .account-panel .account-row .text-input:focus {
    border-color: #1f7f62 !important;
    box-shadow: 0 0 0 3px rgba(31, 127, 98, 0.11) !important;
  }

  body.auth-locked .account-panel .account-row .login-btn {
    width: 100%;
    height: 48px;
    min-height: 48px;
    margin-top: 4px;
    border: 0;
    border-radius: 24px;
    background: #0f1724;
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
  }

  body.auth-locked .account-panel .account-row .login-btn:hover {
    background: #182235;
  }

  body.auth-locked .login-visual {
    position: relative;
    display: grid;
    min-height: 100vh;
    grid-column: 2;
    place-items: center;
    overflow: hidden;
    background:
      linear-gradient(rgba(99, 190, 255, 0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(99, 190, 255, 0.035) 1px, transparent 1px),
      radial-gradient(circle at 50% 43%, rgba(45, 154, 255, 0.24), transparent 34%),
      radial-gradient(circle at 68% 64%, rgba(104, 215, 161, 0.18), transparent 30%),
      linear-gradient(145deg, #07111d 0%, #0b1626 52%, #050811 100%);
    background-size: 42px 42px, 42px 42px, auto, auto, auto;
  }

  body.auth-locked .login-visual::before {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(90deg, rgba(7, 17, 29, 0.24), transparent 28%, rgba(7, 17, 29, 0.04));
    content: "";
    pointer-events: none;
  }

  body.auth-locked .login-visual::after {
    position: absolute;
    left: 50%;
    bottom: 15%;
    z-index: 1;
    width: min(600px, 38vw);
    height: 142px;
    border: 1px solid rgba(104, 215, 161, 0.34);
    border-radius: 50%;
    background:
      radial-gradient(ellipse at center, rgba(104, 215, 161, 0.14), transparent 64%),
      repeating-radial-gradient(ellipse at center, transparent 0 28px, rgba(80, 198, 255, 0.16) 29px 30px);
    box-shadow: 0 0 54px rgba(104, 215, 161, 0.18);
    content: "";
    transform: translateX(-50%) rotate(-6deg);
    pointer-events: none;
  }

  .login-shoe-viewer {
    position: relative;
    z-index: 2;
    width: min(760px, 44vw);
    height: min(700px, 78vh);
    --poster-color: transparent;
    background: transparent;
    filter: drop-shadow(0 30px 42px rgba(0, 0, 0, 0.46)) drop-shadow(0 0 30px rgba(49, 141, 255, 0.12));
  }

  .login-hero-motion {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
  }

  .motion-scan {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18%;
    background: linear-gradient(90deg, transparent, rgba(82, 204, 255, 0.16), rgba(104, 215, 161, 0.1), transparent);
    filter: blur(1px);
    transform: translateX(-140%);
    animation: heroScan 12s infinite ease-in-out;
  }

  .motion-ring {
    position: absolute;
    border: 1px solid rgba(80, 198, 255, 0.38);
    border-radius: 50%;
    box-shadow: 0 0 28px rgba(80, 198, 255, 0.18);
    opacity: 0.75;
  }

  .motion-ring-one {
    right: 26%;
    bottom: 15%;
    width: 260px;
    height: 70px;
    --ring-rotate: -8deg;
    transform: rotate(-8deg);
    animation: ringPulse 10s infinite ease-in-out;
  }

  .motion-ring-two {
    right: 10%;
    top: 34%;
    width: 150px;
    height: 46px;
    --ring-rotate: 14deg;
    transform: rotate(14deg);
    animation: ringPulse 10s 2.4s infinite ease-in-out;
  }

  .motion-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(104, 215, 161, 0.8), transparent);
    transform-origin: left;
    opacity: 0.8;
    animation: lineDraw 11s infinite ease-in-out;
  }

  .motion-line-one {
    left: 12%;
    top: 31%;
    width: 48%;
    --line-rotate: -16deg;
    transform: rotate(-16deg);
  }

  .motion-line-two {
    right: 10%;
    bottom: 28%;
    width: 42%;
    --line-rotate: 8deg;
    transform: rotate(8deg);
    animation-delay: 3.2s;
  }

  .motion-part {
    position: absolute;
    display: block;
    border: 1px solid rgba(104, 215, 161, 0.5);
    background: rgba(7, 20, 32, 0.42);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 22px rgba(69, 188, 255, 0.14);
    opacity: 0;
    animation: partFloat 18s infinite ease-in-out;
  }

  .motion-part-one {
    left: 9%;
    top: 17%;
    width: 112px;
    height: 42px;
    border-radius: 65% 35% 48% 42%;
  }

  .motion-part-two {
    left: 13%;
    top: 28%;
    width: 132px;
    height: 36px;
    border-radius: 50%;
    animation-delay: 1.8s;
  }

  .motion-part-three {
    left: 10%;
    top: 40%;
    width: 124px;
    height: 52px;
    border-radius: 42% 58% 36% 50%;
    animation-delay: 3.6s;
  }

  .motion-chip {
    position: absolute;
    padding: 7px 10px;
    border: 1px solid rgba(104, 215, 161, 0.28);
    border-radius: 999px;
    background: rgba(3, 10, 18, 0.48);
    color: rgba(229, 249, 242, 0.88);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 20px rgba(104, 215, 161, 0.11);
    opacity: 0;
    animation: chipCycle 12s infinite ease-in-out;
  }

  .motion-chip-one { left: 12%; top: 14%; }
  .motion-chip-two { right: 14%; top: 24%; animation-delay: 4s; }
  .motion-chip-three { left: 14%; bottom: 22%; animation-delay: 8s; }

  @keyframes heroScan {
    0%, 18% { transform: translateX(-140%); opacity: 0; }
    34%, 58% { opacity: 1; }
    82%, 100% { transform: translateX(620%); opacity: 0; }
  }

  @keyframes ringPulse {
    0%, 100% { opacity: 0.28; transform: rotate(var(--ring-rotate)) scale(0.96); }
    50% { opacity: 0.88; transform: rotate(var(--ring-rotate)) scale(1.05); }
  }

  @keyframes lineDraw {
    0%, 18% { opacity: 0; transform: scaleX(0) rotate(var(--line-rotate, 0deg)); }
    42%, 72% { opacity: 0.85; transform: scaleX(1) rotate(var(--line-rotate, 0deg)); }
    100% { opacity: 0; transform: scaleX(1) rotate(var(--line-rotate, 0deg)); }
  }

  @keyframes partFloat {
    0%, 18% { opacity: 0; transform: translate3d(24px, 22px, 0) scale(0.82); }
    36%, 72% { opacity: 0.9; transform: translate3d(0, 0, 0) scale(1); }
    100% { opacity: 0; transform: translate3d(-18px, -16px, 0) scale(0.96); }
  }

  @keyframes chipCycle {
    0%, 22% { opacity: 0; transform: translateY(8px); }
    34%, 66% { opacity: 1; transform: translateY(0); }
    86%, 100% { opacity: 0; transform: translateY(-6px); }
  }

  .creation-flow {
    display: block;
    grid-area: flow;
    overflow: hidden;
    border: 1px solid #303741;
    border-radius: 9px;
    background: #191d24;
  }

  .creation-flow > .panel-card {
    margin: 0;
    padding: 22px 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .creation-flow > .panel-card + .panel-card {
    border-top: 1px solid #303741;
  }

  .workflow-step-index {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: rgba(var(--user-accent-rgb), 0.14);
    color: var(--user-accent);
    font-size: 10px;
    font-weight: 800;
  }

  .workflow-step-head {
    display: flex;
    margin-bottom: 18px;
    align-items: center;
    gap: 9px;
  }

  .workflow-step-head .section-title {
    margin: 0;
    font-size: 16px;
    line-height: 22px;
  }

  .workflow-step-note {
    margin-left: auto;
    color: #838e9b;
    font-size: 12px;
    line-height: 18px;
  }

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

  .workflow-control-block {
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-left: 1px solid #303741;
    border-radius: 0;
    background: transparent;
  }

  .workflow-control-block:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .generation-mode-control.workflow-control-block {
    margin: 0;
    padding-top: 0;
    border-top: 0;
  }

  .workflow-control-block .batch-label {
    margin-bottom: 9px;
    color: #8f99a6;
  }

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

  .reference-source-panel {
    padding-right: 18px;
    border-right: 1px solid #303741;
  }

  .reference-source-panel .batch-label {
    margin-bottom: 11px;
    color: #8f99a6;
  }

  .reference-card .source-tabs {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .reference-card .soft-tab {
    width: 100%;
  }

  .prompt-composer-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
  }

  .prompt-compose-main {
    min-width: 0;
  }

  .prompt-card .prompt-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  .prompt-card .prompt-label {
    width: auto;
    min-width: 58px;
    margin: 8px 0 0;
    color: #8f99a6;
  }

  .generation-submit-stack {
    display: flex;
    min-width: 0;
    padding-top: 15px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #303741;
  }

  .generation-count-control {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .generation-count-control .batch-label {
    margin: 0;
    color: #c5cdd7;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    text-align: left;
    white-space: nowrap;
  }

  .generation-count-control .batch-buttons {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .generation-submit-stack .billing-card {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }

  .generation-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 12px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .generation-summary .billing-head {
    display: contents;
  }

  .generation-summary .billing-head > div:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .generation-summary .billing-badge {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .generation-summary .billing-status {
    grid-column: 1;
    grid-row: 2;
  }

  .generate-btn {
    width: 280px;
    min-height: 50px;
    margin: 0;
    flex: 0 0 280px;
    border: 1px solid #6bdca7;
    border-radius: 7px;
    background: #68d7a1;
    color: #102219;
    font-size: 16px;
    font-weight: 800;
    line-height: 22px;
  }

  .generate-btn:not(:disabled):hover {
    border-color: #8be9ba;
    background: #7de1af;
  }

  .generate-btn:disabled {
    border-color: #363d46;
    background: #262c34;
    color: #6f7986;
  }

  .generate-btn.is-generating {
    background: #68d7a1;
    color: #102219;
  }

  .generate-btn .generate-main {
    color: #102219;
  }

  .history-card {
    grid-area: history;
    min-height: 0;
    padding: 18px;
  }

  .history-heading {
    align-items: center;
    margin-bottom: 14px;
  }

  .history-title {
    margin: 0;
    color: #f1f5f3;
    font-size: 15px;
    font-weight: 800;
    line-height: 22px;
  }

  .history-grid {
    display: flex;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    gap: 10px;
  }

  .history-item {
    width: 118px;
    height: 118px;
    flex: 0 0 118px;
    aspect-ratio: 1 / 1;
    border-color: #3b4450;
    border-radius: 7px;
    background: #11151b;
  }

  .history-item:hover {
    border-color: #68d7a1;
  }

  .history-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top-color: #303640;
    color: #8f99a7;
    font-size: 12px;
  }

  .prompt-input-wrap {
    margin-top: 12px;
  }

  .prompt-input {
    min-height: 210px;
    padding: 18px;
    border-color: #3a4550;
    border-radius: 7px;
    background: #11151b;
    color: #eef3f1;
    font-size: 15px;
    font-weight: 500;
    line-height: 25px;
  }

  .prompt-input:focus,
  .text-input:focus,
  .batch-count-input:focus {
    border-color: #68d7a1 !important;
    box-shadow: 0 0 0 2px rgba(104, 215, 161, 0.11) !important;
  }

  .custom-prompt-panel {
    margin-top: 14px;
    padding-top: 14px;
    border-top-color: #303640;
  }

  .reference-card .source-tabs {
    gap: 7px;
  }

  .reference-grid {
    min-height: 120px;
    margin-top: 0;
    padding: 11px;
    align-content: center;
    gap: 10px;
    border: 1px dashed #3d4651;
    border-radius: 7px;
    background: #151920;
  }

  .add-reference,
  .reference-thumb {
    width: 88px;
    height: 88px;
    border-radius: 7px;
  }

  .model-tabs,
  .generation-mode-buttons,
  .composition-buttons,
  .batch-buttons,
  .source-tabs,
  .prompt-tags {
    gap: 7px;
  }

  .model-tab,
  .mode-tab,
  .composition-tab,
  .soft-tab,
  .batch-tab,
  .prompt-tag,
  .prompt-tool-btn {
    min-height: 36px;
    padding-right: 14px;
    padding-left: 14px;
    margin: 0;
    border-color: #424b58;
    border-radius: 6px;
    background: #232832;
    color: #cbd3da;
    font-size: 13px;
  }

  .model-tab.active,
  .mode-tab.active,
  .composition-tab.active,
  .soft-tab.active,
  .batch-tab.active,
  .prompt-tag.active {
    border-color: #68d7a1;
    background: #68d7a1;
    color: #102219;
  }

  .mode-note {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #8f99a6;
    font-size: 12px;
    line-height: 19px;
  }

  .billing-card {
    min-height: 0;
    border-color: #3a424b;
  }

  .billing-badge {
    border-color: rgba(104, 215, 161, 0.5);
    background: rgba(44, 112, 78, 0.2);
    color: #91e7bc;
  }

  .billing-status {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #9da7b3;
    font-size: 12px;
    line-height: 19px;
  }

  .admin-panel {
    width: 100%;
    border-color: #34404a;
  }

  body.admin-mode .web-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  body.admin-mode .desktop-sidebar {
    display: none;
  }

  body.admin-mode .desktop-content {
    padding-right: 30px;
    padding-left: 30px;
  }

  body.admin-mode .desktop-topbar {
    margin-right: -30px;
    margin-left: -30px;
    padding-right: 48px;
    padding-left: 48px;
  }

  body.admin-mode .account-panel,
  body.admin-mode .admin-panel {
    width: 100%;
    max-width: 1608px;
  }

  body.admin-mode .account-panel {
    min-height: 90px;
    margin-bottom: 16px;
    padding: 12px 14px;
  }

  body.admin-mode .account-panel .account-summary {
    min-height: 60px;
    padding: 0 10px;
  }

  .modal-backdrop {
    background: rgba(7, 9, 12, 0.72);
  }

  .password-modal {
    border-color: #3c4651;
    border-radius: 8px;
    background: #1b2028;
  }
}

@media (min-width: 1240px) {
  .web-panel {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  body.admin-mode .web-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .desktop-sidebar {
    width: 232px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .desktop-content {
    padding-right: 30px;
    padding-left: 30px;
  }

  .desktop-topbar {
    margin-right: -30px;
    margin-left: -30px;
    padding-right: 32px;
    padding-left: 32px;
  }

  .prompt-composer-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .model-control-grid {
    grid-template-columns: minmax(190px, 0.8fr) minmax(360px, 1.45fr) minmax(440px, 1.7fr);
    align-items: stretch;
  }

  .composition-control.workflow-control-block {
    min-width: 0;
  }

  .composition-buttons {
    flex-wrap: nowrap;
  }

  .composition-tab {
    flex: 1 1 0;
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
    white-space: nowrap;
  }

  .workflow-control-block:nth-child(odd) {
    padding-left: 16px;
    border-left: 1px solid #303741;
  }

  .workflow-control-block:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .prompt-input {
    min-height: 210px;
  }

  .history-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
}

@media (min-width: 1680px) {
  .desktop-content {
    padding-right: 40px;
    padding-left: 40px;
  }

  .desktop-topbar {
    margin-right: -40px;
    margin-left: -40px;
    padding-right: 42px;
    padding-left: 42px;
  }

  .model-control-grid {
    grid-template-columns: minmax(210px, 0.8fr) minmax(420px, 1.4fr) minmax(520px, 1.7fr);
  }

  .history-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* PC skin picker and user-selected accent color. */
@media (min-width: 900px) {
  html {
    --user-accent: #68d7a1;
    --user-accent-rgb: 104, 215, 161;
    --user-accent-contrast: #102219;
  }

  body:not(.design-v2) .theme-picker {
    position: absolute;
    z-index: 80;
    top: 92px;
    right: -17px;
  }

  body:not(.design-v2) .theme-picker-btn {
    position: relative;
    display: inline-flex;
    width: 34px;
    height: 34px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid #38414d;
    border-radius: 50%;
    background: #1c222b;
    color: var(--user-accent);
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
  }

  body:not(.design-v2) .theme-picker-btn::after {
    position: absolute;
    top: 39px;
    left: 50%;
    padding: 5px 8px;
    border: 1px solid #41576e;
    border-radius: 4px;
    background: #1f2937;
    color: #f7fafc;
    content: "皮肤";
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -4px);
    transition: opacity 120ms ease, transform 120ms ease;
  }

  body:not(.design-v2) .theme-picker-btn:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  body:not(.design-v2) .theme-picker-btn:hover,
  body:not(.design-v2) .theme-picker-btn.active {
    border-color: var(--user-accent);
    background: #252c36;
  }

  body:not(.design-v2) .theme-picker-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body:not(.design-v2) .theme-picker-icon circle {
    fill: currentColor;
    stroke: none;
  }

  body:not(.design-v2) .theme-picker-panel {
    position: absolute;
    top: 0;
    left: 46px;
    width: 222px;
    padding: 14px;
    border: 1px solid #3a4350;
    border-radius: 8px;
    background: #1b2028;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  }

  body:not(.design-v2) .theme-picker-panel.hidden {
    display: none !important;
  }

  body:not(.design-v2) .theme-picker-title {
    margin-bottom: 11px;
    color: #f2f5f7;
    font-size: 13px;
    font-weight: 800;
    line-height: 18px;
  }

  body:not(.design-v2) .theme-mode-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body:not(.design-v2) .theme-mode-option {
    display: flex;
    min-width: 0;
    padding: 8px;
    align-items: center;
    gap: 7px;
    border: 1px solid #3d4653;
    border-radius: 6px;
    background: #242a33;
    color: #c7cfd8;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    outline: none;
  }

  body:not(.design-v2) .theme-mode-option:hover,
  body:not(.design-v2) .theme-mode-option.active {
    border-color: var(--user-accent);
    color: #f4f7f6;
  }

  body:not(.design-v2) .theme-mode-preview {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border-radius: 4px;
  }

  body:not(.design-v2) .theme-mode-preview-dark {
    border: 1px solid #4a5360;
    background: linear-gradient(135deg, #151820 0 48%, var(--user-accent) 49% 100%);
  }

  body:not(.design-v2) .theme-mode-preview-light {
    border: 1px solid #cbd3dd;
    background: linear-gradient(135deg, #ffffff 0 48%, var(--user-accent) 49% 100%);
  }

  body:not(.design-v2) .theme-accent-label {
    margin: 13px 0 8px;
    color: #8f99a6;
    font-size: 11px;
    font-weight: 700;
  }

  body:not(.design-v2) .theme-accent-options {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  body:not(.design-v2) .theme-accent-swatch,
  body:not(.design-v2) .theme-custom-color {
    position: relative;
    display: inline-flex;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    border-radius: 50%;
    background: var(--swatch-color, #ffffff);
    cursor: pointer;
    box-shadow: 0 0 0 1px #46505d;
  }

  body:not(.design-v2) .theme-accent-swatch:hover,
  body:not(.design-v2) .theme-accent-swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--swatch-color);
  }

  body:not(.design-v2) .theme-custom-color {
    overflow: hidden;
    border-color: #687382;
    background: conic-gradient(#e05a47, #d19032, #68d7a1, #00a6c7, #2f7cf6, #8b6cf6, #e05a47);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  }

  body:not(.design-v2) .theme-custom-color input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    pointer-events: auto;
  }

  body:not(.design-v2) .theme-custom-color.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--user-accent);
  }

  body:not(.design-v2) .theme-picker-note {
    margin-top: 11px;
    color: #778290;
    font-size: 10px;
    line-height: 15px;
  }

  body:not(.design-v2) .desktop-status-dot {
    background: var(--user-accent);
    box-shadow: 0 0 0 3px rgba(var(--user-accent-rgb), 0.1);
  }

  body:not(.design-v2) .desktop-nav-item.active {
    border-color: rgba(var(--user-accent-rgb), 0.32);
    background: rgba(var(--user-accent-rgb), 0.13);
    color: var(--user-accent);
  }

  body:not(.design-v2) .desktop-nav.is-disabled .desktop-nav-item.active {
    border-color: #29313a;
    background: rgba(31, 37, 46, 0.72);
    color: #8390a1;
  }

  body:not(.design-v2) .desktop-topbar-kicker,
  body:not(.design-v2) .account-panel .summary-meta {
    color: var(--user-accent);
  }

  body:not(.design-v2) .model-tab.active,
  body:not(.design-v2) .mode-tab.active,
  body:not(.design-v2) .composition-tab.active,
  body:not(.design-v2) .soft-tab.active,
  body:not(.design-v2) .batch-tab.active,
  body:not(.design-v2) .prompt-tag.active {
    border-color: var(--user-accent);
    background: var(--user-accent);
    color: var(--user-accent-contrast);
  }

  body:not(.design-v2) .generate-btn,
  body:not(.design-v2) .generate-btn.is-generating {
    border-color: var(--user-accent);
    background: var(--user-accent);
    color: var(--user-accent-contrast);
  }

  body:not(.design-v2) .generate-btn .generate-main,
  body:not(.design-v2) .generate-btn.is-generating .generate-main {
    color: var(--user-accent-contrast);
  }

  body:not(.design-v2) .generate-btn:not(:disabled):hover {
    border-color: var(--user-accent);
    background: var(--user-accent);
    filter: brightness(1.08);
  }

  body:not(.design-v2) .generate-btn:disabled {
    border-color: #363d46;
    background: #262c34;
    color: #6f7986;
    filter: none;
  }

  body:not(.design-v2) .prompt-input:focus,
  body:not(.design-v2) .text-input:focus,
  body:not(.design-v2) .batch-count-input:focus {
    border-color: var(--user-accent) !important;
    box-shadow: 0 0 0 2px rgba(var(--user-accent-rgb), 0.12) !important;
  }

  body:not(.design-v2) .history-item:hover {
    border-color: var(--user-accent);
  }

  body:not(.design-v2) .billing-badge {
    border-color: rgba(var(--user-accent-rgb), 0.48);
    background: rgba(var(--user-accent-rgb), 0.13);
    color: var(--user-accent);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) {
    --page-bg: #eef2f5;
    --panel-bg: #eef2f5;
    --card-bg: #f8fafc;
    --card-border: #d8e0e8;
    --input-bg: #f3f6f9;
    --button-bg: #f1f4f7;
    --button-border: #cbd5df;
    --text: #17202a;
    --muted: #687586;
    background: #eef2f5;
    color: #17202a;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .web-panel,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-content {
    background: #eef2f5;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-sidebar,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-topbar {
    border-color: #d8e0e8;
    background: #f8fafc;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-brand {
    border-color: #e1e6eb;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-brand-logo {
    padding: 0;
    border-radius: 0;
    background: transparent;
    filter: brightness(.48) saturate(1.15) contrast(1.08);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-brand-name,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-topbar-title,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .section-title,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .history-title,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .summary-name {
    color: #17202a;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-brand-tagline,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-topbar-meta,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-sidebar-footer,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .history-subtitle,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .history-footer,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .custom-prompt-empty {
    color: #748092;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-nav-item {
    color: #334155;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .plugin-download-entry {
    border-color: #d5e2f3;
    background: linear-gradient(135deg, rgba(47, 124, 246, 0.06), rgba(17, 24, 39, 0.02));
    color: #263548;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .plugin-download-entry:hover {
    border-color: #9eb9e2;
    background: linear-gradient(135deg, rgba(47, 124, 246, 0.1), rgba(255, 255, 255, 0.86));
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .plugin-download-entry-arrow {
    color: #2f7cf6;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .plugin-download-card {
    border-color: #d8e5f7;
    background: linear-gradient(135deg, #f7fbff, #ffffff);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .plugin-download-name {
    color: #17202a;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .plugin-download-meta,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .plugin-download-note {
    color: #64748b;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .plugin-install-notes {
    border-color: #d8e5f7;
    background: #f8fbff;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .plugin-install-title {
    color: #17202a;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .plugin-install-notes ol {
    color: #64748b;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-nav-section {
    color: #1e2a3a;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-nav-item-disabled {
    color: #aab4c2;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-nav-item:hover {
    border-color: #cbd8ea;
    background: #f3f7fc;
    color: #17202a;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-nav.is-disabled .desktop-nav-item {
    border-color: transparent;
    background: transparent;
    color: #a0a9b6;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-nav.is-disabled .desktop-nav-section {
    color: #8f9bad;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-nav.is-disabled .desktop-nav-item.active {
    border-color: #d8e2ef;
    background: #eef4fb;
    color: #7b8797;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-choice {
    border-color: #d6e0ee;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(30, 42, 58, 0.12);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-choice-text {
    color: #64748b;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-choice-btn {
    border-color: #d6e0ee;
    background: #f7f9fc;
    color: #334155;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-choice-btn:hover {
    border-color: #9db7dc;
    background: #f1f6fd;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-choice-btn.primary {
    border-color: #2f7cf6;
    background: #2f7cf6;
    color: #ffffff;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-input-wrap.has-prompt-choice .prompt-input {
    opacity: 0.66;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .desktop-sidebar-footer,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .custom-prompt-panel,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .history-footer,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .history-heading {
    border-color: #e3e8ed;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .panel-card,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .account-panel,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .billing-card {
    border-color: #d8e0e8;
    background: #f8fafc;
    box-shadow: 0 5px 14px rgba(29, 40, 54, 0.035);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .creation-flow {
    border-color: #d8e0e8;
    background: #f8fafc;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .creation-flow > .panel-card + .panel-card {
    border-top-color: #e3e8ed;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .workflow-step-note,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .workflow-control-block .batch-label,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .reference-source-panel .batch-label,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-card .prompt-label {
    color: #738091;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .workflow-control-block {
    border-color: #e1e6eb;
    background: transparent;
    box-shadow: none;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .generation-summary {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .reference-source-panel,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .generation-submit-stack {
    border-color: #e1e6eb;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .account-panel .account-status,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .custom-prompt-title {
    color: #687586;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .account-panel .account-summary {
    border-color: #dde4ec;
    background: #f3f6f9;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .account-panel .summary-name {
    color: #1d2732;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .account-panel .summary-meta {
    color: #127a50;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .text-input,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .batch-count-input,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-input {
    border-color: #cbd4df !important;
    background: #f3f6f9 !important;
    color: #17202a !important;
    box-shadow: none !important;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .text-input::placeholder,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-input::placeholder {
    color: #8b96a5;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .login-btn,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .password-action-btn,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .logout-btn,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .model-tab,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .mode-tab,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .composition-tab,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .soft-tab,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .batch-tab,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-tag,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-tool-btn {
    border-color: #d3dae3;
    background: #f7f9fb;
    color: #465365;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .model-tab.active,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .mode-tab.active,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .composition-tab.active,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .soft-tab.active,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .batch-tab.active,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-tag.active {
    border-color: var(--user-accent);
    background: var(--user-accent);
    color: #ffffff;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .reference-grid {
    border-color: #cbd4df;
    background: #f3f6f9;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .add-reference,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .reference-thumb,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .history-item {
    border-color: #cfd7e1;
    background: #f8fafc;
    color: #465365;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .mode-note,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .billing-status {
    border-color: transparent;
    background: transparent;
    color: #738091;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .generate-btn:disabled {
    border-color: #dce2e9;
    background: #e8ecf1;
    color: #98a3b0;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-picker-btn {
    border-color: #cdd5df;
    background: #f8fafc;
    box-shadow: 0 5px 14px rgba(28, 39, 52, 0.14);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-picker-btn:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-picker-btn.active {
    border-color: var(--user-accent);
    background: #f7f9fb;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-picker-panel {
    border-color: #d9e0e8;
    background: #f8fafc;
    box-shadow: 0 18px 42px rgba(28, 39, 52, 0.16);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-picker-title {
    color: #17202a;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-mode-option {
    border-color: #d6dde6;
    background: #f7f9fb;
    color: #4d5969;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-mode-option:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-mode-option.active {
    border-color: var(--user-accent);
    color: #17202a;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-accent-label,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-picker-note {
    color: #748092;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-accent-swatch,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-custom-color {
    box-shadow: 0 0 0 1px #c8d0da;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-accent-swatch:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .theme-accent-swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px var(--swatch-color);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .password-modal {
    border-color: #d9e0e8;
    background: #f8fafc;
    color: #17202a;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .modal-title {
    color: #17202a;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .modal-subtitle,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .app-dialog-message {
    color: #465466;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .modal-close-btn {
    border-color: #cbd5e1;
    background: #e8edf3;
    color: #334155;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .modal-close-btn:hover {
    border-color: #94a3b8;
    background: #dfe6ee;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .app-dialog-actions .admin-btn {
    border-color: #2f7cf6;
    background: #2f7cf6;
    color: #ffffff;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .app-dialog-actions .admin-btn.secondary {
    border-color: #cbd5e1;
    background: #eef2f6;
    color: #334155;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .image-preview-stage {
    border-color: #d8e2ef;
    background: #05070d;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .image-preview-stage canvas {
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  }
}

/* PC workspace navigation and the user's database-backed prompt library. */
@media (min-width: 900px) {
  .user-workspace[data-desktop-view="history"]:not(.hidden),
  .user-workspace[data-desktop-view="refine"]:not(.hidden),
  .user-workspace[data-desktop-view="refineHistory"]:not(.hidden),
  .user-workspace[data-desktop-view="prompts"]:not(.hidden),
  .user-workspace[data-desktop-view="threeD"]:not(.hidden),
  .user-workspace[data-desktop-view="threeDModel"]:not(.hidden),
  .user-workspace[data-desktop-view="threeDHistory"]:not(.hidden) {
    display: block;
  }

  body.auth-locked .user-workspace[data-desktop-view]:not(.hidden) {
    display: none !important;
  }

  .user-workspace[data-desktop-view="history"] > *,
  .user-workspace[data-desktop-view="refine"] > *,
  .user-workspace[data-desktop-view="refineHistory"] > *,
  .user-workspace[data-desktop-view="prompts"] > *,
  .user-workspace[data-desktop-view="threeD"] > *,
  .user-workspace[data-desktop-view="threeDModel"] > *,
  .user-workspace[data-desktop-view="threeDHistory"] > * {
    display: none;
  }

  .user-workspace[data-desktop-view="create"] > .prompt-library-card,
  .user-workspace[data-desktop-view="create"] > .refine-workspace-card,
  .user-workspace[data-desktop-view="create"] > .refine-history-card,
  .user-workspace[data-desktop-view="create"] > .three-d-card,
  .user-workspace[data-desktop-view="create"] > .three-d-model-card,
  .user-workspace[data-desktop-view="create"] > .three-d-history-card {
    display: none;
  }

  .user-workspace[data-desktop-view="create"] > #historyWorkspace .history-action-btn {
    display: none !important;
  }

  .user-workspace[data-desktop-view="history"] > #historyWorkspace,
  .user-workspace[data-desktop-view="refine"] > .refine-workspace-card,
  .user-workspace[data-desktop-view="refineHistory"] > .refine-history-card,
  .user-workspace[data-desktop-view="prompts"] > .prompt-library-card,
  .user-workspace[data-desktop-view="threeD"] > .three-d-card,
  .user-workspace[data-desktop-view="threeDModel"] > .three-d-model-card,
  .user-workspace[data-desktop-view="threeDHistory"] > .three-d-history-card {
    display: block;
    width: 100%;
    min-height: calc(100vh - 194px);
  }

  .prompt-library-card {
    display: none;
  }

  .user-workspace[data-desktop-view="history"] .history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    overflow: visible;
    padding-bottom: 0;
    gap: 9px;
  }

  .user-workspace[data-desktop-view="refine"] .history-grid,
  .user-workspace[data-desktop-view="refineHistory"] .history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    overflow: visible;
    padding-bottom: 0;
    gap: 10px;
  }

  .user-workspace[data-desktop-view="history"] .history-item,
  .user-workspace[data-desktop-view="refine"] .history-item,
  .user-workspace[data-desktop-view="refineHistory"] .history-item {
    width: 100%;
    height: auto;
    flex: initial;
  }

  .user-workspace[data-desktop-view="history"] .history-preview-btn,
  .user-workspace[data-desktop-view="refine"] .history-preview-btn,
  .user-workspace[data-desktop-view="refineHistory"] .history-preview-btn {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .history-grid:empty {
    display: grid;
    min-height: 150px;
    place-items: center;
  }

  .history-grid:empty::before {
    color: #7f8996;
    content: "暂无生成记录";
    font-size: 13px;
    font-weight: 600;
  }

  #refineSourceGrid:empty::before {
    content: "请先从生成记录选择图片";
  }

  #refineHistoryGrid:empty::before {
    content: "暂无修图记录";
  }

  .user-workspace[data-desktop-view="history"] .history-grid:empty,
  .user-workspace[data-desktop-view="refine"] .history-grid:empty,
  .user-workspace[data-desktop-view="refineHistory"] .history-grid:empty {
    min-height: 420px;
  }

  .prompt-library-head {
    display: flex;
    margin-bottom: 18px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
  }

  .prompt-library-head .section-title {
    margin-bottom: 2px;
  }

  .prompt-library-subtitle {
    color: #8f99a6;
    font-size: 12px;
    line-height: 18px;
  }

  .prompt-library-count {
    padding: 5px 10px;
    border: 1px solid #3d4652;
    border-radius: 5px;
    color: #9da8b5;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
  }

  .prompt-library-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: start;
  }

  .prompt-library-guide {
    display: grid;
    margin-top: 18px;
    min-height: 58px;
    padding: 0 16px;
    grid-template-columns: 220px minmax(34px, 1fr) 240px minmax(34px, 1fr) minmax(340px, 1fr);
    column-gap: 0;
    align-items: center;
    border: 1px solid #343c47;
    border-radius: 7px;
    background: rgba(21, 25, 32, 0.42);
    color: #334155;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
  }

  .prompt-library-guide span {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .prompt-library-guide i {
    display: block;
    height: 1px;
    background-image: linear-gradient(to right, #c8d3df 45%, transparent 0);
    background-position: left center;
    background-size: 12px 1px;
  }

  .prompt-library-editor,
  .prompt-library-create-panel,
  .prompt-library-saved-panel {
    min-width: 0;
    min-height: 400px;
    padding: 14px;
    border: 1px solid #343c47;
    border-radius: 7px;
    background: #151920;
  }

  .prompt-library-create-panel {
    display: flex;
    flex-direction: column;
  }

  .prompt-library-editor-title {
    margin-bottom: 12px;
    color: #edf2f0;
    font-size: 14px;
    font-weight: 800;
    line-height: 20px;
  }

  .prompt-library-title-input,
  .prompt-library-search {
    width: 100%;
    height: 38px;
  }

  .prompt-library-content-input {
    display: block;
    width: 100%;
    min-height: 250px;
    margin-top: 10px;
    padding: 12px;
    resize: vertical;
    border: 1px solid #3a4550;
    border-radius: 6px;
    outline: none;
    background: #10141a;
    color: #edf2f0;
    font: inherit;
    font-size: 13px;
    line-height: 21px;
  }

  .prompt-library-content-input:focus {
    border-color: var(--user-accent);
    box-shadow: 0 0 0 2px rgba(var(--user-accent-rgb), 0.11);
  }

  .prompt-library-create-row {
    display: block;
    margin-top: 0;
  }

  .prompt-library-editor-actions,
  .prompt-library-item-actions {
    display: flex;
    margin-top: 12px;
    justify-content: flex-end;
    gap: 7px;
  }

  .prompt-library-primary-btn,
  .prompt-library-secondary-btn,
  .prompt-library-use-btn,
  .prompt-library-action-btn {
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid #424b58;
    border-radius: 6px;
    background: #232832;
    color: #d2d9df;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .prompt-library-primary-btn,
  .prompt-library-use-btn {
    border-color: var(--user-accent);
    background: var(--user-accent);
    color: var(--user-accent-contrast);
  }

  .prompt-library-secondary-btn.hidden {
    display: none;
  }

  .prompt-library-action-btn.danger {
    color: #e79a9a;
  }

  .prompt-library-status {
    min-height: 18px;
    margin-top: 10px;
    color: #7f8996;
    font-size: 11px;
    line-height: 18px;
  }

  .prompt-library-status.success {
    color: #78dca9;
  }

  .prompt-library-status.error {
    color: #e58e8e;
  }

  .prompt-library-status.info {
    color: #8eb8df;
  }

  .prompt-library-toolbar {
    margin: 0 0 12px;
  }

  .prompt-library-list-title {
    margin-bottom: 8px;
    color: #b8c3d0;
    font-size: 12px;
    font-weight: 900;
    line-height: 18px;
  }

  .prompt-library-saved-panel .prompt-library-list-title {
    margin-bottom: 22px;
    color: #edf2f0;
    font-size: 14px;
    font-weight: 800;
    line-height: 20px;
  }

  .preset-prompt-select-label {
    display: none;
    margin-bottom: 6px;
    color: #8995a4;
    font-size: 12px;
    font-weight: 900;
    line-height: 18px;
  }

  .preset-prompt-selector-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 10px;
  }

  .preset-prompt-select-field {
    display: grid;
    gap: 6px;
    min-width: 0;
  }

  .preset-prompt-select {
    width: 100%;
    height: 38px;
    margin-bottom: 0;
  }

  .preset-group-title-input {
    width: 100%;
    height: 38px;
  }

  .prompt-library-section-head {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .preset-prompt-list,
  .preset-prompt-group {
    display: flex;
    flex-direction: column;
  }

  .preset-prompt-list {
    display: grid;
    grid-template-columns: 220px 240px minmax(340px, 1fr);
    gap: 16px;
    min-height: 348px;
  }

  .preset-column {
    display: flex;
    min-width: 0;
    min-height: 348px;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid #303946;
    border-radius: 8px;
    background: rgba(16, 20, 26, 0.72);
  }

  .preset-column-title {
    margin-bottom: 4px;
    color: #9aa6b5;
    font-size: 12px;
    font-weight: 900;
    line-height: 18px;
  }

  .preset-list-button {
    width: 100%;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #d8e1ec;
    font-size: 13px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  }

  .preset-list-button:hover {
    border-color: rgba(var(--user-accent-rgb), 0.38);
    background: rgba(var(--user-accent-rgb), 0.12);
    color: #ffffff;
    transform: translateY(-1px);
  }

  .preset-list-button.active {
    border-color: var(--user-accent);
    background: var(--user-accent);
    color: var(--user-accent-contrast);
    box-shadow: 0 10px 22px rgba(var(--user-accent-rgb), 0.18);
  }

  .preset-detail-column {
    gap: 10px;
  }

  .preset-detail-input-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .preset-prompt-group {
    gap: 8px;
  }

  .preset-prompt-group-title {
    color: #b8c3d0;
    font-size: 12px;
    font-weight: 900;
    line-height: 18px;
  }

  .preset-prompt-editor {
    padding-top: 0;
  }

  .preset-prompt-editor.is-customized .preset-prompt-title-input,
  .preset-prompt-editor.is-customized .preset-prompt-input {
    border-color: rgba(var(--user-accent-rgb), 0.38);
  }

  .preset-prompt-item-head {
    display: flex;
    margin-bottom: 8px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .preset-prompt-name {
    color: #eef3f1;
    font-size: 13px;
    font-weight: 900;
    line-height: 20px;
  }

  .preset-prompt-badge {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(132, 145, 162, 0.13);
    color: #8793a2;
    font-size: 10px;
    font-weight: 900;
  }

  .preset-prompt-editor.is-customized .preset-prompt-badge {
    background: rgba(var(--user-accent-rgb), 0.14);
    color: var(--user-accent);
  }

  .preset-prompt-title-input {
    width: 100%;
    height: 36px;
  }

  .preset-prompt-input {
    display: block;
    width: 100%;
    min-height: 190px;
    flex: 1;
    padding: 10px;
    resize: vertical;
    border: 1px solid #424b58;
    border-radius: 6px;
    outline: none;
    background: #111720;
    color: #d8e1ec;
    font-size: 12px;
    font-weight: 700;
    line-height: 19px;
  }

  .preset-prompt-input:focus {
    border-color: var(--user-accent);
    box-shadow: 0 0 0 2px rgba(var(--user-accent-rgb), 0.11);
  }

  .preset-prompt-actions {
    display: flex;
    margin-top: 2px;
    justify-content: flex-end;
    gap: 7px;
  }

  .prompt-library-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(250px, 300px));
    gap: 8px;
  }

  .prompt-library-item {
    display: flex;
    min-width: 0;
    min-height: 94px;
    padding: 9px 10px;
    flex-direction: column;
    border: 1px solid #39424d;
    border-radius: 7px;
    background: #1a1f27;
  }

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

  .prompt-library-item-title {
    min-width: 0;
    overflow: hidden;
    color: #eef3f1;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .prompt-library-item-date {
    flex: 0 0 auto;
    color: #737e8b;
    font-size: 9px;
    line-height: 16px;
  }

  .prompt-library-item-content {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    color: #9ba6b2;
    font-size: 11px;
    line-height: 16px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .prompt-library-item-actions {
    margin-top: auto;
    padding-top: 6px;
  }

  .prompt-library-item .prompt-library-use-btn,
  .prompt-library-item .prompt-library-action-btn {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 11px;
  }

  .prompt-library-pager {
    display: flex;
    grid-column: 1 / -1;
    margin-top: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .prompt-library-page-info {
    margin-right: 4px;
    color: #7f8996;
    font-size: 11px;
    font-weight: 700;
  }

  .prompt-library-pager .prompt-library-action-btn {
    min-height: 28px;
    padding: 4px 10px;
    font-size: 11px;
  }

  .prompt-library-empty {
    display: grid;
    min-height: 270px;
    grid-column: 1 / -1;
    place-items: center;
    color: #7f8996;
    font-size: 12px;
    font-weight: 600;
  }

  .prompt-library-saved-panel .prompt-library-search {
    max-width: 300px;
    margin-top: 0;
  }

  .prompt-library-empty.compact {
    min-height: 90px;
  }

  html[data-pc-theme="minimal-light"] .prompt-library-editor,
  html[data-pc-theme="minimal-light"] .prompt-library-create-panel,
  html[data-pc-theme="minimal-light"] .prompt-library-saved-panel {
    border-color: #dde3e9;
    background: #f8fafb;
  }

  html[data-pc-theme="minimal-light"] .preset-column {
    border-color: #d8e0e8;
    background: #ffffff;
  }

  html[data-pc-theme="minimal-light"] .preset-column-title {
    color: #64748b;
  }

  html[data-pc-theme="minimal-light"] .preset-list-button {
    color: #334155;
  }

  html[data-pc-theme="minimal-light"] .preset-list-button:hover {
    border-color: rgba(47, 124, 246, 0.36);
    background: rgba(47, 124, 246, 0.08);
    color: #1453c8;
  }

  html[data-pc-theme="minimal-light"] .preset-list-button.active {
    border-color: #2f7cf6;
    background: #2f7cf6;
    color: #ffffff;
  }

  html[data-pc-theme="minimal-light"] .prompt-library-guide {
    border-color: #dde3e9;
    background: #f8fafb;
    color: #263447;
  }

  html[data-pc-theme="minimal-light"] .prompt-library-guide i {
    background-image: linear-gradient(to right, #c8d3df 45%, transparent 0);
  }

  html[data-pc-theme="minimal-light"] .prompt-library-editor-title,
  html[data-pc-theme="minimal-light"] .prompt-library-item-title,
  html[data-pc-theme="minimal-light"] .prompt-library-saved-panel .prompt-library-list-title,
  html[data-pc-theme="minimal-light"] .preset-prompt-name {
    color: #1d2732;
  }

  html[data-pc-theme="minimal-light"] .prompt-library-content-input,
  html[data-pc-theme="minimal-light"] .preset-prompt-title-input,
  html[data-pc-theme="minimal-light"] .preset-prompt-input {
    border-color: #cfd7e0;
    background: #ffffff;
    color: #25313d;
  }

  html[data-pc-theme="minimal-light"] .prompt-library-item {
    border-color: #dde3e9;
    background: #ffffff;
  }

  html[data-pc-theme="minimal-light"] .prompt-library-item-content,
  html[data-pc-theme="minimal-light"] .prompt-library-subtitle,
  html[data-pc-theme="minimal-light"] .preset-prompt-group-title,
  html[data-pc-theme="minimal-light"] .prompt-library-list-title,
  html[data-pc-theme="minimal-light"] .prompt-library-page-info {
    color: #667383;
  }

  html[data-pc-theme="minimal-light"] .prompt-library-primary-btn,
  html[data-pc-theme="minimal-light"] .prompt-library-use-btn {
    color: #ffffff;
  }

  html[data-pc-theme="minimal-light"] .prompt-library-secondary-btn,
  html[data-pc-theme="minimal-light"] .prompt-library-action-btn {
    border-color: #cfd7e0;
    background: #ffffff;
    color: #435161;
  }

  html[data-pc-theme="minimal-light"] .prompt-library-action-btn.danger {
    color: #bc5656;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .login-btn,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .password-action-btn,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .logout-btn,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .model-tab,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .mode-tab,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .composition-tab,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .soft-tab,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .batch-tab,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-tag,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-tool-btn,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .admin-btn.secondary,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .history-download-link {
    border: 1px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #334155;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .login-btn:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .password-action-btn:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .logout-btn:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .model-tab:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .mode-tab:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .composition-tab:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .soft-tab:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .batch-tab:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-tag:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-tool-btn:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .admin-btn.secondary:hover,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .history-download-link:hover {
    border-color: #93b4dc;
    background: #f1f7ff;
    color: #1453c8;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .model-tab.active,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .mode-tab.active,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .composition-tab.active,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .soft-tab.active,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .batch-tab.active,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .prompt-tag.active {
    border-color: #2563eb;
    background: #2f7df1;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .generate-btn,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .generate-btn.is-generating {
    border: 1px solid #1d4ed8;
    background: linear-gradient(90deg, #2f7df1 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .generate-btn .generate-main,
  html[data-pc-theme="minimal-light"] body:not(.design-v2) .generate-btn.is-generating .generate-main {
    color: #ffffff;
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .generate-btn:not(:disabled):hover {
    border-color: #1e40af;
    background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
  }

  html[data-pc-theme="minimal-light"] body:not(.design-v2) .generate-btn:disabled {
    border-color: #dce2e9;
    background: #e8ecf1;
    color: #98a3b0;
    box-shadow: none;
    transform: none;
  }
}

/* Keep editor color swatches independent from the dark modal button treatment. */
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-backdrop .preview-color-swatch {
  border: 1px solid rgba(15, 23, 42, 0.42) !important;
  border-radius: 4px !important;
  background: var(--swatch-color, #ff3b4f) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42) !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-backdrop .preview-color-swatch[data-preview-color="#ffffff"] {
  border-color: #64748b !important;
  box-shadow: inset 0 0 0 1px #ffffff !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-backdrop .preview-color-swatch:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-backdrop .preview-color-swatch.active {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(37, 99, 235, 0.88), inset 0 0 0 1px rgba(255, 255, 255, 0.48) !important;
}

/* Complete dark treatment for the three 3D workspaces. */
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-mode-switch,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-layout-switch,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-core-panel,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-model-panel {
  border-color: #303842;
  background: #11151a;
  color: #e9edf2;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-mode-btn,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-layout-btn {
  border-color: #3b454f;
  background: #1a201f;
  color: #d9dee4;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-layout-switch span,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-quality-controls label,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-note,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-subtitle,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-view-meta span,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-history-info span {
  color: #929daa;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-original-preview,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-manual-preview,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-empty,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-model-preview,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-history-preview {
  border-color: #39434e;
  background: #0f1318;
  color: #8995a3;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-model-preview.is-image-fallback {
  background: #0f1318;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-view-item,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-history-item {
  border-color: #303842;
  background: #151a20;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-view-item img,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-history-preview img,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-model-preview model-viewer,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-history-preview model-viewer {
  background: #0f1318;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-view-meta strong,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-history-info strong {
  color: #eef2f6;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-quality-controls select {
  border-color: #3a444f;
  background: #151a20;
  color: #e7ebef;
  color-scheme: dark;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-preview-badge {
  border-color: #3b4652;
  background: rgba(18, 23, 29, 0.92);
  color: #aeb8c3;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-history-preview {
  border-bottom-color: #303842;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .prompt-card .prompt-head {
  width: 100%;
  justify-content: flex-start;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .prompt-card .prompt-tags {
  display: flex;
  width: 100%;
  margin: 0;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .prompt-card .prompt-tag-wrap {
  margin-right: 0;
  margin-bottom: 0;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .prompt-card .prompt-tag {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .generation-count-control {
  align-items: flex-start;
  text-align: left;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .generation-count-control .batch-label {
  width: auto;
  margin: 0;
  color: #c5cdd7;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: left;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .generation-count-control .batch-buttons {
  justify-content: flex-start;
}

@media (min-width: 900px) and (max-width: 1180px) {
  .prompt-library-layout {
    grid-template-columns: 1fr;
  }

  .preset-prompt-list {
    grid-template-columns: 1fr;
  }

  .preset-column {
    min-height: auto;
  }

  .preset-detail-input-row {
    grid-template-columns: 1fr;
  }

  .prompt-library-guide {
    grid-template-columns: 1fr;
    row-gap: 10px;
    padding: 14px 16px;
  }

  .prompt-library-guide i {
    display: none;
  }
}

@media (min-width: 1181px) and (max-width: 1500px) {
  .prompt-library-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 899px) {
  html {
    scroll-behavior: smooth;
  }

  body {
    display: block;
    min-width: 0;
    overflow-x: hidden;
    background: #eef2f5;
    font-size: 14px;
  }

  .web-panel {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #eef2f5;
  }

  .desktop-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    width: 100%;
    min-height: 0;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    flex-direction: column;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid #d7e1ec;
    background: rgba(244, 248, 252, 0.96);
    backdrop-filter: blur(14px);
  }

  .desktop-brand {
    display: flex;
    min-height: 38px;
    padding: 0;
    align-items: center;
    gap: 8px;
    border-bottom: 0;
  }

  .desktop-brand-logo {
    width: 54px;
    height: 32px;
    object-fit: contain;
  }

  .desktop-brand-name {
    color: #111827;
    font-size: 18px;
    line-height: 22px;
  }

  .desktop-brand-tagline {
    color: #64748b;
    font-size: 10px;
    line-height: 14px;
  }

  .desktop-brand-text-only {
    padding-left: 12px;
  }

  .desktop-nav {
    display: flex;
    margin: 0 -12px;
    padding: 0 12px 2px;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .desktop-nav::-webkit-scrollbar {
    display: none;
  }

  .desktop-nav-section,
  .desktop-nav-item-disabled {
    display: none;
  }

  .desktop-nav-item {
    display: inline-flex;
    min-height: 36px;
    padding: 0 13px;
    flex: 0 0 auto;
    align-items: center;
    border: 1px solid #d3dae6;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
  }

  .desktop-nav-item.active {
    border-color: #2f7cf6;
    background: #2f7cf6;
    color: #ffffff;
  }

  .desktop-sidebar-footer,
  .theme-picker {
    display: none;
  }

  .desktop-content {
    width: 100%;
    padding: 12px;
  }

  .desktop-topbar {
    display: none;
  }

  .panel-card {
    margin-bottom: 12px;
    padding: 14px;
    border-color: #d7e1ec;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
  }

  .account-panel {
    gap: 12px;
  }

  .brand-head {
    display: none;
  }

  .account-row,
  .account-summary,
  .account-actions {
    width: 100%;
    gap: 8px;
  }

  .account-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .account-summary {
    align-items: flex-start;
  }

  .account-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .text-input,
  .login-btn,
  .password-action-btn,
  .logout-btn {
    min-height: 42px;
    font-size: 14px;
  }

  .login-visual {
    display: none;
  }

  .creation-flow {
    display: block;
    overflow: hidden;
    border: 1px solid #d7e1ec;
    border-radius: 10px;
    background: #ffffff;
  }

  .creation-flow > .panel-card {
    margin: 0;
    padding: 16px 14px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .creation-flow > .panel-card + .panel-card {
    border-top: 1px solid #e2e8f0;
  }

  .workflow-step-head {
    display: flex;
    margin-bottom: 14px;
    align-items: center;
    gap: 8px;
  }

  .workflow-step-index {
    display: inline-grid;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #eaf2ff;
    color: #2f7cf6;
    font-size: 11px;
    font-weight: 900;
  }

  .workflow-step-head .section-title {
    margin: 0;
    font-size: 17px;
    line-height: 24px;
  }

  .workflow-step-note {
    margin-left: auto;
    color: #64748b;
    font-size: 12px;
    line-height: 18px;
    text-align: right;
  }

  .model-control-grid,
  .reference-workspace-layout,
  .prompt-composer-layout,
  .generation-submit-stack,
  .prompt-library-layout,
  .three-d-layout,
  .three-d-manual-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .workflow-control-block,
  .reference-source-panel {
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .workflow-control-block + .workflow-control-block {
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
  }

  .batch-label,
  .prompt-label {
    width: auto;
    margin: 0 0 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
  }

  .model-tabs,
  .generation-mode-buttons,
  .composition-buttons,
  .batch-buttons,
  .source-tabs,
  .prompt-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .model-tab,
  .mode-tab,
  .composition-tab,
  .batch-tab,
  .soft-tab,
  .prompt-tag,
  .prompt-tool-btn,
  .three-d-mode-btn,
  .three-d-layout-btn {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .composition-tab {
    flex: 1 1 150px;
  }

  .mode-tab {
    flex: 1 1 118px;
  }

  .batch-tab {
    width: 42px;
    flex: 0 0 42px;
  }

  .batch-count-input {
    width: 64px;
    min-height: 38px;
  }

  .mode-note,
  .billing-status {
    color: #64748b;
    font-size: 12px;
    line-height: 18px;
  }

  .reference-grid {
    display: flex;
    min-height: 98px;
    padding: 10px;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
  }

  .reference-thumb,
  .reference-placeholder,
  .add-reference {
    width: clamp(72px, 21vw, 94px);
    height: clamp(72px, 21vw, 94px);
    margin: 0;
  }

  .add-reference {
    line-height: 1;
  }

  .prompt-card .prompt-head {
    display: block;
  }

  .prompt-input {
    min-height: 180px;
    font-size: 14px;
    line-height: 24px;
  }

  .prompt-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .generation-submit-stack {
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
  }

  .generation-summary {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .generate-btn {
    width: 100%;
    min-height: 52px;
    border-radius: 9px;
    font-size: 17px;
  }

  .history-heading,
  .history-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .history-title {
    font-size: 17px;
    line-height: 24px;
  }

  .history-subtitle,
  .history-footer {
    color: #64748b;
    font-size: 12px;
    line-height: 18px;
  }

  .history-grid,
  .refine-source-grid,
  .refine-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
  }

  .history-item {
    width: auto;
    min-width: 0;
    aspect-ratio: 1 / 1;
  }

  .history-preview-btn,
  .history-item img {
    width: 100%;
    height: 100%;
  }

  .history-download-link {
    width: 100%;
    min-height: 40px;
  }

  .prompt-library-guide {
    display: none;
  }

  .three-d-mode-switch,
  .three-d-layout-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .three-d-input-toolbar {
    flex-wrap: wrap;
  }

  .three-d-input-toolbar > .three-d-upload {
    width: 100%;
    flex-basis: 100%;
  }

  .three-d-upload-panel {
    --three-d-preview-height: 280px;
    grid-template-rows: auto var(--three-d-preview-height);
  }

  .three-d-result-panel {
    min-width: 0;
  }

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

  .three-d-manual-preview {
    height: 220px;
  }

  .password-modal,
  .app-dialog,
  .material-library-modal,
  .image-preview-modal {
    width: calc(100vw - 24px);
    max-width: 520px;
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }

  .image-preview-stage {
    max-height: calc(100dvh - 220px);
  }
}

@media (min-width: 900px) {
  body:not(.auth-locked):not(.admin-mode) .account-panel {
    position: fixed;
    bottom: 76px;
    left: 18px;
    z-index: 42;
    display: block;
    width: 180px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary {
    display: grid;
    width: 100%;
    min-height: 0;
    padding: 11px;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    border: 1px solid #2d3540;
    border-radius: 8px;
    background: rgba(21, 25, 31, 0.96);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .summary-name {
    overflow: hidden;
    color: #f1f4f7;
    font-size: 14px;
    font-weight: 600;
    line-height: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .summary-meta {
    overflow: hidden;
    margin-top: 2px;
    color: var(--user-accent);
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .login-btn,
  body:not(.auth-locked):not(.admin-mode) .account-panel .password-action-btn,
  body:not(.auth-locked):not(.admin-mode) .account-panel .logout-btn {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 0 4px;
    border-color: #36404d;
    border-radius: 5px;
    background: #1b2027;
    color: #b8c1cc;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .login-btn:hover,
  body:not(.auth-locked):not(.admin-mode) .account-panel .password-action-btn:hover {
    border-color: rgba(var(--user-accent-rgb), 0.72);
    color: #ffffff;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .logout-btn:hover {
    border-color: #a64d59;
    color: #ffb3bd;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .user-recharge-notice:not(.hidden) {
    margin-top: 8px;
    padding: 8px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 16px;
  }

  html[data-pc-theme="minimal-light"] body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary {
    border-color: #d5dde6;
    background: rgba(248, 250, 252, 0.97);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  }

  html[data-pc-theme="minimal-light"] body:not(.auth-locked):not(.admin-mode) .account-panel .summary-name {
    color: #17202a;
  }
}

@media (min-width: 680px) and (max-width: 899px) {
  .desktop-content {
    padding: 16px;
  }

  .account-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
    align-items: center;
  }

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

  .workflow-control-block:nth-child(2) {
    padding-top: 0;
    border-top: 0;
  }

  .reference-workspace-layout {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .reference-source-panel {
    padding-right: 14px;
    border-right: 1px solid #e2e8f0;
  }

  .generation-submit-stack {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: center;
  }

  .history-grid,
  .refine-source-grid,
  .refine-history-grid {
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  }

  .three-d-view-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .desktop-content {
    padding: 10px;
  }

  .panel-card {
    padding: 12px;
  }

  .desktop-nav-item {
    min-height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }

  .account-actions {
    grid-template-columns: 1fr;
  }

  .workflow-step-note {
    display: none;
  }

  .model-tab,
  .mode-tab,
  .composition-tab,
  .soft-tab,
  .prompt-tag {
    flex: 1 1 100%;
  }

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

/* Premium sign-in experience. Scoped to the signed-out state only. */
body.auth-locked {
  min-height: 100vh;
  overflow: hidden;
  background: #090b0e;
}

body.auth-locked .web-panel {
  display: block;
  min-width: 0;
  min-height: 100vh;
  background: #090b0e;
}

body.auth-locked .desktop-content {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: 0 !important;
  place-items: center end;
  overflow: hidden;
  background-color: #0b0d10 !important;
  background-image: url("assets/login-atelier-bg.png") !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
}

body.auth-locked .desktop-content::before {
  position: absolute;
  inset: -3%;
  z-index: 0;
  background-image: url("assets/login-atelier-bg.png");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  content: "";
  pointer-events: none;
  transform: scale(1.01) translate3d(0, 0, 0);
  transform-origin: center center;
  animation: loginBackdropDrift 24s ease-in-out infinite alternate;
  will-change: transform;
}

body.auth-locked .desktop-content::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(4, 6, 9, 0.14);
  content: "";
  pointer-events: none;
}

@keyframes loginBackdropDrift {
  0% {
    transform: scale(1.015) translate3d(-0.65%, -0.35%, 0);
  }

  100% {
    transform: scale(1.09) translate3d(1.1%, 0.7%, 0);
  }
}

body.auth-locked .account-panel {
  position: relative;
  z-index: 1;
  display: grid !important;
  width: min(430px, calc(100vw - 64px));
  max-width: 430px;
  min-height: 0;
  margin: 0 clamp(42px, 6vw, 112px) 0 0;
  padding: 34px 38px 24px !important;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "brand"
    "form";
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  background: rgba(12, 15, 19, 0.86) !important;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(18px) saturate(112%);
  -webkit-backdrop-filter: blur(18px) saturate(112%);
}

body.auth-locked .account-panel::before {
  content: "FOOTWEAR DESIGN INTELLIGENCE";
  position: absolute;
  top: 37px;
  right: 38px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

body.auth-locked .account-panel .brand-head {
  position: static;
  grid-area: brand;
  display: flex;
  width: fit-content;
  margin: 0 0 38px;
  align-items: center;
  gap: 10px;
}

body.auth-locked .brand-logo-box {
  display: block;
  width: 58px;
  height: 38px;
}

body.auth-locked .brand-logo {
  width: 58px;
  height: 38px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

body.auth-locked .brand-copy {
  display: block;
}

body.auth-locked .brand-title {
  margin: 0;
  color: #ffffff !important;
  font-size: 21px;
  font-weight: 600;
  line-height: 25px;
}

body.auth-locked .brand-tagline {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 10px;
  font-weight: 400;
}

body.auth-locked .login-welcome-title {
  position: static;
  grid-area: title;
  width: auto;
  margin: 0;
  padding: 0 !important;
  transform: none;
  color: #ffffff !important;
  font-size: 34px;
  font-weight: 850;
  line-height: 44px;
  text-align: left !important;
}

body.auth-locked .account-status {
  position: static;
  grid-area: status;
  width: auto;
  margin: 0 0 24px;
  padding: 0 !important;
  transform: none;
  color: rgba(255, 255, 255, 0.56) !important;
  font-size: 15px;
  font-weight: 400;
  line-height: 22px;
  text-align: left !important;
}

body.auth-locked .account-status:empty {
  display: none !important;
}

body.auth-locked .account-row {
  position: static;
  grid-area: form;
  display: grid !important;
  width: 100%;
  margin: 0;
  padding: 0 !important;
  transform: none;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
}

body.auth-locked .account-panel .account-row .text-input {
  width: 100% !important;
  height: 46px;
  min-height: 46px !important;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 5px !important;
  outline: none;
  background: rgba(255, 255, 255, 0.065) !important;
  color: #ffffff !important;
  font-size: 14px;
  box-shadow: none !important;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

body.auth-locked .account-panel .account-row .text-input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

body.auth-locked .account-panel .account-row .text-input:focus {
  border-color: rgba(91, 159, 255, 0.9) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 0 0 3px rgba(47, 124, 246, 0.18) !important;
}

body.auth-locked .account-panel .account-row .remember-password-row {
  display: inline-flex;
  width: fit-content;
  margin: 1px 0 2px;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.64) !important;
  font-size: 12px;
  cursor: pointer;
}

body.auth-locked .remember-password-row input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #2f7cf6;
}

body.auth-locked .account-panel .account-row .login-btn {
  width: 100% !important;
  height: 44px;
  min-height: 44px !important;
  margin-top: 0;
  padding: 0 18px !important;
  border: 1px solid #4b8cff !important;
  border-radius: 5px !important;
  background: #2f7cf6 !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  box-shadow: 0 12px 28px rgba(22, 92, 214, 0.28) !important;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

body.auth-locked .account-panel .account-row .login-btn:hover {
  border-color: #70a4ff !important;
  background: #3b86ff !important;
  transform: translateY(-1px);
}

body.auth-locked .account-panel .account-row .login-btn:active {
  transform: translateY(0);
}

body.auth-locked .login-visual,
body.auth-locked .account-summary,
body.auth-locked .user-recharge-notice {
  display: none !important;
}

@media (max-width: 900px) {
  body.auth-locked {
    overflow: auto;
  }

  body.auth-locked .desktop-content {
    min-height: 100svh;
    padding: 24px !important;
    place-items: end center;
    background-position: 35% center;
  }

  body.auth-locked .desktop-content::after {
    background: rgba(4, 6, 9, 0.32);
  }

  body.auth-locked .desktop-content::before {
    background-position: 34% center;
    animation-duration: 30s;
  }

  body.auth-locked .account-panel {
    width: min(430px, 100%);
    max-width: 430px;
    margin: 0;
    padding: 25px 24px 22px !important;
    background: rgba(11, 14, 18, 0.9) !important;
  }

  body.auth-locked .account-panel .brand-head {
    margin-bottom: 30px;
  }
}

@media (max-width: 540px) {
  body.auth-locked .desktop-content {
    padding: 12px !important;
    background-position: 34% center;
  }

  body.auth-locked .account-panel {
    width: 100%;
    padding: 23px 20px 20px !important;
  }

  body.auth-locked .account-panel::before {
    top: 28px;
    right: 20px;
    max-width: 126px;
    text-align: right;
  }

  body.auth-locked .account-panel .brand-head {
    margin-bottom: 25px;
  }

  body.auth-locked .login-welcome-title {
    font-size: 24px;
    line-height: 32px;
  }

  body.auth-locked .account-status {
    margin-bottom: 20px;
  }
}

/* Production dark workspace for signed-in users. Admin and sign-in screens stay isolated. */
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) {
  --page-bg: #0c0e11;
  --panel-bg: #101318;
  --card-bg: #15191f;
  --card-border: #282e37;
  --input-bg: #0f1217;
  --button-bg: #1a1f27;
  --button-border: #343c48;
  --text: #edf1f5;
  --muted: #929dab;
  background: #0c0e11;
  color: #edf1f5;
  font-family: "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", "Source Han Sans SC", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) button,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) input,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) textarea,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) select {
  font-family: inherit;
  letter-spacing: 0;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .web-panel,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-content {
  background: #0c0e11;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-sidebar,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-topbar {
  border-color: #242a32;
  background: #101318;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .panel-card,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .creation-flow,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .history-card,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-library-card {
  border-color: #282e37;
  background: #15191f;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-brand-tagline {
  color: #7f8996;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-nav-section {
  margin-top: 18px;
  color: #707b88;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  letter-spacing: 0;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-nav-item {
  min-height: 38px;
  color: #a8b1bd;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-nav-item:hover {
  border-color: #303744;
  background: #181d24;
  color: #f4f6f8;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-topbar-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-topbar-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-topbar-meta,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .workflow-step-note,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .history-subtitle,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .history-footer {
  color: #828d9a;
  font-size: 12px;
  font-weight: 400;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .section-title,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .history-title,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-section-title {
  color: #f1f4f7;
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: 0;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .workflow-step-index {
  font-size: 11px;
  font-weight: 700;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .batch-label,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-label {
  color: #b8c0ca;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .mode-note,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .billing-status {
  color: #8994a2;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .model-tab,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .mode-tab,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .composition-tab,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .batch-tab,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .soft-tab,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-tool-btn,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .login-btn,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .password-action-btn,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .logout-btn {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .text-input,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-input,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .batch-count-input {
  border-color: #303743;
  background: #0f1217;
  color: #e8edf2;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .text-input::placeholder,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-input::placeholder {
  color: #687482;
  font-weight: 400;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .generate-btn {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

/* Refined sign-in typography: calm hierarchy instead of dashboard-heavy bold. */
body.auth-locked .account-panel {
  font-family: "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", "Source Han Sans SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.auth-locked .account-panel::before {
  font-weight: 600;
  letter-spacing: 0;
}

body.auth-locked .brand-title {
  font-weight: 700;
  letter-spacing: 0;
}

body.auth-locked .brand-tagline {
  font-weight: 400;
  letter-spacing: 0;
}

body.auth-locked .login-welcome-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0;
}

body.auth-locked .account-status {
  color: rgba(255, 255, 255, 0.62) !important;
  font-weight: 400;
  letter-spacing: 0;
}

body.auth-locked .account-panel .account-row .text-input {
  font-weight: 400;
  letter-spacing: 0;
}

body.auth-locked .account-panel .account-row .text-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-weight: 400;
}

body.auth-locked .account-panel .account-row .remember-password-row {
  font-weight: 400;
  letter-spacing: 0;
}

body.auth-locked .account-panel .account-row .login-btn {
  font-weight: 600 !important;
  letter-spacing: 0;
}

@media (max-height: 680px) and (min-width: 541px) {
  body.auth-locked .account-panel {
    padding-top: 24px !important;
    padding-bottom: 22px !important;
  }

  body.auth-locked .account-panel .brand-head {
    margin-bottom: 24px;
  }

  body.auth-locked .account-status {
    margin-bottom: 18px;
  }
}

@media (max-width: 899px) {
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .desktop-sidebar {
    position: sticky !important;
    top: 0 !important;
    min-height: 0 !important;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }

  .desktop-brand {
    width: 100%;
    justify-content: flex-start;
  }

  .desktop-nav {
    position: fixed !important;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 80;
    display: grid !important;
    margin: 0 !important;
    padding: 8px !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    overflow: visible !important;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(16px);
  }

  .desktop-nav-item {
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 0 4px !important;
    justify-content: center;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: #64748b !important;
    font-size: 12px !important;
    line-height: 16px !important;
    text-align: center;
    white-space: normal !important;
  }

  .desktop-nav-item:nth-of-type(n+6) {
    display: none !important;
  }

  .desktop-nav-item.active {
    background: #2f7cf6 !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(47, 124, 246, 0.24);
  }

  .desktop-content {
    padding: 12px 12px 0 !important;
  }

  .account-panel {
    display: block !important;
    padding: 0 !important;
    overflow: hidden;
    border: 1px solid #dbe5ef !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  }

  .account-panel .account-summary {
    display: grid !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 14px !important;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px !important;
    align-items: stretch !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%) !important;
    box-shadow: none !important;
  }

  .account-panel .account-summary > div:first-child {
    display: grid;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
  }

  .account-panel .account-summary > div:first-child::before {
    content: "我的";
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px;
    background: #2f7cf6;
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
  }

  .account-panel .summary-name {
    min-width: 0;
    color: #0f172a !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    line-height: 24px !important;
    writing-mode: horizontal-tb !important;
    word-break: keep-all;
  }

  .account-panel .summary-meta {
    min-width: 0;
    margin-top: 2px !important;
    color: #059669 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 18px !important;
    writing-mode: horizontal-tb !important;
    word-break: normal;
  }

  .account-panel .account-actions {
    display: grid !important;
    width: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .account-panel .login-btn,
  .account-panel .password-action-btn,
  .account-panel .logout-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    padding: 0 8px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    color: #1e293b !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    box-shadow: none !important;
  }

  .account-panel .account-row {
    display: grid !important;
    padding: 14px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .account-panel .account-row.hidden,
  .account-panel .account-summary.hidden,
  .account-panel .account-status.hidden,
  .account-panel .login-welcome-title.hidden {
    display: none !important;
  }

  .account-panel .text-input {
    width: 100% !important;
    min-height: 44px !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    color: #0f172a !important;
  }

  .remember-password-row {
    color: #475569 !important;
  }

  .login-welcome-title,
  .account-status {
    padding: 0 14px 12px;
    color: #64748b !important;
    text-align: left !important;
  }

  .user-workspace {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 12px 0 0 !important;
  }

  .creation-flow {
    border-radius: 18px !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  }

  .model-tab,
  .mode-tab,
  .composition-tab,
  .batch-tab,
  .soft-tab,
  .prompt-tool-btn {
    border-color: #cbd5e1 !important;
    background: #ffffff !important;
    color: #334155 !important;
  }

  .model-tab.active,
  .mode-tab.active,
  .composition-tab.active,
  .batch-tab.active,
  .soft-tab.active {
    border-color: #2f7cf6 !important;
    background: #2f7cf6 !important;
    color: #ffffff !important;
  }

  .mode-note,
  .billing-status {
    padding: 9px 10px;
    border-radius: 10px;
    background: #f8fafc;
  }

  .reference-card,
  .prompt-card,
  .history-card,
  .prompt-library-card {
    border-radius: 18px !important;
  }
}

@media (max-width: 420px) {
  .desktop-nav {
    left: 8px;
    right: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .desktop-nav-item {
    min-height: 42px !important;
    font-size: 11px !important;
  }

  .account-panel .account-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .account-panel .login-btn,
  .account-panel .password-action-btn,
  .account-panel .logout-btn {
    font-size: 12px !important;
  }
}

/* Keep the signed-out layout above the authenticated mobile workspace rules. */
body.auth-locked .desktop-sidebar,
body.auth-locked .desktop-topbar,
body.auth-locked .desktop-nav,
body.auth-locked .user-workspace,
body.auth-locked .theme-picker,
body.auth-locked .desktop-sidebar-footer {
  display: none !important;
}

@media (max-width: 900px) {
  body.auth-locked .desktop-content {
    min-height: 100svh !important;
    padding: 24px !important;
    place-items: end center !important;
    background-color: #0b0d10 !important;
    background-image: url("assets/login-atelier-bg.png") !important;
    background-position: 35% center !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
  }

  body.auth-locked .account-panel {
    position: relative !important;
    display: grid !important;
    width: min(410px, 100%) !important;
    max-width: 410px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 25px 24px 20px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas: "brand" "form" !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    background: rgba(11, 14, 18, 0.9) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42) !important;
  }

  body.auth-locked .account-panel .brand-head {
    position: static !important;
    display: flex !important;
    grid-area: brand;
    margin: 0 0 30px !important;
  }

  body.auth-locked .account-panel .account-row {
    position: static !important;
    display: grid !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  body.auth-locked .login-welcome-title,
  body.auth-locked .account-status {
    position: static !important;
    width: auto !important;
    transform: none !important;
    text-align: left !important;
  }

  body.auth-locked .login-welcome-title {
    display: block !important;
    grid-area: title;
    margin: 0 !important;
    padding: 0 !important;
    color: #ffffff !important;
  }

  body.auth-locked .account-status {
    display: block !important;
    grid-area: status;
    margin: 0 0 20px !important;
    padding: 0 !important;
    color: rgba(255, 255, 255, 0.56) !important;
  }

  body.auth-locked .account-panel .account-row .text-input {
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.065) !important;
    color: #ffffff !important;
  }

  body.auth-locked .account-panel .account-row .login-btn {
    min-height: 44px !important;
    border-color: #4b8cff !important;
    border-radius: 5px !important;
    background: #2f7cf6 !important;
    color: #ffffff !important;
  }
}

@media (max-width: 540px) {
  body.auth-locked .desktop-content {
    padding: 12px !important;
    background-position: 34% center !important;
  }

  body.auth-locked .account-panel {
    width: 100% !important;
    padding: 22px 20px 18px !important;
  }

  body.auth-locked .account-panel .brand-head {
    margin-bottom: 26px !important;
  }

  html[data-pc-theme] body.auth-locked .account-panel .account-row .text-input {
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: rgba(255, 255, 255, 0.065) !important;
    color: #ffffff !important;
  }
}

@media (max-width: 899px) {
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode),
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .web-panel,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-content {
    background: #0c0e11 !important;
    color: #edf1f5 !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-sidebar {
    border-color: #272d36 !important;
    background: rgba(16, 19, 24, 0.97) !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-brand-logo {
    filter: brightness(0) invert(1);
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-brand-name {
    color: #f1f4f7 !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-brand-tagline {
    color: #7f8996 !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-nav-item {
    border-color: #303743 !important;
    background: #171b21 !important;
    color: #aab3bf !important;
    font-weight: 500 !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-nav-item.active {
    border-color: var(--user-accent) !important;
    background: var(--user-accent) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(var(--user-accent-rgb), 0.18) !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .panel-card,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .account-panel,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .creation-flow,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .reference-card,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-card,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .history-card,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-library-card {
    border-color: #282e37 !important;
    background: #15191f !important;
    color: #edf1f5 !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2) !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary {
    background: #13171c !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .account-panel .summary-name,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .section-title,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .history-title {
    color: #f1f4f7 !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .mode-note,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .billing-status {
    background: #11151a !important;
    color: #8994a2 !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .text-input,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-input,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .batch-count-input {
    border-color: #303743 !important;
    background: #0f1217 !important;
    color: #e8edf2 !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .model-tab,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .mode-tab,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .composition-tab,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .batch-tab,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .soft-tab,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-tool-btn,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .password-action-btn,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .logout-btn {
    border-color: #343c48 !important;
    background: #1a1f27 !important;
    color: #b8c1cc !important;
    font-weight: 500 !important;
  }

  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .model-tab.active,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .mode-tab.active,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .composition-tab.active,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .batch-tab.active,
  html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .soft-tab.active {
    border-color: var(--user-accent) !important;
    background: var(--user-accent) !important;
    color: #ffffff !important;
  }
}

@media (min-width: 900px) {
  html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .account-panel {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}

/* Sidebar account identity and the secondary Photoshop entry on sign-in. */
body.auth-locked .login-plugin-entry {
  display: inline-flex;
  width: 100%;
  min-height: 32px;
  margin-top: 4px;
  padding: 9px 4px 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 400;
  box-shadow: none;
  transition: color 160ms ease;
}

body.auth-locked .login-plugin-entry:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: transparent;
  color: #ffffff;
  transform: none;
}

body.auth-locked .login-plugin-entry .plugin-download-entry-arrow {
  color: #6ea3ff;
  font-size: 14px;
}

@media (min-width: 900px) {
  body:not(.auth-locked):not(.admin-mode) .account-panel {
    bottom: 18px;
    width: 194px;
    padding-top: 15px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel::before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: #2a3039;
    content: "";
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary {
    position: relative;
    overflow: visible;
    padding: 0;
    gap: 9px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary > div:first-child {
    position: relative;
    display: grid;
    min-height: 32px;
    padding-right: 20px;
    padding-left: 20px;
    align-content: center;
    justify-items: stretch;
    text-align: left;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary > div:first-child::before {
    display: none;
    content: none;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .summary-name {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .summary-meta {
    width: 100%;
    margin-top: 1px;
    font-size: 10px;
    font-weight: 400;
    line-height: 15px;
    text-align: left;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-actions {
    position: relative;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding-top: 2px;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .login-btn,
  body:not(.auth-locked):not(.admin-mode) .account-panel .password-action-btn,
  body:not(.auth-locked):not(.admin-mode) .account-panel .logout-btn {
    position: relative;
    min-height: 28px;
    padding: 0 5px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #a4afbc;
    font-size: 11px;
    font-weight: 500;
    line-height: 28px;
    white-space: nowrap;
    box-shadow: none;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-actions .login-btn:first-child {
    border: 0;
    background: transparent;
    color: #a4afbc;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-actions .login-btn + .login-btn::before {
    position: absolute;
    top: 7px;
    bottom: 7px;
    left: 0;
    width: 1px;
    background: #303640;
    content: "";
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-actions .login-btn:hover {
    border: 0;
    background: rgba(255, 255, 255, 0.055);
    color: #ffffff;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-actions .logout-btn:hover {
    border: 0;
    background: rgba(255, 255, 255, 0.055);
    color: #ffffff;
  }

  html[data-pc-theme="minimal-light"] body:not(.auth-locked):not(.admin-mode) .account-panel::before {
    background: #d8e0e8;
  }

html[data-pc-theme="minimal-light"] body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary {
    background: transparent;
    box-shadow: none;
  }
}

/* Launch sign-in: compact frosted glass, scoped away from the signed-in workspace. */
body.auth-locked .account-panel {
  isolation: isolate;
  width: min(374px, calc(100vw - 48px));
  max-width: 374px;
  padding: 30px 32px 24px !important;
  border-color: rgba(219, 233, 255, 0.25) !important;
  border-radius: 7px !important;
  background: linear-gradient(145deg, rgba(109, 139, 174, 0.34), rgba(54, 67, 88, 0.42)) !important;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.13) !important;
  backdrop-filter: blur(26px) saturate(118%);
  -webkit-backdrop-filter: blur(26px) saturate(118%);
}

body.auth-locked .account-panel::before,
body.auth-locked .account-panel::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(220, 235, 255, 0.16);
  border-radius: 7px;
  background: rgba(133, 166, 202, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  content: "";
  pointer-events: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.auth-locked .account-panel::before {
  top: -24px;
  left: 34px;
  width: 118px;
  height: 46px;
}

body.auth-locked .account-panel::after {
  right: -24px;
  bottom: 40px;
  width: 54px;
  height: 54px;
}

body.auth-locked .account-panel .brand-head {
  margin: 0 0 28px;
  gap: 8px;
}

body.auth-locked .brand-logo-box,
body.auth-locked .brand-logo {
  width: 50px;
  height: 32px;
}

body.auth-locked .brand-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 22px;
}

body.auth-locked .brand-tagline {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.58) !important;
  font-size: 9px;
  line-height: 13px;
}

body.auth-locked .account-row {
  gap: 11px !important;
}

body.auth-locked .login-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

body.auth-locked .login-field-label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 500;
  line-height: 14px;
}

body.auth-locked .account-panel .account-row .text-input {
  height: 40px;
  min-height: 40px !important;
  padding: 0 13px;
  border-color: rgba(225, 237, 255, 0.2) !important;
  border-radius: 5px !important;
  background: rgba(235, 244, 255, 0.18) !important;
  font-size: 13px;
}

body.auth-locked .account-panel .account-row .text-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

body.auth-locked .account-panel .account-row .text-input:focus {
  border-color: rgba(207, 229, 255, 0.82) !important;
  background: rgba(239, 247, 255, 0.23) !important;
  box-shadow: 0 0 0 3px rgba(112, 166, 226, 0.18) !important;
}

body.auth-locked .account-panel .account-row .remember-password-row {
  margin: 0;
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 10px;
}

body.auth-locked .remember-password-row input {
  width: 13px;
  height: 13px;
  accent-color: #dbeaff;
}

body.auth-locked .account-panel .account-row .login-btn {
  height: 40px;
  min-height: 40px !important;
  border-color: rgba(230, 240, 255, 0.32) !important;
  border-radius: 5px !important;
  background: rgba(234, 243, 255, 0.9) !important;
  color: #26364a !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-shadow: 0 10px 24px rgba(16, 31, 52, 0.2) !important;
}

body.auth-locked .account-panel .account-row .login-btn:hover {
  border-color: rgba(255, 255, 255, 0.55) !important;
  background: #f4f8ff !important;
}

body.auth-locked .login-plugin-entry {
  min-height: 28px;
  margin-top: 2px;
  padding-top: 8px;
  border-top-color: rgba(229, 240, 255, 0.16);
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

body.auth-locked .login-plugin-entry .plugin-download-entry-arrow {
  color: rgba(231, 241, 255, 0.84);
  font-size: 12px;
}

@media (max-width: 540px) {
  body.auth-locked .account-panel {
    width: min(360px, 100%) !important;
    padding: 27px 24px 20px !important;
  }

  body.auth-locked .account-panel::before {
    left: 24px;
    width: 96px;
  }

  body.auth-locked .account-panel::after {
    right: -8px;
  }

  body.auth-locked .account-panel .brand-head {
    margin-bottom: 24px !important;
  }
}

/* CodePen-inspired sign-in form without the surrounding floating squares. */
body.auth-locked .account-panel {
  display: block !important;
  width: min(360px, calc(100vw - 48px));
  max-width: 360px;
  padding: 40px 38px 30px !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 10px !important;
  background: rgba(145, 174, 207, 0.2) !important;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(18px) saturate(112%);
  -webkit-backdrop-filter: blur(18px) saturate(112%);
}

body.auth-locked .account-panel::before,
body.auth-locked .account-panel::after {
  display: none !important;
  content: none !important;
}

body.auth-locked .account-panel .login-brand-head {
  display: block !important;
  width: 100%;
  margin: 0 0 28px !important;
}

body.auth-locked .login-brand-title {
  margin: 0;
  color: #ffffff;
  font-family: "El Messiri", "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 650;
  line-height: 24px;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.auth-locked .account-row {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  margin: 0 !important;
  transform: none !important;
  gap: 14px !important;
}

body.auth-locked .login-field {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

body.auth-locked .login-field-label {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 38px;
  padding: 0 3px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.72);
  font-family: "El Messiri", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  pointer-events: none;
  transition: top 150ms ease, transform 150ms ease, font-size 150ms ease, color 150ms ease;
}

body.auth-locked .login-field:focus-within .login-field-label,
body.auth-locked .login-field:has(.text-input:not(:placeholder-shown)) .login-field-label {
  top: 0;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.94);
  font-size: 9px;
}

body.auth-locked .account-panel .account-row .text-input {
  height: 42px;
  min-height: 42px !important;
  padding: 0 42px 0 38px;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.19) !important;
  color: #ffffff !important;
  font-family: "El Messiri", "Segoe UI", sans-serif;
  font-size: 11px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06) !important;
}

body.auth-locked .login-field-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 2;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

body.auth-locked .password-visibility-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 3;
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
}

body.auth-locked .password-visibility-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.auth-locked .password-eye {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.auth-locked .password-eye-hide,
body.auth-locked .password-visibility-btn.is-visible .password-eye-show {
  display: none;
}

body.auth-locked .password-visibility-btn.is-visible .password-eye-hide {
  display: block;
}

body.auth-locked .account-panel .account-row .text-input::placeholder {
  color: transparent;
}

body.auth-locked .account-panel .account-row .text-input:focus {
  border-color: rgba(255, 255, 255, 0.56) !important;
  background: rgba(255, 255, 255, 0.23) !important;
  box-shadow: 0 0 0 3px rgba(216, 232, 255, 0.12) !important;
}

body.auth-locked .account-panel .account-row .remember-password-row {
  margin: -2px 0 0;
  color: rgba(255, 255, 255, 0.82) !important;
  font-family: "PingFang SC", "Microsoft YaHei UI", sans-serif;
  font-size: 11px;
  font-weight: 400;
}

body.auth-locked .account-panel .account-row .login-btn {
  width: 92px !important;
  height: 36px;
  min-height: 36px !important;
  justify-self: start;
  padding: 0 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-radius: 15px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: #28384c !important;
  font-family: "PingFang SC", "Microsoft YaHei UI", sans-serif;
  font-size: 13px !important;
  font-weight: 500 !important;
  box-shadow: 0 8px 18px rgba(16, 30, 48, 0.16) !important;
}

body.auth-locked .account-panel .account-row .login-btn:hover {
  border-color: rgba(255, 255, 255, 0.7) !important;
  background: #ffffff !important;
}

body.auth-locked .login-plugin-entry {
  width: auto;
  min-height: 22px;
  margin-top: 1px;
  padding: 0;
  justify-self: start;
  border-top: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
}

@media (max-width: 540px) {
  body.auth-locked .account-panel {
    width: min(340px, 100%) !important;
    padding: 34px 28px 25px !important;
  }

  body.auth-locked .account-panel .login-brand-head {
    margin-bottom: 25px !important;
  }
}

body.auth-locked .login-glass-shapes {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

body.auth-locked .login-glass-shape {
  position: absolute;
  display: block;
  border: 1px solid rgba(224, 237, 255, 0.18);
  border-radius: 9px;
  background: rgba(164, 194, 226, 0.15);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform-origin: center;
  animation: loginGlassReveal 14s ease-in-out infinite;
  will-change: transform, opacity;
}

body.auth-locked .login-glass-shape:nth-child(1) {
  top: -34px;
  right: 34px;
  width: 86px;
  height: 58px;
  animation-delay: 0s;
  animation-duration: 14s;
}

body.auth-locked .login-glass-shape:nth-child(2) {
  top: 86px;
  left: -48px;
  width: 72px;
  height: 72px;
  animation-delay: 2.2s;
  animation-duration: 16s;
}

body.auth-locked .login-glass-shape:nth-child(3) {
  right: -34px;
  bottom: 68px;
  width: 54px;
  height: 54px;
  animation-delay: 4.4s;
  animation-duration: 13s;
}

body.auth-locked .login-glass-shape:nth-child(4) {
  bottom: -25px;
  left: 46px;
  width: 48px;
  height: 48px;
  animation-delay: 6.6s;
  animation-duration: 17s;
}

body.auth-locked .login-glass-shape:nth-child(5) {
  top: 25px;
  left: -20px;
  width: 34px;
  height: 34px;
  animation-delay: 8.8s;
  animation-duration: 12s;
}

body.auth-locked .login-glass-shape:nth-child(6) {
  top: 155px;
  right: -64px;
  width: 42px;
  height: 42px;
  animation-delay: 11s;
  animation-duration: 18s;
}

@keyframes loginGlassReveal {
  0% {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.72);
  }

  20% {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.72);
  }

  34% {
    opacity: 0.92;
    transform: translate3d(0, 0, 0) scale(1);
  }

  68% {
    opacity: 0.92;
    transform: translate3d(0, -14px, 0) scale(1.04);
  }

  82% {
    opacity: 0;
    transform: translate3d(0, -22px, 0) scale(0.78);
  }

  100% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.78);
  }
}

body.auth-locked .login-brand-head,
body.auth-locked .account-row,
body.auth-locked .account-status {
  position: relative;
  z-index: 1;
}

body.auth-locked .login-secondary-entry {
  width: fit-content;
  min-height: 20px;
  margin: -2px 0 0;
  padding: 0;
  justify-self: start;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  font-size: 10px;
  font-weight: 400;
  line-height: 20px;
  text-decoration: none;
}

body.auth-locked .login-secondary-entry:hover,
body.auth-locked .login-plugin-entry:hover {
  color: #ffffff;
}

body.auth-locked .login-secondary-entry,
body.auth-locked .login-plugin-entry {
  width: fit-content;
  min-height: 20px;
  margin: -2px 0 0;
  padding: 0;
  justify-self: start;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 400;
  line-height: 20px;
  text-decoration: none;
}

@media (max-width: 540px) {
  body.auth-locked .login-glass-shape:nth-child(2),
  body.auth-locked .login-glass-shape:nth-child(6) {
    display: none;
  }
}

/* Shared launch typography for the signed-in customer workspace. */
body:not(.auth-locked):not(.admin-mode),
body:not(.auth-locked):not(.admin-mode) button,
body:not(.auth-locked):not(.admin-mode) input,
body:not(.auth-locked):not(.admin-mode) textarea,
body:not(.auth-locked):not(.admin-mode) select {
  font-family: "El Messiri", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  letter-spacing: 0;
}

/* Match the custom generation count control to the numbered buttons. */
body:not(.auth-locked):not(.admin-mode) .batch-custom-control {
  height: 36px;
  min-height: 36px;
  padding-left: 10px;
  gap: 7px;
  border-color: #343c48;
  border-radius: 6px;
  background: #1a1f27;
  color: #b8c1cc;
  font-size: 13px;
  font-weight: 500;
  line-height: 34px;
}

body:not(.auth-locked):not(.admin-mode) .batch-custom-control .batch-count-input {
  width: 38px;
  height: 34px;
  min-height: 34px;
  padding: 0 7px;
  border: 0 !important;
  border-left: 1px solid #343c48 !important;
  border-radius: 0 5px 5px 0;
  background: #0f1217 !important;
  color: #e8edf2 !important;
  font-size: 13px;
  font-weight: 500;
  line-height: 34px;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

body:not(.auth-locked):not(.admin-mode) .batch-custom-control .batch-count-input::-webkit-inner-spin-button,
body:not(.auth-locked):not(.admin-mode) .batch-custom-control .batch-count-input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

/* Runtime notices must not occupy the signed-in sidebar account area. */
body:not(.auth-locked):not(.admin-mode) .account-panel .account-status {
  display: none !important;
}

.generation-task-status {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin: 14px 0;
  padding: 10px 13px;
  border: 1px solid #39434d;
  border-radius: 6px;
  background: #171c21;
  color: #d9dee3;
  font-size: 13px;
  font-weight: 400;
}

.generation-task-status::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: #91a99d;
  box-shadow: 0 0 0 4px rgba(145, 169, 157, 0.12);
}

.generation-task-status.success::before { background: #76b58e; }
.generation-task-status.error::before { background: #c77b78; }
.generation-task-status.hidden { display: none; }

.workspace-toast {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 1200;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid #46515c;
  border-radius: 6px;
  background: rgba(24, 29, 34, 0.96);
  color: #f1f3f5;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  font-size: 13px;
  line-height: 1.5;
}

.workspace-toast.success { border-color: #638773; }
.workspace-toast.error { border-color: #9c6664; }
.workspace-toast.hidden { display: none; }

@media (max-width: 700px) {
  .workspace-toast { top: 14px; right: 16px; left: 16px; max-width: none; }
}

/* Restrained selected states for the professional dark workspace. */
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .model-tab.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .mode-tab.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .composition-tab.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .soft-tab.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .batch-tab.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-tag.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .source-tab.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-mode-btn.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-layout-btn.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .material-library-tab.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .admin-btn.secondary.active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-nav-item.active {
  border-color: #56616f !important;
  background: linear-gradient(180deg, #2a3038 0%, #20252c 100%) !important;
  color: #f3f6fa !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  box-shadow:
    inset 3px 0 0 #7f9fbe,
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .model-tab.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .mode-tab.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .composition-tab.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .soft-tab.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .batch-tab.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .prompt-tag.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .source-tab.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-mode-btn.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .three-d-layout-btn.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .material-library-tab.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .admin-btn.secondary.active:hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .desktop-nav-item.active:hover {
  border-color: #687585 !important;
  background: linear-gradient(180deg, #303741 0%, #252b33 100%) !important;
}

/* Premium dark action buttons: graphite shutter over a muted mineral gradient. */
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button:not(.icon-button):not(.password-visibility-btn):not(.preview-close-btn):not(.modal-close-btn),
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-backdrop button:not(.icon-button):not(.modal-close-btn):not(.preview-color-swatch),
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .refine-guide-backdrop button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-color: #59615c !important;
  border-radius: 7px !important;
  background: linear-gradient(100deg, #53665f 0%, #77735f 52%, #947658 100%) !important;
  color: #f5f2ea !important;
  font-weight: 500 !important;
  letter-spacing: 0;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  transition: border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 120ms ease !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button:not(.icon-button):not(.password-visibility-btn):not(.preview-close-btn):not(.modal-close-btn)::before,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-backdrop button:not(.icon-button):not(.modal-close-btn):not(.preview-color-swatch)::before,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .refine-guide-backdrop button::before {
  position: absolute;
  top: 0;
  left: -10%;
  z-index: -1;
  width: 120%;
  height: 100%;
  background: #202522;
  content: "";
  pointer-events: none;
  transform: skew(30deg);
  transform-origin: center;
  transition: transform 400ms cubic-bezier(0.3, 1, 0.8, 1);
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button:not(.icon-button):not(.password-visibility-btn):not(.preview-close-btn):not(.modal-close-btn):hover::before,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-backdrop button:not(.icon-button):not(.modal-close-btn):not(.preview-color-swatch):hover::before,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .refine-guide-backdrop button:hover::before,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button.active::before,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button[aria-pressed="true"]::before {
  transform: translate3d(100%, 0, 0) skew(30deg);
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button:not(.icon-button):not(.password-visibility-btn):not(.preview-close-btn):not(.modal-close-btn):hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-backdrop button:not(.icon-button):not(.modal-close-btn):not(.preview-color-swatch):hover,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .refine-guide-backdrop button:hover {
  border-color: #a48b69 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 18px rgba(121, 143, 126, 0.12) !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button:not(.icon-button):not(.password-visibility-btn):not(.preview-close-btn):not(.modal-close-btn):active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-backdrop button:not(.icon-button):not(.modal-close-btn):not(.preview-color-swatch):active,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .refine-guide-backdrop button:active {
  transform: scale(0.96) !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button:disabled {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.48;
  transform: none !important;
}

/* Thumbnail controls must stay over the image, outside the themed action-button flow. */
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace .remove-reference {
  position: absolute !important;
  z-index: 5;
  top: 4px;
  right: 4px;
  display: flex;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 50% !important;
  background: rgba(185, 28, 28, 0.96) !important;
  color: #ffffff !important;
  font-size: 19px;
  font-weight: 700 !important;
  line-height: 1;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5) !important;
  transform: none !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace .remove-reference::before,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace .remove-reference::after {
  display: none !important;
  content: none !important;
}

/* Keep selected controls visibly highlighted after the pointer leaves. */
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button.active:not(.icon-button):not(.preview-close-btn),
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button[aria-pressed="true"]:not(.icon-button):not(.preview-close-btn) {
  border-color: #ae916b !important;
  background: linear-gradient(105deg, #5f7168 0%, #7f765f 52%, #9a7958 100%) !important;
  color: #fffaf1 !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.34) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 16px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(174, 145, 107, 0.1) !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button.active:not(.icon-button):not(.preview-close-btn)::before,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .user-workspace button[aria-pressed="true"]:not(.icon-button):not(.preview-close-btn)::before {
  transform: translate3d(100%, 0, 0) skew(30deg) !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-close-btn {
  display: grid !important;
  place-items: center;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  flex: 0 0 28px;
  overflow: hidden;
  border: 1px solid #4b5661 !important;
  border-radius: 5px !important;
  background: #20262d !important;
  color: #d9dee4 !important;
  font-family: Arial, sans-serif !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-close-btn::before,
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-close-btn::after {
  content: none !important;
  display: none !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .modal-close-btn:hover {
  border-color: #77838f !important;
  background: #2b323a !important;
  color: #ffffff !important;
}

/* Keep the compact quantity picker proportional to its one-character labels. */
html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .generation-count-control .batch-tab {
  width: 30px;
  min-width: 30px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  flex: 0 0 30px;
  line-height: 30px;
}

body:not(.auth-locked):not(.admin-mode) .generation-count-control .batch-custom-control {
  height: 32px;
  min-height: 32px;
  line-height: 30px;
}

body:not(.auth-locked):not(.admin-mode) .generation-count-control .batch-custom-control .batch-count-input {
  height: 30px;
  min-height: 30px;
  line-height: 30px;
}

/* Float prompt actions inside the editor and tighten the handoff to generation controls. */
html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .prompt-composer-layout {
  gap: 10px;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .prompt-input-wrap {
  margin-bottom: 0;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .prompt-input-wrap .prompt-input {
  padding-bottom: 50px;
  resize: none;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .prompt-input-wrap .prompt-tools {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  margin: 0;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .prompt-input-wrap .prompt-tool-btn {
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 6px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.28) !important;
}

html[data-pc-theme] body:not(.auth-locked):not(.admin-mode) .generation-submit-stack {
  padding-top: 0;
  border-top: 0;
}

.generation-cost-note {
  min-width: 0;
  margin-left: auto;
  color: #94a9a1;
  font-size: 13px;
  line-height: 20px;
  text-align: right;
}

.creation-flow.is-generation-locked #modelSettings,
.creation-flow.is-generation-locked #referenceWorkspace,
.creation-flow.is-generation-locked #promptWorkspace .prompt-compose-main,
.creation-flow.is-generation-locked #promptWorkspace .generation-count-control {
  opacity: 0.58;
}

.creation-flow.is-generation-locked button:disabled,
.creation-flow.is-generation-locked textarea:disabled,
.creation-flow.is-generation-locked input:disabled {
  cursor: not-allowed;
}

@media (max-width: 920px) {
  .generation-cost-note {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
}

/* Dedicated jade progress treatment for the primary generation action. */
html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .generate-btn {
  --generate-progress: 0%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #347562 !important;
  background: #173b33 !important;
  color: #eefbf6 !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 20px rgba(0, 0, 0, 0.22) !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .generate-btn::before {
  content: none !important;
  display: none !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .generate-btn::after {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: var(--generate-progress);
  background: linear-gradient(90deg, #28765f 0%, #45ad82 100%);
  content: "";
  pointer-events: none;
  transition: width 520ms cubic-bezier(0.22, 0.72, 0.28, 1);
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .generate-btn:not(:disabled):hover {
  border-color: #4b9a7f !important;
  background: #1c493d !important;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .generate-btn:disabled:not(.is-generating) {
  border-color: #30463f !important;
  background: #192823 !important;
  color: #718b81 !important;
  filter: none;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .generate-btn.is-generating {
  gap: 10px;
  border-color: #4aa183 !important;
  background: #142f29 !important;
  color: #ffffff !important;
  filter: none;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .generate-btn.is-complete::after {
  background: linear-gradient(90deg, #2e8067 0%, #5bc997 100%);
}

.generate-btn .generate-progress-label {
  position: relative;
  z-index: 1;
  color: inherit;
  font-size: 15px;
  font-weight: 650;
}

html[data-pc-theme="dark"] body:not(.auth-locked):not(.admin-mode) .generate-btn .generate-time {
  position: relative;
  z-index: 1;
  padding: 2px 7px;
  border: 1px solid rgba(221, 255, 240, 0.28);
  background: rgba(8, 32, 25, 0.38);
  color: #eafff6;
  font-size: 11px;
  font-weight: 600;
}

/* Layered jade sign-in action: distinct from workspace controls without a bright blue glow. */
body.auth-locked .account-panel .account-row #loginBtn {
  width: 104px !important;
  min-width: 104px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 15px !important;
  border: 2px solid transparent !important;
  border-radius: 11px !important;
  background:
    linear-gradient(#242a30, #1c2126) padding-box,
    linear-gradient(135deg, #d2dbe3 0%, #7f8b96 36%, #4a535c 100%) border-box !important;
  color: #f3f5f7 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 20px rgba(0, 0, 0, 0.2) !important;
  transition: background 220ms ease, box-shadow 220ms ease, transform 160ms ease !important;
}

body.auth-locked .account-panel .account-row #loginBtn:hover,
body.auth-locked .account-panel .account-row #loginBtn:focus-visible {
  background:
    linear-gradient(#30373e, #252b31) padding-box,
    linear-gradient(135deg, #eef3f7 0%, #a3afb9 48%, #65717b 100%) border-box !important;
  box-shadow: 0 0 13px rgba(189, 202, 213, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
  outline: none;
  transform: translateY(-1px);
}

body.auth-locked .account-panel .account-row #loginBtn:active {
  transform: scale(0.97);
}

/* Let the prompt library end with its actual editor instead of filling the viewport. */
@media (min-width: 900px) {
  .user-workspace[data-desktop-view="prompts"] > .prompt-library-card {
    min-height: 0;
  }
}

/* Compact login options and opposing-line sign-in action. */
body.auth-locked .account-panel .login-options-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}

body.auth-locked .account-panel .login-options-row .remember-password-row,
body.auth-locked .account-panel .login-options-row .login-secondary-entry {
  margin: 0;
  color: rgba(255, 255, 255, 0.76) !important;
  font-family: "PingFang SC", "Microsoft YaHei UI", sans-serif !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 20px !important;
}

body.auth-locked .account-panel .login-options-row .remember-password-row span,
body.auth-locked .account-panel .login-options-row .login-secondary-entry {
  font-family: "PingFang SC", "Microsoft YaHei UI", sans-serif !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 20px !important;
  letter-spacing: 0;
}

body.auth-locked .account-panel .login-options-row .login-secondary-entry {
  min-height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: none;
  box-shadow: none;
}

body.auth-locked .account-panel .account-row #loginBtn {
  position: relative;
  width: 92px !important;
  min-width: 92px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 12px !important;
  overflow: visible;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #f3f5f7 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  transform: none;
}

body.auth-locked .account-panel .account-row #loginBtn::before,
body.auth-locked .account-panel .account-row #loginBtn::after {
  position: absolute;
  width: 24%;
  height: 1px;
  background: linear-gradient(90deg, #77838e, #dbe2e8);
  content: "";
  opacity: 0.72;
  pointer-events: none;
  transition: width 350ms ease, opacity 200ms ease;
}

body.auth-locked .account-panel .account-row #loginBtn::before { top: 0; right: 0; }
body.auth-locked .account-panel .account-row #loginBtn::after { bottom: 0; left: 0; }

body.auth-locked .account-panel .account-row #loginBtn:not(:disabled):hover::before,
body.auth-locked .account-panel .account-row #loginBtn:not(:disabled):hover::after,
body.auth-locked .account-panel .account-row #loginBtn:focus-visible::before,
body.auth-locked .account-panel .account-row #loginBtn:focus-visible::after {
  width: 100%;
  opacity: 1;
}

body.auth-locked .account-panel .account-row #loginBtn:hover,
body.auth-locked .account-panel .account-row #loginBtn:focus-visible {
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  transform: none;
}

body.auth-locked .account-panel .account-row #loginBtn:active {
  transform: scale(0.96);
}
/* Customer service contact replaces the public recharge workflow. */
.customer-service-modal {
  width: min(420px, calc(100vw - 32px));
}

.customer-service-content {
  display: grid;
  padding-top: 4px;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.customer-service-qr-wrap {
  display: grid;
  width: 168px;
  aspect-ratio: 1;
  padding: 10px;
  place-items: center;
  border: 1px solid #343c48;
  border-radius: 8px;
  background: #f4f6f7;
}

.customer-service-qr {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.customer-service-qr.hidden,
.customer-service-qr-empty.hidden {
  display: none;
}

.customer-service-qr-empty {
  color: #697482;
  font-size: 12px;
}

.customer-service-phone-block {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.customer-service-phone-block span {
  color: #929dab;
  font-size: 14px;
  line-height: 20px;
}

.customer-service-phone-block strong {
  overflow-wrap: anywhere;
  color: #edf1f5;
  font-size: 16px;
  line-height: 24px;
}

.customer-service-phone-block .admin-btn {
  width: max-content;
  min-width: 92px;
}

@media (max-width: 560px) {
  .customer-service-content {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .customer-service-phone-block {
    width: 100%;
    justify-items: center;
    text-align: center;
  }
}

/* Align the signed-in account identity with its action row. */
@media (min-width: 900px) {
  body:not(.auth-locked):not(.admin-mode) .account-panel {
    padding-top: 20px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel::before {
    top: 8px;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary {
    gap: 3px;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary > div:first-child {
    padding-right: 10px;
    padding-left: 10px;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-identity {
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 8px;
  }

  body:not(.auth-locked):not(.admin-mode) .creation-flow > .model-settings-card,
  body:not(.auth-locked):not(.admin-mode) .creation-flow > .reference-card {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  body:not(.auth-locked):not(.admin-mode) .model-settings-card .workflow-step-head,
  body:not(.auth-locked):not(.admin-mode) .reference-card .workflow-step-head {
    margin-bottom: 10px;
  }

  body:not(.auth-locked):not(.admin-mode) .model-settings-card .workflow-control-block .batch-label,
  body:not(.auth-locked):not(.admin-mode) .reference-card .reference-source-panel .batch-label {
    margin-bottom: 6px;
  }

  body:not(.auth-locked):not(.admin-mode) .model-settings-card .workflow-control-block {
    display: grid;
    grid-template-rows: 16px 36px 16px;
    align-content: start;
    row-gap: 6px;
  }

  body:not(.auth-locked):not(.admin-mode) .model-settings-card .workflow-control-block .batch-label {
    margin: 0;
  }

  body:not(.auth-locked):not(.admin-mode) .model-settings-card .mode-note {
    height: 16px;
    min-height: 16px;
    overflow: hidden;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.auth-locked):not(.admin-mode) .model-settings-card #generationModeNote {
    height: 16px;
    min-height: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.auth-locked):not(.admin-mode) .reference-card .reference-grid {
    min-height: 96px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  body:not(.auth-locked):not(.admin-mode) .reference-card .add-reference,
  body:not(.auth-locked):not(.admin-mode) .reference-card .reference-thumb,
  body:not(.auth-locked):not(.admin-mode) .reference-card .reference-placeholder {
    width: 78px;
    height: 78px;
  }

  body:not(.auth-locked):not(.admin-mode) .user-workspace[data-desktop-view="create"] > .history-card .history-grid {
    gap: 8px;
  }

  body:not(.auth-locked):not(.admin-mode) .user-workspace[data-desktop-view="create"] > .history-card .history-item {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
  }
}

.generation-message-button {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #aeb8c3;
}

.generation-message-button:hover,
.generation-message-button.has-unread {
  color: #f2f5f8;
}

.generation-message-button.error {
  color: #dc8985;
}

.generation-message-loader {
  position: relative;
  width: 20px;
  height: 20px;
}

.generation-message-loader::before {
  position: absolute;
  top: 24px;
  left: 0;
  width: 20px;
  height: 3px;
  border-radius: 50%;
  background: rgba(240, 128, 128, 0.32);
  content: "";
}

.generation-message-loader::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: #f08080;
  content: "";
}

.generation-message-button.has-unread .generation-message-loader::before {
  animation: generationMessageShadow 0.6s linear infinite;
}

.generation-message-button.has-unread .generation-message-loader::after {
  animation: generationMessageJump 0.6s linear infinite;
}

@keyframes generationMessageJump {
  15% { border-bottom-right-radius: 3px; }
  25% { transform: translateY(4px) rotate(22.5deg); }
  50% { border-bottom-right-radius: 18px; transform: translateY(8px) scale(1, 0.9) rotate(45deg); }
  75% { transform: translateY(4px) rotate(67.5deg); }
  100% { transform: translateY(0) rotate(90deg); }
}

@keyframes generationMessageShadow {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.2, 1); }
}

.generation-message-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid #101318;
  border-radius: 9px;
  background: #77b990;
  color: #07110b;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.generation-message-button.error .generation-message-badge {
  background: #cf7773;
}

.generation-message-badge.hidden,
.generation-message-button.hidden,
.generation-message-popover.hidden {
  display: none;
}

.generation-message-popover {
  position: absolute;
  z-index: 80;
  bottom: calc(100% + 12px);
  left: 0;
  width: 270px;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid #39434e;
  border-radius: 6px;
  background: #171c22;
  color: #eef2f6;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.generation-message-tabs {
  display: flex;
  align-items: center;
  height: 26px;
  padding-right: 28px;
  gap: 3px;
}

.generation-message-tab {
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #7f8a96;
  font-size: 11px;
}

.generation-message-tab.active {
  background: #232b33;
  color: #eef2f6;
}

.generation-message-tab span {
  margin-left: 2px;
  color: #78a68a;
  font-size: 10px;
}

.generation-message-close {
  position: absolute;
  z-index: 1;
  top: 9px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a0ad;
  font-size: 18px;
  line-height: 24px;
}

.generation-message-list {
  display: grid;
  width: 100%;
  margin-top: 5px;
  gap: 4px;
  overflow: hidden;
}

.generation-message-empty {
  padding: 12px 6px;
  color: #8e99a6;
  font-size: 12px;
  text-align: center;
}

.generation-message-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 6px 8px;
  box-sizing: border-box;
  gap: 8px;
  border: 0;
  border-left: 2px solid #3b4651;
  border-radius: 3px;
  background: #12171c;
  color: #dce2e8;
  text-align: left;
}

.generation-message-item.is-unread {
  border-left-color: #7f9ab5;
  background: #1a2128;
}

.generation-message-item.is-read {
  opacity: 0.68;
}

.generation-message-item-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.generation-message-item-main strong {
  flex: 0 0 auto;
  font-size: 11px;
}

.generation-message-item-main strong.is-success { color: #82c49b; }
.generation-message-item-main strong.is-error { color: #dc8985; }

.generation-message-item-text {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generation-message-item-meta {
  display: block;
  flex: 0 0 auto;
  text-align: right;
}

.generation-message-item-meta time {
  color: #7f8a97;
  font-size: 10px;
}

/* Ordinary-user phone and tablet shell. Desktop starts at 1024px. */
.mobile-nav-more,
.mobile-nav-sheet {
  display: none;
}

@media (max-width: 1023px) {
  body:not(.auth-locked):not(.admin-mode) {
    min-width: 0;
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  body:not(.auth-locked):not(.admin-mode).mobile-nav-open {
    overflow: hidden;
  }

  body:not(.auth-locked):not(.admin-mode) .web-panel {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 100dvh;
    margin: 0;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-sidebar {
    position: sticky !important;
    top: 0 !important;
    z-index: 70;
    display: flex;
    width: 100% !important;
    min-height: 0 !important;
    padding: max(10px, env(safe-area-inset-top)) 16px 10px !important;
    border-right: 0 !important;
    border-bottom: 1px solid #292f38 !important;
    background: rgba(15, 18, 22, 0.96) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    backdrop-filter: none !important;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-brand {
    min-height: 38px;
    padding: 0 !important;
    border: 0 !important;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-content {
    width: 100% !important;
    min-width: 0 !important;
    padding: 14px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-topbar {
    display: none !important;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-nav {
    position: fixed !important;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 100;
    display: grid !important;
    width: auto !important;
    margin: 0 !important;
    padding: 7px !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px !important;
    overflow: hidden !important;
    border: 1px solid #353d47 !important;
    border-radius: 12px !important;
    background: rgba(20, 24, 29, 0.97) !important;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(18px);
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-nav-section,
  body:not(.auth-locked):not(.admin-mode) .desktop-nav-item-disabled,
  body:not(.auth-locked):not(.admin-mode) .desktop-nav-item[data-desktop-view="prompts"],
  body:not(.auth-locked):not(.admin-mode) .desktop-nav-item[data-desktop-view="threeD"],
  body:not(.auth-locked):not(.admin-mode) .desktop-nav-item[data-desktop-view="threeDModel"],
  body:not(.auth-locked):not(.admin-mode) .desktop-nav-item[data-desktop-view="threeDHistory"] {
    display: none !important;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-nav-item,
  body:not(.auth-locked):not(.admin-mode) .mobile-nav-more {
    display: flex !important;
    min-width: 0 !important;
    min-height: 46px !important;
    padding: 4px 3px !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0 !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: #9aa5b1 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 14px !important;
    text-align: center;
    text-decoration: none;
    white-space: normal !important;
  }

  body:not(.auth-locked):not(.admin-mode) .mobile-nav-more > span:first-child {
    height: 12px;
    color: #c2cad3;
    font-size: 14px;
    letter-spacing: 1px;
    line-height: 8px;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-nav-item.active {
    background: #26362f !important;
    color: #dce9e2 !important;
    box-shadow: inset 0 0 0 1px #4d6d5d !important;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel {
    margin-bottom: 12px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .user-workspace,
  body:not(.auth-locked):not(.admin-mode) .creation-flow,
  body:not(.auth-locked):not(.admin-mode) .panel-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  body:not(.auth-locked):not(.admin-mode) .model-control-grid,
  body:not(.auth-locked):not(.admin-mode) .reference-workspace-layout,
  body:not(.auth-locked):not(.admin-mode) .prompt-composer-layout,
  body:not(.auth-locked):not(.admin-mode) .prompt-library-layout,
  body:not(.auth-locked):not(.admin-mode) .three-d-layout,
  body:not(.auth-locked):not(.admin-mode) .three-d-model-layout,
  body:not(.auth-locked):not(.admin-mode) .three-d-manual-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body:not(.auth-locked):not(.admin-mode) .model-tabs,
  body:not(.auth-locked):not(.admin-mode) .generation-mode-buttons,
  body:not(.auth-locked):not(.admin-mode) .composition-buttons,
  body:not(.auth-locked):not(.admin-mode) .source-tabs,
  body:not(.auth-locked):not(.admin-mode) .batch-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  body:not(.auth-locked):not(.admin-mode) button,
  body:not(.auth-locked):not(.admin-mode) .desktop-nav-item {
    touch-action: manipulation;
  }

  body:not(.auth-locked):not(.admin-mode) .model-tab,
  body:not(.auth-locked):not(.admin-mode) .mode-tab,
  body:not(.auth-locked):not(.admin-mode) .composition-tab,
  body:not(.auth-locked):not(.admin-mode) .soft-tab,
  body:not(.auth-locked):not(.admin-mode) .prompt-tag,
  body:not(.auth-locked):not(.admin-mode) .three-d-mode-btn,
  body:not(.auth-locked):not(.admin-mode) .three-d-layout-btn {
    min-height: 44px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .generate-btn,
  body:not(.auth-locked):not(.admin-mode) .image-refine-btn,
  body:not(.auth-locked):not(.admin-mode) .three-d-start-btn {
    min-height: 50px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .history-grid,
  body:not(.auth-locked):not(.admin-mode) .refine-source-grid,
  body:not(.auth-locked):not(.admin-mode) .refine-history-grid {
    grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)) !important;
    gap: 10px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .history-item {
    width: auto !important;
    min-width: 0 !important;
    aspect-ratio: 1 / 1;
  }

  body:not(.auth-locked):not(.admin-mode) .image-preview-modal {
    width: calc(100vw - 24px) !important;
    max-width: none !important;
    max-height: calc(100dvh - 24px) !important;
  }

  body:not(.auth-locked):not(.admin-mode) .image-editor-toolbar {
    display: flex !important;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.auth-locked):not(.admin-mode) .image-editor-toolbar::-webkit-scrollbar {
    display: none;
  }

  body:not(.auth-locked):not(.admin-mode) .image-editor-toolbar > * {
    flex: 0 0 auto;
  }

  body:not(.auth-locked):not(.admin-mode) .image-preview-stage {
    min-height: 280px;
    max-height: calc(100dvh - 250px) !important;
  }

  body:not(.auth-locked):not(.admin-mode) .three-d-view-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body:not(.auth-locked):not(.admin-mode) > .mobile-nav-sheet {
    display: block;
  }

  .mobile-nav-sheet {
    position: fixed;
    inset: 0;
    z-index: 140;
  }

  .mobile-nav-sheet.hidden {
    display: none !important;
  }

  .mobile-nav-sheet-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
  }

  .mobile-nav-sheet-panel {
    position: absolute;
    right: 10px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 10px;
    padding: 14px;
    border: 1px solid #3a434e;
    border-radius: 10px;
    background: #171b20;
    color: #eef2f6;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  }

  .mobile-nav-sheet-head {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-nav-sheet-close {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #aeb7c1;
    font-size: 24px;
  }

  .mobile-nav-sheet-list {
    display: grid;
    margin-top: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-nav-sheet-item {
    display: flex;
    min-height: 48px;
    padding: 8px 12px;
    align-items: center;
    border: 1px solid #333b45;
    border-radius: 7px;
    background: #20262d;
    color: #e4e9ee;
    font-size: 13px;
    text-decoration: none;
  }
}

@media (max-width: 599px) {
  body:not(.auth-locked):not(.admin-mode) .desktop-content {
    padding: 10px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-sidebar {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .panel-card,
  body:not(.auth-locked):not(.admin-mode) .creation-flow > .panel-card {
    padding: 13px 12px !important;
    border-radius: 7px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .workflow-step-note,
  body:not(.auth-locked):not(.admin-mode) .history-subtitle {
    display: none;
  }

  body:not(.auth-locked):not(.admin-mode) .model-tab,
  body:not(.auth-locked):not(.admin-mode) .mode-tab {
    flex: 1 1 calc(50% - 8px) !important;
  }

  body:not(.auth-locked):not(.admin-mode) .composition-tab,
  body:not(.auth-locked):not(.admin-mode) .soft-tab {
    flex: 1 1 100% !important;
  }

  body:not(.auth-locked):not(.admin-mode) .prompt-input {
    min-height: 150px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .history-grid,
  body:not(.auth-locked):not(.admin-mode) .refine-source-grid,
  body:not(.auth-locked):not(.admin-mode) .refine-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body:not(.auth-locked):not(.admin-mode) .three-d-view-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body:not(.auth-locked):not(.admin-mode) .image-preview-modal {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  body:not(.auth-locked):not(.admin-mode) .image-refine-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body:not(.auth-locked):not(.admin-mode) .image-refine-btn {
    width: 100% !important;
  }

  .mobile-nav-sheet-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Compact desktop: preserve full controls when a laptop sidebar reduces usable width. */
@media (min-width: 1240px) and (max-width: 1479px) {
  body:not(.auth-locked):not(.admin-mode) .model-control-grid {
    grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.45fr) !important;
    column-gap: 0;
    row-gap: 14px;
  }

  body:not(.auth-locked):not(.admin-mode) .model-level-control {
    padding-left: 0 !important;
    border-left: 0 !important;
  }

  body:not(.auth-locked):not(.admin-mode) .generation-mode-control {
    padding-right: 0 !important;
  }

  body:not(.auth-locked):not(.admin-mode) .composition-control.workflow-control-block {
    grid-column: 1 / -1;
    padding: 12px 0 0 !important;
    border-top: 1px solid #303741 !important;
    border-left: 0 !important;
  }

  body:not(.auth-locked):not(.admin-mode) .model-tabs,
  body:not(.auth-locked):not(.admin-mode) .generation-mode-buttons,
  body:not(.auth-locked):not(.admin-mode) .composition-buttons {
    flex-wrap: nowrap !important;
  }

  body:not(.auth-locked):not(.admin-mode) .model-tab,
  body:not(.auth-locked):not(.admin-mode) .mode-tab,
  body:not(.auth-locked):not(.admin-mode) .composition-tab {
    min-width: 0 !important;
    white-space: nowrap !important;
  }

  body:not(.auth-locked):not(.admin-mode) .composition-tab {
    flex: 1 1 0 !important;
  }
}

/* Keep the signed-out card content-sized on laptop Safari. */
@media (min-width: 900px) {
  body.auth-locked .desktop-content {
    place-items: center end !important;
  }

  body.auth-locked .account-panel {
    box-sizing: border-box !important;
    display: block !important;
    width: min(390px, calc(100vw - 64px)) !important;
    max-width: 390px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100svh - 48px) !important;
    margin: 0 clamp(38px, 5.5vw, 96px) 0 0 !important;
    padding: 38px 36px 28px !important;
    overflow: visible !important;
  }

  body.auth-locked .account-panel .login-brand-head {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: block !important;
    width: 100% !important;
    margin: 0 0 28px !important;
  }

  body.auth-locked .account-panel .account-row {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    display: grid !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: max-content !important;
    align-content: start !important;
    gap: 14px !important;
    transform: none !important;
  }

  body.auth-locked .login-field {
    width: 100% !important;
    min-height: 46px !important;
  }

  body.auth-locked .account-panel .account-row .text-input {
    height: 46px !important;
    min-height: 46px !important;
  }
}

@media (min-width: 900px) and (max-height: 720px) {
  body.auth-locked .account-panel {
    padding: 30px 32px 22px !important;
  }

  body.auth-locked .account-panel .login-brand-head {
    margin-bottom: 22px !important;
  }

  body.auth-locked .account-panel .account-row {
    gap: 11px !important;
  }
}

/* Compact phone experience. Tablet and desktop rules remain unchanged. */
@media (max-width: 599px) {
  body.auth-locked {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden !important;
  }

  body.auth-locked .web-panel,
  body.auth-locked .desktop-content {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    overflow: hidden !important;
  }

  body.auth-locked .desktop-content {
    display: grid !important;
    padding: 16px !important;
    place-items: end center !important;
    background-color: #0b0d10 !important;
    background-image: linear-gradient(180deg, rgba(6, 8, 10, 0.05), rgba(6, 8, 10, 0.5)), url("assets/login-atelier-mobile.png") !important;
    background-position: center top !important;
    background-size: cover !important;
  }

  body.auth-locked .account-panel {
    width: 100% !important;
    max-width: 390px !important;
    margin: 0 0 max(4px, env(safe-area-inset-bottom)) !important;
    padding: 20px 18px 17px !important;
    gap: 0 !important;
    border-radius: 7px !important;
    background: rgba(15, 19, 24, 0.88) !important;
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.48) !important;
    backdrop-filter: blur(14px) !important;
  }

  body.auth-locked .login-glass-shapes,
  body.auth-locked .login-plugin-entry {
    display: none !important;
  }

  body.auth-locked .account-panel .brand-head {
    margin-bottom: 18px !important;
  }

  body.auth-locked .login-brand-title {
    font-size: 25px !important;
    line-height: 32px !important;
  }

  body.auth-locked .account-status {
    margin-bottom: 12px !important;
  }

  body.auth-locked .account-panel .account-row {
    gap: 11px !important;
  }

  body.auth-locked .login-field,
  body.auth-locked .account-panel .account-row .text-input {
    min-height: 50px !important;
  }

  body.auth-locked .login-options-row {
    min-height: 30px !important;
    margin: 0 !important;
  }

  body.auth-locked .account-panel .account-row .login-btn {
    min-height: 46px !important;
    margin-top: 1px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-brand {
    min-height: 32px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-brand-name {
    font-size: 18px !important;
    line-height: 21px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .desktop-brand-tagline {
    display: none !important;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel {
    margin-bottom: 10px !important;
    padding: 4px !important;
    border-radius: 7px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary {
    display: grid !important;
    min-height: 58px !important;
    padding: 9px 10px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
    align-items: center !important;
    border-radius: 0 !important;
    background: #15191f !important;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary > .account-identity {
    display: flex !important;
    min-width: 0;
    align-items: center !important;
    gap: 8px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-summary > .account-identity::before,
  body:not(.auth-locked):not(.admin-mode) .account-panel .summary-meta,
  body:not(.auth-locked):not(.admin-mode) #openRechargeRequestBtn,
  body:not(.auth-locked):not(.admin-mode) #openPasswordModalBtn {
    display: none !important;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .summary-name {
    overflow: hidden;
    color: #eef2f6 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 20px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.auth-locked):not(.admin-mode) .generation-message-button {
    display: inline-flex !important;
    width: auto !important;
    min-width: 72px !important;
    height: 36px !important;
    padding: 0 8px !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #343d47 !important;
    border-radius: 5px !important;
    background: #1b2027 !important;
  }

  body:not(.auth-locked):not(.admin-mode) .generation-message-button::after {
    color: #c4cbd3;
    content: "生成消息";
    font-size: 11px;
    white-space: nowrap;
  }

  body:not(.auth-locked):not(.admin-mode) .generation-message-loader {
    width: 14px !important;
    height: 14px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .generation-message-loader::before {
    top: 17px !important;
    width: 14px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .account-panel .account-actions {
    display: block !important;
    width: auto !important;
  }

  body:not(.auth-locked):not(.admin-mode) #logoutBtn {
    width: 58px !important;
    min-width: 58px !important;
    min-height: 36px !important;
    padding: 0 8px !important;
    border-radius: 5px !important;
    font-size: 12px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .generation-message-popover {
    position: fixed !important;
    right: 10px !important;
    bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    left: 10px !important;
    width: auto !important;
  }

  body:not(.auth-locked):not(.admin-mode) .workflow-step-head {
    margin-bottom: 11px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .workflow-step-index {
    width: 24px !important;
    height: 24px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .workflow-step-head .section-title {
    font-size: 16px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .mode-note,
  body:not(.auth-locked):not(.admin-mode) .model-mode-note {
    display: none !important;
  }

  body:not(.auth-locked):not(.admin-mode) .workflow-control-block + .workflow-control-block {
    margin-top: 11px !important;
    padding-top: 11px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .model-tab {
    min-height: 40px !important;
    flex: 1 1 calc(33.333% - 8px) !important;
    padding: 0 5px !important;
    font-size: 12px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .mode-tab {
    min-height: 40px !important;
    flex: 1 1 calc(50% - 8px) !important;
    padding: 0 7px !important;
    font-size: 12px !important;
  }

  body:not(.auth-locked):not(.admin-mode) .composition-tab {
    min-height: 40px !important;
    font-size: 12px !important;
  }
}
