:root {
  color-scheme: light;
  --bg: #fbf1e8;
  --ink: #2a241f;
  --soft-ink: #82766b;
  --line: #eadbd0;
  --panel: #fffaf4;
  --panel-strong: #fff3ea;
  --red: #ef4b43;
  --red-dark: #d93c35;
  --red-soft: #fff0ee;
  --gold: #b7834f;
  --shadow: 0 24px 70px rgba(77, 55, 38, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 94, 86, 0.22), transparent 26%),
    radial-gradient(circle at 76% 12%, rgba(190, 131, 76, 0.18), transparent 30%),
    linear-gradient(135deg, #fff6ee 0%, #faeadf 45%, #f8efe7 100%);
  overflow: hidden;
}

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

.login-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  width: min(880px, 100%);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 34px;
  background: rgba(255, 253, 249, 0.82);
  box-shadow: 0 34px 100px rgba(77, 55, 38, 0.18);
  backdrop-filter: blur(18px);
}

.login-brand-panel {
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(255, 85, 77, 0.92), rgba(255, 139, 94, 0.72)),
    #ff6b5e;
  padding: 36px;
  color: #fff;
}

.login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 28px;
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.72;
}

.orb-one {
  width: 260px;
  height: 260px;
  top: -70px;
  right: -62px;
  background: rgba(255, 239, 205, 0.36);
}

.orb-two {
  width: 180px;
  height: 180px;
  left: 38px;
  top: 72px;
  background: rgba(255, 255, 255, 0.18);
}

.login-brand-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
}

.login-brand-kicker {
  width: fit-content;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-brand-panel h1 {
  max-width: 320px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.login-preview-card {
  display: grid;
  gap: 10px;
  max-width: 330px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 48px rgba(109, 39, 28, 0.16);
  padding: 18px;
}

.login-preview-card span {
  width: 52px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

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

.login-preview-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
}

.login-form-panel {
  display: grid;
  align-content: center;
  gap: 28px;
  padding: 46px;
}

.login-form-head {
  display: grid;
  gap: 8px;
}

.login-form-head span {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-form-head h2 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -0.05em;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 900;
}

.login-form input {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.78);
  color: var(--ink);
  padding: 0 16px;
  outline: none;
}

.login-form input:focus {
  border-color: #ff7a66;
  box-shadow: 0 0 0 4px rgba(255, 122, 102, 0.14);
}

.login-hint {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .login-shell {
    padding: 18px;
  }

  .login-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .login-brand-panel {
    min-height: 260px;
    padding: 28px;
  }

  .login-form-panel {
    padding: 30px 24px 26px;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 58px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 22px;
  background: rgba(255, 250, 244, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab,
.settings-button,
.card-tab {
  border: 0;
  background: transparent;
  color: var(--soft-ink);
  border-radius: 8px;
  padding: 10px 12px;
}

.tab.active {
  color: var(--red);
  background: #fff;
  box-shadow: 0 8px 22px rgba(239, 75, 67, 0.12);
  font-weight: 700;
}

.settings-button {
  border: 1px solid var(--line);
  background: #fffaf4;
  color: var(--ink);
}

.home {
  width: min(1050px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 240px 0 90px;
}

.hero {
  text-align: center;
}

.pill {
  display: inline-flex;
  margin: 0 0 26px;
  color: var(--red);
  border: 1px solid rgba(239, 75, 67, 0.35);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 18px 0 44px;
  color: var(--soft-ink);
  font-size: 16px;
}

.link-card {
  width: min(880px, 100%);
  margin: 0 auto;
  overflow: hidden;
  text-align: left;
  background: rgba(255, 250, 244, 0.96);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card-tabs {
  display: flex;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.card-tab {
  border-radius: 0;
  padding: 17px 2px 14px;
}

.card-tab.active {
  color: var(--red);
  border-bottom: 2px solid var(--red);
  font-weight: 700;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf9;
  color: var(--ink);
  padding: 13px 14px;
  resize: vertical;
}

.link-card textarea {
  min-height: 130px;
  padding: 26px 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
}

textarea:focus,
input:focus {
  outline: 3px solid rgba(239, 75, 67, 0.16);
  border-color: var(--red);
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 26px 26px;
}

.card-actions p {
  margin: 0;
  color: #a79b91;
  font-size: 13px;
}

.primary {
  border: 0;
  background: linear-gradient(180deg, #ff665d, var(--red));
  color: #fff;
  border-radius: 10px;
  padding: 13px 21px;
  min-width: 150px;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(239, 75, 67, 0.26);
}

.primary:hover {
  background: linear-gradient(180deg, #f7554d, var(--red-dark));
}

.link-primary {
  display: inline-flex;
  justify-content: center;
  width: fit-content;
}

.results-shell {
  width: min(1920px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 16px 0 80px;
}

.results-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.results-title h1 {
  font-size: 22px;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-weight: 800;
}

.results-title .subtitle {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note-results {
  display: grid;
  gap: 20px;
}

.compose-board {
  display: grid;
  gap: 12px;
}

.compose-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 0 12px;
  background: rgba(255, 250, 244, 0.86);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(77, 55, 38, 0.06);
}

.status-left,
.status-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.save-pill,
.step-pill,
.tip-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
}

.save-pill {
  color: #168a46;
  background: #e8f8ed;
  border: 1px solid #9bd9b0;
}

.step-pill {
  color: #9a8d80;
  background: #fffdf9;
  border: 1px solid var(--line);
}

.step-pill.active,
.tip-pill {
  color: var(--red);
  background: #fff5f3;
  border: 1px solid #ffc7c2;
}

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

.editor-panel,
.preview-rail {
  display: grid;
  gap: 14px;
}

.editor-panel {
  min-height: 620px;
  padding: 24px;
  background: rgba(255, 250, 244, 0.97);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(77, 55, 38, 0.09);
}

.editor-field {
  display: grid;
  gap: 10px;
}

.editor-label {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--soft-ink);
  font-size: 13px;
}

.editor-label strong {
  color: var(--ink);
}

.editor-label span {
  justify-self: end;
}

.ai-dot {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #f3d6cf;
  border-radius: 10px;
  background: #fffaf8;
  color: var(--red);
  font-weight: 900;
}

.compose-input,
.compose-textarea {
  border-radius: 10px;
  background: #fff;
  border-color: #ecd9cf;
  font-size: 15px;
  line-height: 1.7;
}

.compose-input {
  min-height: 48px;
}

.compose-textarea {
  min-height: 168px;
}

.tag-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 58px;
  padding: 12px;
  border: 1px solid #ecd9cf;
  border-radius: 12px;
  background: #fff;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  color: #76685d;
  background: #f5efe8;
  border: 1px solid #eadfd5;
  font-size: 13px;
  font-weight: 700;
}

.tag-chip button {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ad9e91;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.tag-chip button:hover {
  color: var(--red);
  background: #fff;
}

.tag-inline-input {
  width: 130px;
  height: 30px;
  border: 1px dashed #dccbc0;
  border-radius: 999px;
  background: #fffdf9;
  padding: 0 12px;
  color: var(--ink);
  font-size: 13px;
}

.helper-text {
  margin: 0;
  color: #a79b91;
  font-size: 12px;
  line-height: 1.6;
}

.image-manager-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.editor-thumb,
.upload-card,
.image-empty {
  width: 118px;
  height: 154px;
  overflow: hidden;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fff;
}

.editor-image-card {
  position: relative;
  display: grid;
  gap: 7px;
  width: 118px;
}

.editor-image-card.selected .editor-thumb {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 75, 67, 0.1);
}

.editor-thumb {
  position: relative;
  display: block;
  padding: 0;
  cursor: zoom-in;
}

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

.editor-image-card.loading .editor-thumb img {
  filter: brightness(0.55);
}

.editor-thumb span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  min-width: 26px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(42, 36, 31, 0.72);
  font-size: 12px;
  text-align: center;
}

.image-ai-button {
  position: absolute;
  left: 50%;
  top: 58px;
  transform: translate(-50%, -50%);
  z-index: 2;
  min-width: 82px;
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  color: #fff;
  background: linear-gradient(180deg, #ff665d, var(--red));
  box-shadow: 0 10px 20px rgba(239, 75, 67, 0.28);
  font-size: 13px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
}

.editor-image-card:hover .image-ai-button,
.editor-image-card.loading .image-ai-button {
  opacity: 1;
  pointer-events: auto;
}

.image-toggle-button,
.origin-label {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  color: var(--soft-ink);
  font-size: 12px;
  font-weight: 800;
}

.origin-label {
  display: grid;
  place-items: center;
}

.image-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin 0.8s linear infinite;
}

.editor-image-card.loading .image-spinner {
  opacity: 1;
}

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

.upload-card,
.image-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: #9f9082;
}

.upload-card span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px dashed #dccbc0;
  border-radius: 12px;
  color: var(--red);
  font-size: 24px;
}

.upload-card strong {
  color: var(--ink);
  font-size: 13px;
}

.upload-card small {
  font-size: 12px;
}

.editor-actions {
  display: grid;
  grid-template-columns: 130px 1fr 110px;
  gap: 10px;
  margin-top: auto;
}

.secondary-action,
.soft-red-action {
  min-height: 42px;
  border-radius: 10px;
  padding: 0 14px;
  font-weight: 800;
}

.secondary-action {
  color: #6d6258;
  background: #fffdf9;
  border: 1px solid var(--line);
}

.soft-red-action {
  color: #fff;
  background: #ef827b;
  border: 0;
}

.action-generate {
  border-radius: 10px;
}

.preview-rail {
  position: sticky;
  top: 76px;
}

.phone-preview-card,
.publish-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.97);
  box-shadow: 0 18px 48px rgba(77, 55, 38, 0.11);
}

.preview-heading,
.publish-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.preview-heading strong,
.publish-head strong {
  color: var(--ink);
}

.preview-heading span,
.publish-head span {
  padding: 3px 8px;
  border-radius: 999px;
  color: #a09286;
  background: #f4ece4;
  font-size: 12px;
  font-weight: 700;
}

.preview-heading button {
  margin-left: auto;
  border: 1px solid #ffc7c2;
  border-radius: 999px;
  background: #fff5f3;
  color: var(--red);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.phone-frame {
  overflow: hidden;
  border: 1px solid #efe0d8;
  border-radius: 16px;
  background: #fff;
  max-height: 640px;
  overflow-y: auto;
}

.phone-top {
  height: 56px;
  display: grid;
  grid-template-columns: 24px 32px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.back-mark,
.share-mark {
  color: #6f6258;
  font-size: 24px;
}

.share-mark {
  font-size: 18px;
  text-align: right;
}

.avatar-badge {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #ff6b72, #e21f38);
  font-size: 14px;
  font-weight: 900;
}

.phone-top strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
}

.phone-top button {
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #ff4461;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.phone-image-wrap {
  position: relative;
  width: 100%;
  border: 0;
  padding: 0;
  background: #f6efe7;
  cursor: zoom-in;
}

.phone-image-wrap img,
.image-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.image-placeholder {
  display: grid;
  place-items: center;
  color: #a79b91;
}

.image-count {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  background: rgba(42, 36, 31, 0.56);
  font-size: 12px;
  font-weight: 800;
}

.phone-body {
  padding: 16px 16px 18px;
}

.phone-body h3 {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.45;
}

.phone-body p {
  margin: 0;
  color: #6a5f56;
  line-height: 1.65;
  font-size: 13px;
  white-space: pre-wrap;
}

.phone-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.phone-tags span {
  color: #5378b7;
  font-size: 12px;
}

.publish-card {
  display: grid;
  gap: 10px;
}

.publish-head {
  justify-content: space-between;
  margin-bottom: 0;
}

.publish-head span {
  color: #168a46;
  background: #e8f8ed;
}

.publish-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.prompt-modal {
  position: fixed;
  inset: 0;
  z-index: 38;
}

.prompt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 36, 31, 0.46);
  backdrop-filter: blur(8px);
}

.prompt-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 72px);
  margin: 36px auto;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(42, 36, 31, 0.25);
}

.prompt-head,
.prompt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.prompt-head h2 {
  font-size: 22px;
}

.prompt-head p {
  margin: 6px 0 0;
  color: var(--soft-ink);
  font-size: 13px;
}

.prompt-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--soft-ink);
  font-size: 20px;
}

.prompt-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
}

.prompt-list-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px 14px;
  background: #f8efe6;
  border-right: 1px solid var(--line);
}

.prompt-list-panel p {
  margin: 0;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.prompt-template-list {
  display: grid;
  gap: 9px;
}

.prompt-template-item {
  display: grid;
  gap: 5px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  padding: 12px;
}

.prompt-template-item.active {
  border-color: var(--line);
  background: #fffdf9;
  box-shadow: 0 10px 28px rgba(77, 55, 38, 0.07);
}

.prompt-template-item span {
  color: var(--soft-ink);
  font-size: 12px;
}

.prompt-add {
  border: 0;
  background: transparent;
  color: var(--soft-ink);
  text-align: left;
  padding: 8px 10px;
  font-weight: 800;
}

.prompt-editor-panel {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding: 18px 22px;
}

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

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

.reference-upload {
  display: grid;
  gap: 10px;
}

.reference-upload > button {
  min-height: 118px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed #dccbc0;
  border-radius: 13px;
  background: #fffdf9;
  color: var(--red);
  font-size: 24px;
}

.reference-upload > button span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.reference-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.reference-preview button {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0;
}

.reference-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.reference-preview span {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(42, 36, 31, 0.7);
  font-size: 12px;
}

.prompt-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: #fff8ef;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 19, 17, 0.74);
}

.image-viewer-stage {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 40px));
  height: calc(100vh - 90px);
  margin: 45px auto;
  display: grid;
  place-items: center;
}

.image-viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
}

.viewer-tool,
.viewer-nav {
  position: absolute;
  z-index: 2;
  border: 0;
  color: #fff;
  background: rgba(42, 36, 31, 0.68);
  border-radius: 50%;
}

.viewer-tool {
  top: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.viewer-tool.close {
  right: 12px;
}

.viewer-tool.download {
  right: 58px;
  font-size: 18px;
}

.viewer-nav {
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
  font-size: 34px;
}

.viewer-nav.prev {
  left: -62px;
}

.viewer-nav.next {
  right: -62px;
}

.viewer-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 6px 12px;
  color: #fff;
  background: rgba(42, 36, 31, 0.68);
  font-size: 13px;
  font-weight: 800;
}

.settings-page {
  background: #f5f7fb;
}

.settings-shell-page {
  width: min(1680px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 70px;
}

.settings-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 26px;
  border: 1px solid #dfe5ee;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(35, 45, 61, 0.07);
}

.settings-hero h1 {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}

.settings-hero p,
.settings-safe-tip,
.endpoint-editor-head p,
.cookie-card p {
  margin: 6px 0 0;
  color: #657287;
}

.back-button {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  background: #fff;
  font-weight: 800;
}

.settings-hero-actions {
  display: flex;
  gap: 10px;
}

.settings-safe-tip {
  padding: 15px 18px;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  background: #fff;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
}

.settings-tab {
  border: 1px solid #dfe5ee;
  border-radius: 999px;
  background: #fff;
  color: #657287;
  padding: 10px 16px;
  font-weight: 900;
}

.settings-tab.active {
  color: #fff;
  background: #101216;
  border-color: #101216;
}

.settings-workspace {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 20px;
}

.endpoint-list-panel,
.endpoint-editor-panel,
.cookie-card {
  border: 1px solid #dfe5ee;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(35, 45, 61, 0.06);
}

.panel-title,
.endpoint-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid #edf1f6;
}

.panel-title select,
.endpoint-editor-panel select {
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

.endpoint-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.endpoint-item {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
}

.endpoint-item.active {
  border-color: #4092ff;
  background: #eef6ff;
  box-shadow: 0 0 0 2px rgba(64, 146, 255, 0.12);
}

.endpoint-item span,
.endpoint-item small {
  color: #657287;
}

.endpoint-item em {
  position: absolute;
  top: 14px;
  right: 14px;
  border-radius: 999px;
  padding: 4px 10px;
  color: #178a4c;
  background: #eaf8ef;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.endpoint-editor-panel {
  display: grid;
  align-content: start;
  gap: 22px;
  padding-bottom: 24px;
}

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

.danger-action {
  min-height: 42px;
  border: 1px solid #ffd3cf;
  border-radius: 10px;
  background: #fff4f3;
  color: #df4237;
  padding: 0 14px;
  font-weight: 900;
}

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

.endpoint-editor-panel > label {
  padding: 0 22px;
}

.settings-page input,
.settings-page textarea {
  border-color: #dfe5ee;
  background: #fff;
}

.selected-api-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 22px;
}

.selected-api-grid div {
  display: grid;
  gap: 6px;
  border: 1px solid #dfe5ee;
  border-radius: 12px;
  background: #f8fafc;
  padding: 15px;
}

.selected-api-grid span {
  color: #657287;
  font-size: 13px;
}

.cookie-workspace {
  display: grid;
  grid-template-columns: minmax(0, 850px);
}

.cookie-card {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.settings-page {
  background: var(--bg);
}

.settings-shell-page {
  width: min(1180px, calc(100vw - 28px));
  padding: 58px 0 90px;
}

.settings-page .topbar {
  background: rgba(255, 250, 244, 0.9);
  border-bottom-color: var(--line);
}

.combo-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: rgba(255, 250, 244, 0.96);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.combo-hero .pill {
  margin-bottom: 14px;
}

.combo-hero h1 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.combo-hero p {
  color: var(--soft-ink);
}

.settings-tabs {
  margin: 22px 0 16px;
}

.settings-tab {
  border-color: var(--line);
  color: var(--soft-ink);
  background: #fffaf4;
}

.settings-tab.active {
  color: var(--red);
  background: #fff;
  border-color: #ffc7c2;
  box-shadow: 0 8px 22px rgba(239, 75, 67, 0.12);
}

.combo-workspace {
  grid-template-columns: 340px minmax(0, 1fr);
}

.endpoint-list-panel,
.combo-editor-panel,
.cookie-card {
  border-color: var(--line);
  background: rgba(255, 250, 244, 0.96);
  box-shadow: 0 18px 48px rgba(77, 55, 38, 0.09);
}

.panel-title,
.combo-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-title span {
  color: var(--soft-ink);
  font-size: 13px;
}

.combo-editor-panel {
  display: grid;
  gap: 18px;
  padding-bottom: 22px;
}

.combo-editor-head h2,
.cookie-card h2 {
  font-size: 24px;
}

.combo-editor-head p,
.cookie-card p {
  color: var(--soft-ink);
}

.combo-name-field,
.combo-editor-panel > label {
  padding: 0 22px;
}

.combo-endpoint-card {
  margin: 0 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
}

.image-combo-card {
  background: #fff6ef;
}

.text-combo-card {
  background: #fffdf9;
}

.combo-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.combo-section-title strong {
  color: var(--red);
  font-size: 18px;
}

.combo-section-title span {
  color: var(--soft-ink);
  font-size: 13px;
}

.combo-item {
  border-color: var(--line);
  background: #fffdf9;
}

.combo-item.active {
  border-color: var(--red);
  background: #fff5f3;
  box-shadow: 0 0 0 3px rgba(239, 75, 67, 0.1);
}

.combo-item span,
.combo-item small {
  color: var(--soft-ink);
}

.combo-item em {
  color: #168a46;
  background: #e8f8ed;
}

.settings-page input,
.settings-page textarea {
  border-color: var(--line);
  background: #fff;
}

.settings-page input:focus,
.settings-page textarea:focus {
  outline: 3px solid rgba(239, 75, 67, 0.16);
  border-color: var(--red);
}

.publish-page {
  background: var(--bg);
}

.publish-shell {
  width: min(980px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 56px 0 90px;
}

.publish-list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 18px;
}

.publish-list-head h1 {
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
}

.publish-list-head p {
  margin: 8px 0 0;
  color: var(--soft-ink);
}

.publish-list-head input {
  width: min(320px, 100%);
  background: #fffdf9;
}

.publish-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 22px;
}

.filter-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf9;
  color: var(--soft-ink);
  padding: 9px 13px;
  font-weight: 800;
}

.filter-pill.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.publish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.publish-mini-card {
  display: grid;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 244, 0.96);
  box-shadow: 0 16px 40px rgba(77, 55, 38, 0.09);
  padding: 10px;
}

.mini-image {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #f6efe7;
}

.mini-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.mini-image span {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  background: rgba(42, 36, 31, 0.6);
  font-size: 12px;
  font-weight: 900;
}

.publish-mini-card strong {
  min-height: 42px;
  font-size: 14px;
  line-height: 1.5;
}

.mini-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--soft-ink);
  font-size: 12px;
}

.mini-foot em {
  border-radius: 999px;
  padding: 4px 8px;
  color: #168a46;
  background: #e8f8ed;
  font-style: normal;
  font-weight: 900;
}

.publish-detail {
  position: fixed;
  inset: 0;
  z-index: 42;
}

.publish-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 36, 31, 0.34);
  backdrop-filter: blur(7px);
}

.publish-detail-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(560px, 100vw);
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  background: #fffdf9;
  box-shadow: -24px 0 70px rgba(42, 36, 31, 0.18);
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.detail-head h2 {
  font-size: 16px;
}

.detail-head button {
  border: 0;
  background: transparent;
  color: var(--soft-ink);
  font-size: 22px;
}

.detail-image-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  background: #fffaf4;
}

.detail-image-stage img {
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
}

.detail-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 20px;
}

.detail-thumbs button {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #fff;
  padding: 0;
}

.detail-thumbs button.active {
  border-color: var(--red);
}

.detail-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-content {
  overflow-y: auto;
  padding: 10px 22px 28px;
}

.detail-actions-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.detail-content h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.detail-content p {
  white-space: pre-wrap;
  color: #5f554d;
  line-height: 1.75;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.detail-tags span {
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.detail-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fff8ef;
}

.detail-footer.single {
  grid-template-columns: 1fr;
}

.detail-footer a.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.publish-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.publish-qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 36, 31, 0.38);
  backdrop-filter: blur(8px);
}

.publish-qr-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(440px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fffdf9;
  box-shadow: 0 28px 80px rgba(42, 36, 31, 0.24);
  transform: translate(-50%, -50%);
}

.qr-status {
  padding: 18px 22px 0;
  color: var(--soft-ink);
  line-height: 1.7;
}

.qr-body {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
}

.qr-image-wrap {
  display: grid;
  place-items: center;
  border: 1px dashed #efb7ab;
  border-radius: 18px;
  background: #fff8ef;
  padding: 18px;
}

.qr-image-wrap img {
  width: min(260px, 80vw);
  height: auto;
}

.share-url-field {
  display: grid;
  gap: 8px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.share-url-field input {
  width: 100%;
}

.qr-warning,
.mobile-missing {
  display: grid;
  gap: 8px;
  border-radius: 14px;
  background: #fff2df;
  color: #8a4a16;
  padding: 12px;
  line-height: 1.6;
}

.qr-warning.success {
  background: #eaf8ef;
  color: #17653a;
}

.qr-warning.success span {
  background: #d5f0de;
}

.qr-warning span,
.mobile-missing span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #ffe1ca;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.qr-warning small {
  color: #9b6a3c;
}

.qr-error {
  color: var(--red);
  line-height: 1.7;
}

.mobile-share-page {
  min-height: 100vh;
  background: var(--bg);
}

.mobile-share-shell {
  width: min(520px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.mobile-share-card {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 20px 60px rgba(77, 55, 38, 0.12);
  padding: 22px;
}

.mobile-share-card h1 {
  font-size: 24px;
  line-height: 1.35;
}

.mobile-share-card > p {
  color: var(--soft-ink);
  line-height: 1.7;
}

.mobile-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mobile-quick-actions .wide {
  grid-column: 1 / -1;
}

.mobile-preview {
  display: grid;
  gap: 14px;
}

.mobile-section,
.mobile-publish-steps {
  display: grid;
  gap: 10px;
  border: 1px solid #f1dfcd;
  border-radius: 18px;
  background: #fffaf4;
  padding: 14px;
}

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

.mobile-section-head strong,
.mobile-publish-steps strong {
  font-size: 15px;
}

.mobile-section-head span,
.mobile-publish-steps span {
  color: var(--soft-ink);
  font-size: 13px;
  line-height: 1.6;
}

.mobile-copy-box {
  border-radius: 14px;
  background: #fff;
  color: #5f554d;
  padding: 12px;
  white-space: pre-wrap;
  line-height: 1.75;
}

.mobile-image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mobile-image-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  object-fit: cover;
  background: #f6efe7;
}

.mobile-image-item {
  display: grid;
  gap: 8px;
}

.mobile-image-item a {
  display: block;
}

.mobile-image-item button {
  min-height: 38px;
  padding: 8px 10px;
  font-size: 12px;
}

.mobile-empty {
  grid-column: 1 / -1;
  border-radius: 14px;
  background: #fff;
  color: var(--soft-ink);
  padding: 18px;
  text-align: center;
}

@media (max-width: 420px) {
  .mobile-share-shell {
    width: min(100% - 20px, 520px);
    padding: 14px 0 28px;
  }

  .mobile-share-card {
    border-radius: 20px;
    padding: 16px;
  }

  .mobile-quick-actions {
    grid-template-columns: 1fr;
  }
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
}

.toggle-line input {
  width: 18px;
  height: 18px;
}

.image-page {
  background:
    linear-gradient(rgba(232, 221, 210, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 221, 210, 0.18) 1px, transparent 1px),
    var(--bg);
  background-size: 52px 52px;
}

.image-shell {
  width: min(920px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 250px 0 90px;
}

.image-hero {
  text-align: center;
}

.image-hero h1 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 400;
}

.image-hero > p {
  margin: 18px 0 54px;
  color: var(--soft-ink);
}

.image-generator-card {
  overflow: hidden;
  width: min(720px, 100%);
  margin: 0 auto;
  border: 2px solid #ffc7c2;
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.96);
  box-shadow: 0 28px 72px rgba(77, 55, 38, 0.12);
}

.image-generator-card textarea {
  min-height: 136px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #fffdf9, #fff7ef);
  padding: 24px;
}

.image-options-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}

.segmented-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.segmented-group span {
  color: var(--soft-ink);
  font-size: 13px;
}

.segmented-group button,
.image-options-row select {
  min-width: 42px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffdf9;
  color: var(--ink);
  font-weight: 900;
}

.segmented-group button.active,
.image-options-row select:focus {
  color: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239, 75, 67, 0.12);
}

.muted-action {
  color: #b8aea4;
}

.reference-strip {
  width: min(720px, 100%);
  margin: 18px auto 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.reference-strip img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.generated-grid {
  width: min(920px, 100%);
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.generated-card,
.generated-placeholder {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
  box-shadow: 0 16px 40px rgba(77, 55, 38, 0.08);
}

.generated-card img,
.generated-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.generated-placeholder {
  background: linear-gradient(90deg, #fff6ef, #fffdf9, #fff6ef);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

.upload-dialog {
  position: relative;
  z-index: 1;
  width: min(620px, calc(100vw - 32px));
  margin: 90px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(42, 36, 31, 0.25);
}

.drop-zone {
  margin: 22px;
  min-height: 250px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 2px dashed #efc2ba;
  border-radius: 18px;
  background: #fff8ef;
  cursor: pointer;
}

.drop-zone.dragging {
  border-color: var(--red);
  background: #fff0ee;
}

.drop-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--red);
  background: #fff;
  font-size: 30px;
}

.drop-zone p {
  margin: 0;
  color: var(--soft-ink);
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 22px 22px;
}

.upload-preview button {
  position: relative;
  width: 78px;
  height: 78px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview span {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(42, 36, 31, 0.68);
}

.image-result-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 70px 0 90px;
}

.image-result-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 22px;
}

.image-result-head .pill {
  margin-bottom: 12px;
}

.image-result-head h1 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 400;
}

.image-result-head p {
  margin: 8px 0 0;
  color: var(--soft-ink);
}

.job-prompt-card {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 244, 0.96);
  box-shadow: 0 14px 36px rgba(77, 55, 38, 0.08);
}

.job-prompt-card p {
  margin: 0;
  color: var(--soft-ink);
}

.image-job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.image-job-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.96);
  box-shadow: 0 18px 48px rgba(77, 55, 38, 0.1);
}

.image-job-stage {
  display: grid;
  place-items: center;
  min-height: 320px;
  background: #fff8ef;
}

.image-job-stage img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.image-job-loader {
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--soft-ink);
  font-weight: 800;
}

.image-job-loader i {
  width: 44px;
  height: 44px;
  border: 4px solid #f4d5cc;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.image-job-card.failed .image-job-loader i {
  display: none;
}

.image-job-card.failed .image-job-loader {
  color: var(--red);
}

.image-job-meta,
.image-job-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
}

.image-job-meta span {
  color: var(--soft-ink);
  font-size: 13px;
}

.image-job-actions {
  padding-top: 0;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.note-card,
.empty-card {
  background: rgba(255, 250, 244, 0.96);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(77, 55, 38, 0.09);
  padding: 24px;
}

.empty-card {
  display: grid;
  gap: 14px;
}

.empty-card p {
  margin: 0;
  color: var(--soft-ink);
}

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

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  color: var(--soft-ink);
  font-size: 13px;
}

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

.field-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf9;
  padding: 16px;
}

.images-block {
  background: var(--panel-strong);
}

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

.field-head strong {
  color: var(--red);
}

.ghost {
  border: 1px solid rgba(239, 75, 67, 0.35);
  background: var(--red-soft);
  color: var(--red);
  border-radius: 9px;
  padding: 8px 11px;
  font-weight: 700;
}

.text-box,
.rewrite-box {
  white-space: pre-wrap;
  line-height: 1.7;
}

.rewrite-box {
  margin-top: 12px;
  padding: 13px;
  border-radius: 12px;
  background: #fff6df;
  color: #4b3621;
}

.rewrite-label {
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

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

.topic {
  background: var(--red-soft);
  color: var(--red);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

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

.image-link {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: #fffaf4;
  border: 1px solid var(--line);
}

.image-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(42, 36, 31, 0.3);
}

.settings-card {
  width: min(620px, 100%);
  display: grid;
  gap: 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.settings-head button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--soft-ink);
  font-size: 14px;
}

.settings-hint {
  min-height: 20px;
  color: var(--soft-ink);
  font-size: 13px;
}

.wide {
  width: 100%;
}

.bad {
  color: #c9372c !important;
}

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

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 12px;
  }

  .tab {
    padding: 9px 8px;
  }

  .home {
    padding-top: 120px;
  }

  .card-actions,
  .field-head,
  .note-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .primary {
    width: 100%;
  }

  .results-shell {
    padding-top: 38px;
  }

  .results-title,
  .compose-statusbar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .editor-panel,
  .phone-preview-card,
  .publish-card {
    padding: 16px;
  }

  .editor-actions,
  .publish-row {
    grid-template-columns: 1fr;
  }

  .preview-rail {
    position: static;
  }

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

  .viewer-nav.prev {
    left: 10px;
  }

  .viewer-nav.next {
    right: 10px;
  }

  .settings-shell-page {
    width: min(100vw - 24px, 760px);
  }

  .settings-hero,
  .settings-workspace,
  .form-grid,
  .selected-api-grid,
  .cookie-workspace {
    grid-template-columns: 1fr;
  }

  .settings-hero-actions,
  .endpoint-editor-head,
  .endpoint-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .endpoint-editor-head {
    display: grid;
  }
}
