/* Pixel-oriented reference pass for the image generation workspace. */
body[data-current-view="image"] {
  background:
    radial-gradient(circle at 50% -18%, rgba(29, 67, 146, 0.34), transparent 34%),
    linear-gradient(180deg, #06101f 0%, #030914 100%);
}

body[data-current-view="image"] #app {
  grid-template-columns: 204px minmax(0, 1fr);
}

body[data-current-view="image"] .sidebar {
  padding: 18px 14px 22px;
  gap: 20px;
  background: linear-gradient(180deg, rgba(6, 17, 33, 0.99), rgba(3, 10, 20, 0.99));
  box-shadow: none;
}

body[data-current-view="image"] .brand {
  min-height: 60px;
  justify-content: flex-start;
  padding: 0 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="image"] .brand-logo,
body[data-current-view="image"] .sidebar-logo {
  content: url("/assets/juaiju-logo-transparent.png");
  width: 152px;
  max-height: 58px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="image"] .nav {
  gap: 8px;
}

body[data-current-view="image"] .nav-item {
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 14px;
  color: #d7e3f2;
}

body[data-current-view="image"] .nav-item::before {
  width: 19px;
  height: 19px;
  flex-basis: 19px;
}

body[data-current-view="image"] .nav-item.active {
  border-color: rgba(105, 94, 255, 0.9);
  background:
    linear-gradient(90deg, rgba(32, 135, 255, 0.66), rgba(133, 58, 255, 0.74)),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(89, 185, 255, 0.3), 0 0 18px rgba(71, 94, 255, 0.34);
}

body[data-current-view="image"] .sidebar-note {
  border-radius: 8px;
  padding: 13px;
  font-size: 12px;
  line-height: 1.65;
  color: #9fb0ca;
  background: linear-gradient(180deg, rgba(18, 36, 73, 0.9), rgba(9, 20, 42, 0.9));
}

body[data-current-view="image"] .main {
  padding: 20px 24px 22px 20px;
}

body[data-current-view="image"] .topbar {
  min-height: 56px;
  margin: 0 0 17px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="image"] .topbar::before,
body[data-current-view="image"] .topbar::after {
  display: none;
}

body[data-current-view="image"] .topbar h1 {
  font-size: 30px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}

body[data-current-view="image"] .topbar p {
  margin-top: 8px;
  font-size: 15px;
  color: #c5d1e1;
}

body[data-current-view="image"] .top-actions {
  gap: 10px;
}

body[data-current-view="image"] .top-actions .app-version,
body[data-current-view="image"] .top-actions .status-pill,
body[data-current-view="image"] .top-actions .ghost-button {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(60, 84, 130, 0.72);
  border-radius: 7px;
  background: rgba(5, 15, 31, 0.82);
  color: #f2f6ff;
  box-shadow: none;
}

body[data-current-view="image"] .top-actions .app-version {
  display: inline-flex;
  align-items: center;
}

body[data-current-view="image"] .image-generation-layout {
  grid-template-columns: 632px minmax(0, 1fr) !important;
  gap: 16px;
  align-items: start;
}

body[data-current-view="image"] .image-generation-panel,
body[data-current-view="image"] .image-results-panel {
  min-height: 830px;
  border: 1px solid rgba(54, 86, 142, 0.78);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(42, 86, 169, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(8, 22, 44, 0.98), rgba(4, 12, 27, 0.98));
  box-shadow: inset 0 1px 0 rgba(155, 183, 255, 0.08);
}

body[data-current-view="image"] .image-generation-panel {
  padding: 16px 17px 16px;
}

body[data-current-view="image"] .image-results-panel {
  padding: 16px;
}

body[data-current-view="image"] .image-generation-panel > .section-header,
body[data-current-view="image"] .image-generation-panel > .section-header + * .field-hint,
body[data-current-view="image"] .image-generation-panel .field-hint,
body[data-current-view="image"] .image-results-panel > .section-header p,
body[data-current-view="image"] .image-results-panel > .info-box {
  display: none !important;
}

body[data-current-view="image"] .image-results-panel > .section-header {
  min-height: 24px;
  margin-bottom: 14px;
  align-items: center;
}

body[data-current-view="image"] .image-results-panel > .section-header h2 {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
}

body[data-current-view="image"] #imageStatus {
  display: none;
}

body[data-current-view="image"] #imageResultGrid::before {
  content: "接口说明";
  position: absolute;
  top: -42px;
  right: 0;
  color: #4d8dff;
  font-size: 14px;
  font-weight: 800;
}

body[data-current-view="image"] #imageResultGrid {
  position: relative;
}

body[data-current-view="image"] .image-generation-panel .form-grid {
  gap: 13px;
}

body[data-current-view="image"] .field-label,
body[data-current-view="image"] .field > span {
  color: #edf4ff;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
}

body[data-current-view="image"] .image-provider-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

body[data-current-view="image"] .image-generation-panel .provider-card {
  position: relative;
  min-height: 90px;
  padding: 12px 7px 10px;
  border-radius: 7px;
  border-color: rgba(60, 86, 137, 0.82);
  background:
    radial-gradient(circle at 50% 18%, rgba(45, 112, 236, 0.18), transparent 56%),
    rgba(7, 17, 36, 0.88);
}

body[data-current-view="image"] .image-generation-panel .provider-card.selected {
  border-color: #8b54ff;
  background:
    radial-gradient(circle at 50% 16%, rgba(121, 88, 255, 0.24), transparent 54%),
    rgba(8, 18, 39, 0.96);
  box-shadow: inset 0 0 0 1px rgba(139, 84, 255, 0.55);
}

body[data-current-view="image"] .image-generation-panel .provider-card.selected::after {
  content: "✓";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 0 7px 0 12px;
  background: #8157ff;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

body[data-current-view="image"] .image-generation-panel .provider-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="image"] .image-generation-panel .provider-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

body[data-current-view="image"] .image-generation-panel .provider-card-status,
body[data-current-view="image"] .image-generation-panel .provider-card small {
  display: none;
}

body[data-current-view="image"] .image-generation-panel .provider-model {
  color: #f1f6ff;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
}

body[data-current-view="image"] .image-model-asset-row {
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: end;
}

body[data-current-view="image"] .model-select-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

body[data-current-view="image"] .image-select-like,
body[data-current-view="image"] .image-input,
body[data-current-view="image"] .input {
  min-height: 40px;
  border: 1px solid rgba(64, 91, 145, 0.86);
  border-radius: 7px;
  background: rgba(5, 13, 29, 0.9);
  color: #edf4ff;
}

body[data-current-view="image"] .image-select-like {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

body[data-current-view="image"] .image-select-like span::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  background: #b9c7dc;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m7 10 5 5 5-5z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m7 10 5 5 5-5z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}

body[data-current-view="image"] .asset-type-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body[data-current-view="image"] .asset-type-picker button,
body[data-current-view="image"] .image-segment {
  min-height: 40px;
  border: 1px solid rgba(64, 91, 145, 0.86);
  border-radius: 7px;
  background: rgba(7, 17, 36, 0.9);
  color: #dbe7f7;
  font-weight: 750;
}

body[data-current-view="image"] .asset-type-picker button.selected,
body[data-current-view="image"] .image-segment.active {
  border-color: #8b54ff;
  color: #fff;
  background: linear-gradient(135deg, rgba(129, 79, 255, 0.54), rgba(25, 87, 204, 0.24));
  box-shadow: inset 0 0 0 1px rgba(131, 83, 255, 0.3);
}

body[data-current-view="image"] .image-saved-asset-field {
  position: relative;
}

body[data-current-view="image"] .image-saved-asset-field select {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58px;
  opacity: 0;
  cursor: pointer;
}

body[data-current-view="image"] .selected-image-asset {
  min-height: 58px;
  margin-top: 0;
  padding: 6px 10px 6px 6px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  border-radius: 7px;
  border-color: rgba(64, 91, 145, 0.86);
  background: rgba(6, 15, 32, 0.92);
}

body[data-current-view="image"] .selected-image-asset.is-empty {
  grid-template-columns: 54px minmax(0, 1fr);
}

body[data-current-view="image"] .image-asset-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 40% 34%, rgba(60, 151, 255, 0.35), transparent 44%),
    linear-gradient(135deg, #113b76, #0d244e);
}

body[data-current-view="image"] .selected-image-asset strong {
  color: #f4f8ff;
  font-size: 14px;
}

body[data-current-view="image"] .selected-image-asset span {
  color: #94a8c6;
  font-size: 12px;
}

body[data-current-view="image"] .selected-image-asset em {
  color: #65ef9d;
  background: rgba(77, 229, 141, 0.12);
}

body[data-current-view="image"] .reference-panel {
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-current-view="image"] .reference-upload-row {
  display: flex;
  gap: 10px;
  margin-top: 0;
}

body[data-current-view="image"] .reference-upload-row .link-button {
  width: 106px;
  height: 74px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(64, 91, 145, 0.86);
  background: rgba(7, 17, 36, 0.9);
  color: #e5efff;
  font-weight: 800;
}

body[data-current-view="image"] .reference-upload-row .link-button::after {
  content: "支持 JPG / PNG";
  display: block;
  margin-top: -18px;
  color: #7f91ad;
  font-size: 11px;
  font-weight: 700;
}

body[data-current-view="image"] #clearImageReferences {
  display: none;
}

body[data-current-view="image"] .reference-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

body[data-current-view="image"] .reference-chip {
  position: relative;
  min-height: 74px;
  padding: 0;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid rgba(64, 91, 145, 0.86);
  background: rgba(7, 17, 36, 0.9);
}

body[data-current-view="image"] .reference-chip img {
  width: 100%;
  height: 74px;
  object-fit: cover;
  border-radius: 0;
}

body[data-current-view="image"] .reference-chip span {
  display: none;
}

body[data-current-view="image"] .reference-chip button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  background: rgba(3, 8, 18, 0.72);
}

body[data-current-view="image"] .reference-chip button::before {
  content: "×";
  font-size: 16px;
  color: #fff;
}

body[data-current-view="image"] .generation-options {
  grid-template-columns: minmax(0, 1fr) 198px;
  gap: 24px;
  align-items: end;
}

body[data-current-view="image"] .image-segment-row {
  display: grid;
  gap: 8px;
}

body[data-current-view="image"] .image-size-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

body[data-current-view="image"] .image-count-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-current-view="image"] .image-prompt-field textarea {
  height: 150px;
  min-height: 150px;
  max-height: 210px;
  padding: 12px;
  resize: vertical;
  line-height: 1.65;
  border-radius: 7px;
}

body[data-current-view="image"] .button-row {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

body[data-current-view="image"] .image-generation-panel .primary-button {
  width: 252px;
  height: 48px;
  border-radius: 7px;
  background: linear-gradient(135deg, #a337ff 0%, #217dff 100%);
  font-size: 16px;
  font-weight: 900;
}

body[data-current-view="image"] .image-generation-panel .primary-button::before {
  content: "✦";
  margin-right: 8px;
}

body[data-current-view="image"] .image-result-banner {
  min-height: 42px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 7px;
  border-color: rgba(50, 114, 102, 0.48);
  background: linear-gradient(90deg, rgba(15, 83, 62, 0.42), rgba(10, 27, 50, 0.76));
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

body[data-current-view="image"] .image-result-banner span {
  color: #39e196;
  font-weight: 900;
}

body[data-current-view="image"] .image-result-banner.is-failed {
  border-color: rgba(255, 88, 88, 0.4);
  background: linear-gradient(90deg, rgba(78, 22, 31, 0.64), rgba(22, 23, 43, 0.84));
}

body[data-current-view="image"] .image-result-card-grid {
  gap: 14px;
}

body[data-current-view="image"] .image-result-card-grid .image-card {
  overflow: hidden;
  border-radius: 8px;
  border-color: rgba(64, 91, 145, 0.86);
  background: rgba(6, 16, 34, 0.94);
}

body[data-current-view="image"] .image-result-card-grid .image-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  object-fit: cover;
}

body[data-current-view="image"] .image-card-body {
  padding: 10px 12px 12px;
}

body[data-current-view="image"] .image-result-card-grid .item-title,
body[data-current-view="image"] .image-result-card-grid .compact-field {
  display: none;
}

body[data-current-view="image"] .image-result-card-grid .item-meta {
  display: flex;
  justify-content: space-between;
  color: #b9c7de;
  font-size: 14px;
}

body[data-current-view="image"] .image-result-card-grid .item-meta em {
  color: #b9c7de;
  font-style: normal;
}

body[data-current-view="image"] .image-result-card-grid .item-actions {
  display: grid;
  grid-template-columns: repeat(6, 42px);
  gap: 8px;
  margin-top: 10px;
}

body[data-current-view="image"] .image-result-card-grid .item-actions .mini-button,
body[data-current-view="image"] .image-result-card-grid .item-actions .link-button {
  width: 42px;
  height: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 7px;
  font-size: 0;
}

body[data-current-view="image"] .image-result-card-grid .item-actions .link-button {
  display: none;
}

body[data-current-view="image"] [data-copy-text]::before { content: "▣"; font-size: 18px; }
body[data-current-view="image"] [data-edit-image-result]::before { content: "⌁"; font-size: 20px; }
body[data-current-view="image"] [data-use-image-as-reference]::before { content: "▧"; font-size: 18px; }
body[data-current-view="image"] [data-save-image-result]::before { content: "▣"; font-size: 18px; }
body[data-current-view="image"] [data-download-image]::before { content: "↓"; font-size: 21px; }
body[data-current-view="image"] [data-delete-type="imageResult"]::before { content: "⌫"; font-size: 19px; color: #ff5555; }

body[data-current-view="image"] .empty-state {
  min-height: 666px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(50, 76, 126, 0.78);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 34%, rgba(74, 111, 255, 0.16), transparent 30%),
    rgba(6, 16, 34, 0.58);
  color: #c9d5e6;
  font-size: 18px;
  font-weight: 800;
}

@media (max-width: 1320px) {
  body[data-current-view="image"] #app {
    grid-template-columns: 204px minmax(0, 1fr);
  }

  body[data-current-view="image"] .image-generation-layout {
    grid-template-columns: 1fr !important;
  }
}
