:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --line: #d9dee7;
  --text: #1f2937;
  --muted: #667085;
  --brand: #f05a43;
  --brand-dark: #c83f2d;
  --accent: #2563eb;
  --accent-soft: #e9f0ff;
  --success: #087443;
  --success-soft: #e8f5ee;
  --warning: #9a5b00;
  --warning-soft: #fff5d6;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.giraffe-logo {
  overflow: hidden;
}

.giraffe-logo svg {
  width: 38px;
  height: 38px;
  transform: translate(-1px, 1px);
}

.giraffe-logo .giraffe-neck,
.giraffe-logo .giraffe-head {
  fill: #f8c66d;
  stroke: #5b3b12;
  stroke-width: 2.2;
  stroke-linejoin: round;
}

.giraffe-logo .giraffe-horn {
  fill: none;
  stroke: #5b3b12;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.giraffe-logo .giraffe-spot {
  fill: #9a5b16;
}

.giraffe-logo .giraffe-eye {
  fill: #111827;
}

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

.brand strong {
  font-size: 0.96rem;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.topnav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topnav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  padding: 9px 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.topnav a {
  color: var(--muted);
}

.topnav a.active,
.topnav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.button {
  border: 1px solid transparent;
}

.button:disabled,
.mini-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.button.primary {
  background: var(--brand);
  color: #fff;
}

.button.primary:hover {
  background: var(--brand-dark);
}

.button.secondary {
  border-color: #b9c6f5;
  background: var(--accent-soft);
  color: var(--accent);
}

.button.secondary:hover {
  border-color: var(--accent);
}

.button.ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.button.ghost:hover {
  color: var(--text);
  border-color: #aab2c0;
}

.button.wide {
  width: 100%;
}

.overview-grid,
.workbench-grid {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
}

.workbench-grid {
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  align-items: start;
}

.ak-workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.span-all {
  grid-column: 1 / -1;
}

.hero-panel,
.note-panel,
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 34px;
}

.note-panel,
.panel {
  padding: 22px;
}

.panel.compact {
  position: sticky;
  top: 16px;
}

@media (min-width: 981px) {
  .workbench-grid {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 378px;
  }

  .panel.compact {
    position: fixed;
    top: 110px;
    left: max(16px, calc((100vw - 1440px) / 2));
    z-index: 30;
    width: 360px;
    max-height: calc(100vh - 126px);
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 1.65rem;
  line-height: 1.25;
}

.hero-panel h1 {
  max-width: 840px;
  font-size: 2.35rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.22rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lede {
  max-width: 920px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.8;
}

.hero-actions,
.actions,
.action-strip,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 22px;
}

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

.status-pill,
.meta-row span,
.file-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.meta-row {
  margin-top: 12px;
}

.meta-row span,
.file-pill {
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

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

.workflow-card {
  display: block;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--panel-soft);
  text-decoration: none;
}

.workflow-card:hover {
  border-color: #b9c6f5;
}

.workflow-card p,
.clean-list,
.steps span,
small {
  color: var(--muted);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.clean-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.steps li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}

.steps li::before {
  counter-increment: steps;
  content: counter(steps);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-weight: 800;
}

.steps strong,
.steps span {
  display: block;
}

.stack-form,
.flow-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

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

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

.mode-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.mode-tab.active {
  border-color: #b9c6f5;
  background: var(--accent-soft);
  color: var(--accent);
}

.mode-tab input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

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

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

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

.field span {
  color: #344054;
  font-size: 0.9rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 3px solid rgba(37, 99, 235, 0.14);
  border-color: var(--accent);
}

.action-strip {
  margin: 16px 0;
}

.account-list,
.queue-list,
.thumb-grid {
  display: grid;
  gap: 10px;
}

.account-list.empty,
.queue-list.empty,
.thumb-grid.empty {
  min-height: 112px;
  place-items: center;
  border: 1px dashed #c8cfda;
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.account-card,
.queue-card,
.thumb-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.account-card,
.queue-card {
  padding: 14px;
}

.account-top,
.queue-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.account-name,
.queue-title {
  margin: 0;
  font-weight: 800;
}

.account-note,
.queue-detail {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-actions,
.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mini-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.mini-button:hover {
  color: var(--text);
  border-color: #aab2c0;
}

.mini-button.danger {
  color: var(--danger);
  border-color: #f2b8b5;
  background: var(--danger-soft);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.subhead {
  margin: 0 0 10px;
}

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

.thumb-card {
  overflow: hidden;
  position: relative;
}

.thumb-card img,
.thumb-card video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e5e7eb;
}

.thumb-body {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.thumb-body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.thumb-body span {
  color: var(--muted);
  font-size: 0.8rem;
}

.thumb-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.18);
}

.thumb-remove:hover {
  background: #dc2626;
  border-color: #fff;
}

.queue-list:not(.empty) {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.queue-card[data-status="ready"] {
  border-color: #b7dfc8;
}

.queue-card[data-status="blocked"] {
  border-color: #f2b8b5;
}

.queue-index {
  color: var(--accent);
  font-weight: 800;
}

.api-result {
  margin-top: 18px;
  min-height: 160px;
  border: 1px dashed #c8cfda;
  border-radius: 8px;
  padding: 16px;
  background: var(--panel-soft);
  color: var(--muted);
}

.api-result pre {
  max-height: 320px;
  overflow: auto;
  margin: 10px 0 0;
  border-radius: 8px;
  padding: 12px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.api-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.api-images img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e5e7eb;
}

.bean-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-top: 18px;
  border: 1px solid #f0d6a6;
  border-radius: 8px;
  padding: 16px;
  background: #fffaf0;
}

.bean-panel h3 {
  margin-bottom: 6px;
}

.bean-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.bean-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.compact-preview {
  margin-top: 18px;
}

.image-workbench-panel {
  padding: 16px;
  border-color: #b9c6f5;
  transition: border-color 160ms ease, background 160ms ease;
}

.image-workbench-panel.mode-kit {
  border-color: #b9c6f5;
  background: linear-gradient(180deg, #f7faff 0, #fff 170px);
}

.image-workbench-panel.mode-clone {
  border-color: #f3c38d;
  background: linear-gradient(180deg, #fff8f1 0, #fff 170px);
}

.image-workbench-panel .section-head {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.image-workbench-panel.mode-kit .section-head {
  border-bottom-color: #d8e2ff;
}

.image-workbench-panel.mode-clone .section-head {
  border-bottom-color: #f4d6b4;
}

.image-workbench-panel .eyebrow {
  margin-bottom: 3px;
  font-size: 0.68rem;
}

.image-workbench-panel h1 {
  margin-bottom: 0;
  font-size: 1.34rem;
}

.image-workbench-panel.mode-kit h1 {
  color: #1d4ed8;
}

.image-workbench-panel.mode-clone h1 {
  color: #b45309;
}

.image-workbench-panel .flow-grid {
  gap: 9px 10px;
}

.image-workbench-panel .mode-tabs {
  gap: 8px;
}

.image-workbench-panel .mode-tab {
  position: relative;
  overflow: hidden;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 0.86rem;
}

.image-workbench-panel .mode-tab::before {
  content: "";
  width: 4px;
  align-self: stretch;
  border-radius: 999px;
  background: #c8cfda;
}

.image-workbench-panel .mode-tab.kit-tab::before {
  background: #3b82f6;
}

.image-workbench-panel .mode-tab.clone-tab::before {
  background: #f59e0b;
}

.image-workbench-panel .mode-tab.kit-tab.active {
  border-color: #93b7ff;
  background: #eff5ff;
  color: #1d4ed8;
}

.image-workbench-panel .mode-tab.clone-tab.active {
  border-color: #f3c38d;
  background: #fff4e6;
  color: #b45309;
}

.image-workbench-panel .mode-tab input {
  width: 14px;
  height: 14px;
}

.image-workbench-panel .mode-note {
  border: 1px solid #d8e2ff;
  border-radius: 7px;
  padding: 7px 9px;
  background: #eff5ff;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 800;
}

.image-workbench-panel.mode-clone .mode-note {
  border-color: #f3c38d;
  background: #fff4e6;
  color: #b45309;
}

.image-workbench-panel .field {
  gap: 4px;
}

.image-workbench-panel .field span {
  font-size: 0.82rem;
}

.image-workbench-panel .field input,
.image-workbench-panel .field textarea,
.image-workbench-panel .field select {
  min-height: 34px;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 0.86rem;
}

.image-workbench-panel textarea[name="productInfo"],
.image-workbench-panel textarea[name="referenceInfo"] {
  min-height: 86px;
}

.token-login {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 9px;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 9px;
  background: #111827;
}

.token-login .field {
  gap: 4px;
}

.token-login .field span {
  color: #fff;
}

.image-workbench-panel .token-login input {
  min-height: 32px;
  border-color: #334155;
  background: #ffffff;
}

.token-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.token-login .button {
  min-height: 32px;
  white-space: nowrap;
}

.token-login .button.secondary {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1d4ed8;
}

.token-login .button.ghost {
  border-color: #475569;
  background: #1f2937;
  color: #e5e7eb;
}

.token-login .status-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
}

.token-login .status-pill.success {
  background: rgba(16, 185, 129, 0.16);
  color: #bbf7d0;
}

.image-workbench-panel small {
  font-size: 0.74rem;
  line-height: 1.45;
}

.image-workbench-panel .actions {
  gap: 7px;
}

.image-workbench-panel .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.image-workbench-panel .status-pill {
  padding: 5px 8px;
  font-size: 0.76rem;
}

.image-workbench-panel .status-pill.kit {
  background: #e9f0ff;
  color: #1d4ed8;
}

.image-workbench-panel .status-pill.clone {
  background: #fff4e6;
  color: #b45309;
}

.kit-structure {
  border: 1px solid #d8e2ff;
  border-radius: 8px;
  padding: 8px 9px;
  background: #f8fbff;
}

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

.structure-head span,
.structure-head strong {
  color: #1d4ed8;
  font-size: 0.84rem;
  font-weight: 800;
}

.structure-head small {
  display: block;
  margin-top: 2px;
}

.structure-head strong {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #e9f0ff;
}

.structure-head strong.danger,
.kit-structure small.danger {
  color: var(--danger);
}

.structure-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 7px;
}

.structure-mode label,
.structure-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid #d8e2ff;
  border-radius: 7px;
  padding: 6px 8px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.structure-mode input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.structure-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.structure-grid label {
  justify-content: space-between;
  flex: 0 0 112px;
  min-height: 30px;
  padding: 4px 6px 4px 8px;
  border-color: #dce5ff;
  background: rgba(255, 255, 255, 0.86);
}

.structure-grid span {
  white-space: nowrap;
  color: #475467;
  font-size: 0.76rem;
}

.image-workbench-panel .structure-grid input {
  width: 42px;
  min-height: 24px;
  border-radius: 6px;
  padding: 2px 4px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
}

.image-workbench-panel .structure-grid input:disabled {
  border-color: #e1e7f2;
  background: #f6f8fc;
  color: #98a2b3;
}

.image-workbench-panel.mode-kit .field input:focus,
.image-workbench-panel.mode-kit .field textarea:focus,
.image-workbench-panel.mode-kit .field select:focus {
  outline-color: rgba(37, 99, 235, 0.14);
  border-color: #3b82f6;
}

.image-workbench-panel.mode-clone .field input:focus,
.image-workbench-panel.mode-clone .field textarea:focus,
.image-workbench-panel.mode-clone .field select:focus {
  outline-color: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
}

.image-workbench-panel .bean-panel {
  margin-top: 12px;
  padding: 10px 12px;
}

.image-workbench-panel .bean-panel h3 {
  margin-bottom: 2px;
  font-size: 0.92rem;
}

.image-workbench-panel .bean-panel p {
  font-size: 0.8rem;
}

.image-workbench-panel .bean-actions {
  gap: 7px;
}

.image-workbench-panel .compact-preview {
  margin-top: 12px;
}

.image-workbench-panel .preview-grid {
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 0;
}

.image-workbench-panel .subhead {
  margin-bottom: 6px;
  font-size: 0.86rem;
}

.image-workbench-panel .thumb-grid.empty {
  min-height: 74px;
  padding: 10px;
  font-size: 0.8rem;
}

.image-workbench-panel .thumb-grid {
  gap: 7px;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
}

.image-workbench-panel .inline-preview {
  margin-top: 4px;
  border: 1px dashed #c8cfda;
  border-radius: 7px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.image-workbench-panel .inline-preview.empty {
  min-height: 54px;
}

.image-workbench-panel .inline-preview:not(.empty) {
  border-style: solid;
  border-color: #d8e2ff;
  background: #f8fbff;
}

.image-workbench-panel.mode-clone .inline-preview:not(.empty) {
  border-color: #f4d6b4;
  background: #fffaf4;
}

.image-workbench-panel .thumb-body {
  padding: 6px;
}

.image-workbench-panel .thumb-body strong {
  font-size: 0.76rem;
}

.image-workbench-panel .thumb-body span {
  font-size: 0.7rem;
}

.image-workbench-panel .thumb-remove {
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  font-size: 12px;
}

.image-workbench-panel .api-result {
  min-height: 54px;
  margin-top: 0;
  padding: 8px 10px;
  font-size: 0.8rem;
}

.image-workbench-panel .api-images {
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 7px;
}

.result-compact {
  display: grid;
  gap: 2px;
  border-radius: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: #fff;
}

.result-compact strong {
  font-size: 0.9rem;
  font-weight: 900;
}

.result-compact span,
.result-compact small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-compact.success {
  border-color: #b7dfc8;
  background: #f3fbf6;
}

.result-compact.success strong {
  color: var(--success);
}

.result-compact.danger {
  border-color: #f2b8b5;
  background: #fff7f6;
}

.result-compact.danger strong {
  color: var(--danger);
}

.submit-toast {
  position: fixed;
  right: 24px;
  top: 84px;
  z-index: 80;
  display: grid;
  gap: 3px;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(16, 24, 40, 0.16);
}

.submit-toast strong {
  font-size: 0.98rem;
  font-weight: 900;
}

.submit-toast span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.submit-toast.success {
  border-color: #b7dfc8;
  background: #f3fbf6;
}

.submit-toast.success strong {
  color: var(--success);
}

.submit-toast.danger {
  border-color: #f2b8b5;
  background: #fff7f6;
}

.submit-toast.danger strong {
  color: var(--danger);
}

.submit-toast.warning {
  border-color: #f0d6a6;
  background: #fffaf0;
}

.submit-toast.warning strong {
  color: var(--warning);
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.42);
}

.confirm-card {
  width: min(380px, 100%);
  border: 1px solid #f2b8b5;
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 22px 58px rgba(16, 24, 40, 0.22);
}

.confirm-card strong {
  display: block;
  color: var(--danger);
  font-size: 1rem;
}

.confirm-card p {
  margin: 8px 0 16px;
  color: var(--text);
  font-size: 0.9rem;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.button.danger-action {
  background: var(--danger);
  color: #fff;
}

.button.danger-action:hover {
  background: #8f1b13;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -6px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.history-toolbar span {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
}

.history-download-stack,
.history-select-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-download-stack span,
.history-select-stack span {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-toolbar small {
  text-align: right;
}

.history-date-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.history-date-filter > div,
.history-date-filter label {
  display: grid;
  gap: 3px;
  margin: 0;
}

.history-date-filter span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.history-date-filter strong {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 900;
}

.history-date-filter input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 9px;
  background: var(--panel-soft);
  color: var(--text);
}

.history-status-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.history-action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: -2px 0 12px;
}

.history-action-row .button {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.history-status-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.history-status-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.history-status-tab span {
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-status-tab strong {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  font-weight: 900;
}

.history-status-tab.accent {
  border-color: #b9c6f5;
  background: #f4f7ff;
  color: #2547b8;
}

.history-status-tab.warning {
  border-color: #f0d6a6;
  background: #fff8e8;
  color: #9a5b00;
}

.history-status-tab.success {
  border-color: #b7dfc8;
  background: #eefaf3;
  color: var(--success);
}

.history-status-tab.active {
  border-width: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.86), 0 8px 18px rgba(16, 24, 40, 0.08);
}

.history-list {
  display: grid;
  gap: 9px;
  max-height: 680px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.history-list.empty {
  max-height: none;
  overflow: hidden;
  min-height: 96px;
  place-items: center;
  border: 1px dashed #c8cfda;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.history-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-soft);
}

.history-card.accent {
  border-color: #b9c6f5;
  background: #f4f7ff;
}

.history-card.warning {
  border-color: #f0d6a6;
  background: #fffaf0;
}

.history-card.success {
  border-color: #b7dfc8;
  background: #f3fbf6;
}

.history-card.danger {
  border-color: #f2b8b5;
  background: #fff7f6;
}

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

.history-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 800;
}

.history-meta,
.history-detail {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.history-success-time {
  display: inline-flex;
  width: fit-content;
  margin: 5px 0 0;
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  font-size: 0.78rem;
  font-weight: 850;
}

.history-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-support {
  margin: 8px 0 0;
  border: 1px solid #f2b8b5;
  border-radius: 7px;
  padding: 7px 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 800;
}

.history-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 92px));
  gap: 6px;
  margin-top: 8px;
}

.history-image {
  position: relative;
  overflow: hidden;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.history-image:hover,
.history-image:focus-visible {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.1);
  outline: none;
}

.history-image.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.history-image img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #e5e7eb;
}

.history-image figcaption {
  overflow: hidden;
  padding: 4px 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-check,
.image-open {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(17, 24, 39, 0.68);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}

.image-check {
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
}

.history-image.selected .image-check {
  border-color: #fff;
  background: var(--accent);
}

.image-open {
  left: 5px;
  bottom: 24px;
  border-radius: 999px;
  padding: 2px 6px;
  text-decoration: none;
}

.history-empty {
  margin-top: 8px;
  border: 1px dashed #c8cfda;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.history-countdown {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 8px 0 0;
  border: 1px solid #f0d6a6;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff8e8;
  color: #a15c07;
  font-size: 0.78rem;
  font-weight: 800;
}

.history-countdown.busy {
  border-color: #b9c6f5;
  background: #f4f7ff;
  color: #3957c8;
}

.history-compact-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.history-compact-meta span {
  overflow: hidden;
  max-width: 240px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  background: #fff;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-items {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.history-items span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  background: #fff;
  color: var(--muted);
  font-size: 0.74rem;
}

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

.history-actions .mini-button.primary {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

@media (max-width: 980px) {
  .overview-grid,
  .workbench-grid,
  .ak-workspace,
  .cards.two-col,
  .flow-grid,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .workbench-grid {
    padding-left: 0;
  }

  .panel.compact {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
  }

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

  .image-workbench-panel .preview-grid {
    grid-template-columns: 1fr;
  }

  .structure-grid label {
    flex-basis: 108px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: 100%;
    padding: 8px 10px 22px;
  }

  .topbar,
  .section-head,
  .bean-panel,
  .account-top,
  .queue-top {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 10px;
    min-height: auto;
    margin-bottom: 10px;
    padding: 10px;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  }

  .brand {
    gap: 9px;
  }

  .brand-mark {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  .brand strong {
    font-size: 0.9rem;
    line-height: 1.25;
  }

  .brand small {
    display: none;
  }

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

  .topnav a {
    width: 100%;
    min-height: 34px;
    padding: 7px 6px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .button {
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    font-size: 0.86rem;
  }

  .hero-panel,
  .note-panel,
  .panel {
    padding: 12px;
  }

  .hero-panel h1 {
    font-size: 1.8rem;
  }

  .ak-workspace {
    gap: 10px;
  }

  .image-workbench-panel {
    width: 100%;
    padding: 12px;
    background-size: 100% 120px;
  }

  .image-workbench-panel .section-head {
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
  }

  .image-workbench-panel h1 {
    font-size: 1.16rem;
  }

  .image-workbench-panel .flow-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .field-full {
    grid-column: 1;
  }

  .token-login {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
  }

  .token-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 7px;
  }

  .token-actions .status-pill {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .token-login .button {
    min-width: 0;
    white-space: normal;
  }

  .image-workbench-panel .mode-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .image-workbench-panel .mode-tab {
    min-width: 0;
    min-height: 38px;
    padding: 8px;
    gap: 7px;
    font-size: 0.82rem;
  }

  .image-workbench-panel .mode-tab::before {
    width: 3px;
  }

  .image-workbench-panel .mode-note {
    padding: 6px 8px;
    font-size: 0.76rem;
  }

  .image-workbench-panel .field input,
  .image-workbench-panel .field textarea,
  .image-workbench-panel .field select {
    min-height: 36px;
    font-size: 0.84rem;
  }

  .image-workbench-panel textarea[name="productInfo"],
  .image-workbench-panel textarea[name="referenceInfo"] {
    min-height: 72px;
  }

  .image-workbench-panel .inline-preview.empty {
    min-height: 46px;
  }

  .image-workbench-panel .thumb-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .image-workbench-panel .thumb-card img {
    aspect-ratio: 1 / 1;
  }

  .image-workbench-panel .thumb-body {
    padding: 5px;
  }

  .structure-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .structure-head small {
    display: none;
  }

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

  .structure-mode label {
    min-width: 0;
    padding: 6px;
    font-size: 0.76rem;
  }

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

  .structure-grid label {
    flex-basis: auto;
    width: 100%;
  }

  .image-workbench-panel .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .image-workbench-panel .compact-preview {
    margin-top: 10px;
  }

  .image-workbench-panel .api-result {
    min-height: 48px;
    padding: 7px 8px;
  }

  .section-head {
    gap: 10px;
    margin-bottom: 12px;
  }

  h2 {
    font-size: 1.08rem;
  }

  .section-head > .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .section-head > .actions .button {
    min-height: 34px;
    padding: 7px 6px;
    font-size: 0.76rem;
  }

  .history-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    margin: -2px 0 10px;
    padding: 7px 8px;
  }

  .history-date-filter {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 8px;
  }

  .history-toolbar small {
    text-align: left;
    font-size: 0.72rem;
  }

  .history-status-tabs {
    gap: 6px;
    margin-bottom: 8px;
  }

  .history-action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
  }

  .history-action-row .button {
    min-height: 32px;
    padding: 6px;
    font-size: 0.74rem;
  }

  .history-status-tab {
    min-height: 42px;
    padding: 7px 7px;
  }

  .history-status-tab span {
    font-size: 0.76rem;
  }

  .history-status-tab strong {
    min-width: 24px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.78rem;
  }

  .history-list {
    gap: 8px;
    max-height: 560px;
  }

  .history-list.empty {
    min-height: 78px;
    padding: 12px;
    font-size: 0.82rem;
  }

  .history-card {
    padding: 9px;
  }

  .history-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .history-top .status-pill {
    width: fit-content;
    max-width: 100%;
  }

  .history-detail {
    white-space: normal;
  }

  .history-compact-meta span {
    max-width: 100%;
  }

  .history-images {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

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

  .history-actions .mini-button {
    width: 100%;
  }

  .submit-toast {
    top: 12px;
    right: 10px;
    left: 10px;
    width: auto;
  }
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 8px;
  }

  .topnav a {
    font-size: 0.72rem;
    padding-inline: 4px;
  }

  .image-workbench-panel .thumb-grid,
  .history-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-head > .actions,
  .history-actions,
  .structure-grid {
    grid-template-columns: 1fr;
  }
}
/* Member and admin additions */
.member-login {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(18, 27, 48, 0.14);
  background: linear-gradient(135deg, #172033 0%, #1f3450 100%);
  color: #fff;
}

.member-login.logged-in {
  background: linear-gradient(135deg, #101827 0%, #17364e 54%, #15543e 100%);
}

.member-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(3, 7, 18, 0.62);
}

.member-auth-modal[hidden] {
  display: none;
}

.member-auth-card {
  width: min(420px, 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(15, 27, 45, 0.98), rgba(8, 17, 31, 0.98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  color: #fff;
}

.member-auth-head {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 10px;
  margin-bottom: 14px;
  text-align: center;
}

.member-auth-head strong,
.member-auth-head small {
  display: block;
}

.member-auth-head strong {
  font-size: 1rem;
  line-height: 1.35;
}

.member-auth-head small {
  margin-top: 3px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 0.78rem;
  line-height: 1.45;
}

.member-auth-card .auth-grid {
  grid-template-columns: 1fr;
}

.member-auth-card .member-grid .field {
  grid-template-columns: 70px minmax(0, 1fr);
}

.member-auth-card .member-submit-inline {
  width: 100%;
}

.remember-login {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 4px;
  color: rgba(226, 232, 240, 0.82);
  font-size: 0.84rem;
  font-weight: 800;
}

.remember-login input {
  width: 15px;
  height: 15px;
  accent-color: #14b8a6;
}

.member-auth-card .member-actions {
  margin-top: 12px;
}

.forgot-inline-tip {
  margin: 9px 0 0;
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
  font-size: 0.84rem;
  font-weight: 850;
  text-align: center;
}

.member-auth-card .member-tabs {
  gap: 8px;
}

.member-auth-card .member-tab[data-member-mode="login"] {
  display: none;
}

.member-summary,
.member-actions,
.member-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.member-status-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.button.compact {
  min-height: 32px;
  padding: 7px 11px;
  font-size: 0.78rem;
}

.member-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.member-summary small {
  color: rgba(255, 255, 255, 0.72);
}

.member-credits-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 18px;
  border: 1px solid rgba(187, 247, 208, 0.34);
  border-radius: 8px;
  padding: 14px;
  background: rgba(4, 120, 87, 0.28);
}

.member-credits-panel span,
.member-credits-panel small {
  color: rgba(236, 253, 245, 0.82);
}

.member-credit-count {
  grid-row: span 3;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.member-credits-panel strong {
  color: #fff;
  font-size: clamp(34px, 4.8vw, 52px);
  line-height: 0.9;
  font-weight: 950;
  letter-spacing: 0;
}

.member-credit-count em {
  color: rgba(236, 253, 245, 0.86);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 850;
}

.member-recharge-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  min-height: 30px;
  margin-top: 5px;
  border-color: rgba(45, 212, 191, 0.34);
  background: rgba(20, 184, 166, 0.18);
  color: #ccfbf1;
}

.recharge-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 18px;
  transform: translateY(2px) rotate(-14deg);
}

.recharge-icon.mouse-arrow::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(8% 0, 92% 58%, 56% 64%, 75% 100%, 60% 100%, 42% 67%, 17% 91%);
  background: #f8fafc;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.34));
}

.member-recharge-button:hover {
  background: rgba(20, 184, 166, 0.28);
}

.member-tabs {
  justify-content: flex-start;
}

.member-actions {
  justify-content: flex-start;
}

.member-actions .member-tabs {
  display: inline-flex;
}

.member-actions .member-tab,
.member-actions #forgotPassword,
.member-actions #returnMemberLogin {
  width: 112px;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 800;
}

.member-tab[data-member-mode="login"] {
  display: none;
}

.member-tab {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
}

.member-tab.active {
  background: #ffffff;
  color: #172033;
}

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

.member-grid .field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.member-grid .field span {
  min-width: 32px;
  white-space: nowrap;
}

.member-login.mode-register .member-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.member-login.mode-card .member-grid {
  grid-template-columns: minmax(0, 1fr) auto;
}

.member-submit-inline {
  align-self: stretch;
  min-height: 40px;
}

.member-login .field span,
.member-login .field small {
  color: rgba(255, 255, 255, 0.82);
}

.member-login input {
  background: rgba(255, 255, 255, 0.96);
}

.mini-link {
  color: #d8ebff;
  font-size: 13px;
  text-decoration: none;
}

.member-login.logged-in .mini-link {
  margin-left: auto;
  color: rgba(219, 234, 254, 0.78);
}

.member-package-box {
  display: grid;
  gap: 10px;
  margin-top: -2px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.member-package-box[hidden] {
  display: none;
}

.member-login.packages-open .member-recharge-button {
  border-color: rgba(45, 212, 191, 0.58);
  background: rgba(20, 184, 166, 0.3);
}

.package-box-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
}

.package-box-head strong {
  color: #fff;
}

.package-box-head small {
  color: rgba(255, 255, 255, 0.7);
}

.history-date-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 2px;
}

.history-date-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(20, 31, 51, 0.12);
  background: #fff;
  border-radius: 7px;
  padding: 8px 11px;
  color: #29364b;
  cursor: pointer;
  white-space: nowrap;
}

.history-date-tab.active {
  border-color: #1e8f61;
  background: #eaf8f1;
  color: #146443;
}

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

.member-package-box .package-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 8px;
}

.package-grid.empty {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  padding: 10px 0;
}

.package-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(20, 31, 51, 0.12);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.member-package-box .package-card {
  justify-items: center;
  padding: 10px;
  gap: 5px;
  text-align: center;
}

.package-card strong {
  font-size: 16px;
}

.member-package-box .package-card strong {
  font-size: 14px;
}

.package-card span,
.package-card small {
  color: #697386;
}

.package-card b {
  color: #146443;
  font-size: 20px;
}

.member-package-box .package-card b {
  font-size: 18px;
}

.member-package-box .package-card .button,
.member-package-box .package-card button {
  width: 100%;
  justify-content: center;
}

.admin-workspace {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 40px;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid rgba(20, 31, 51, 0.1);
  border-radius: 8px;
  background: #f6f8fb;
}

.admin-tab {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #475467;
  cursor: pointer;
  font-weight: 900;
}

.admin-tab:hover {
  border-color: rgba(37, 99, 235, 0.2);
  background: #fff;
  color: #1d4ed8;
}

.admin-tab.active {
  border-color: rgba(37, 99, 235, 0.32);
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 8px 18px rgba(20, 31, 51, 0.08);
}

.admin-view {
  display: grid;
  gap: 14px;
}

.brief-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f8fbff 0%, #ffffff 58%, #f3faf6 100%);
}

.brief-hero h2,
.brief-hero p {
  margin: 0;
}

.brief-hero span {
  flex: 0 0 auto;
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: 999px;
  padding: 7px 11px;
  background: #ecfdf3;
  color: #166534;
  font-size: 12px;
  font-weight: 900;
}

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

.admin-quick-config {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.admin-quick-config .token-import-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(320px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.compact-card-head h2,
.compact-card-head p {
  margin: 0;
}

.compact-card-head p {
  margin-top: 4px;
}

.admin-card {
  border: 1px solid rgba(20, 31, 51, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.admin-card.wide {
  margin-top: 14px;
}

.compact-member-card {
  margin-top: 10px;
  padding: 12px;
}

.compact-member-card .table-head {
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.compact-member-card .table-head h2 {
  font-size: 18px;
}

.compact-member-card .table-head p {
  max-width: 520px;
  color: #667085;
  font-size: 13px;
  line-height: 1.35;
}

.compact-member-card .admin-table {
  min-width: 780px;
}

.token-pool-card {
  border-color: rgba(37, 99, 235, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.token-import-card {
  border-color: rgba(37, 99, 235, 0.2);
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(320px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.token-import-card textarea {
  min-height: 82px;
  resize: vertical;
}

.package-config-card,
.card-create-card {
  min-height: 260px;
}

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

.package-tools {
  align-items: center;
  justify-content: flex-end;
}

.package-config-table {
  display: grid;
  gap: 7px;
}

.package-config-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.9fr) minmax(180px, 1.4fr) 100px 100px 90px 92px 68px;
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(20, 31, 51, 0.08);
  border-radius: 8px;
  padding: 7px;
  background: #f8fafc;
}

.package-config-head {
  background: #eef2f7;
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

.package-config-row input,
.package-config-row select {
  min-width: 0;
  min-height: 32px;
  border: 1px solid rgba(20, 31, 51, 0.12);
  border-radius: 7px;
  padding: 6px 8px;
  background: #fff;
  color: #29364b;
  font-size: 13px;
  font-weight: 800;
}

.package-config-card .button {
  min-height: 34px;
}

.card-create-card .admin-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-create-card .admin-output {
  min-height: 78px;
  max-height: 118px;
  overflow: auto;
}

.admin-card-tools {
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.5fr);
  align-items: start;
}

.admin-card-tools .admin-card.wide {
  margin-top: 0;
}

.unused-card-list-card {
  grid-column: 1 / -1;
}

.admin-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.admin-card p {
  color: #697386;
  font-size: 13px;
}

.admin-card textarea,
.admin-output {
  width: 100%;
  border: 1px solid rgba(20, 31, 51, 0.14);
  border-radius: 7px;
  padding: 10px;
  background: #f8fafc;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.admin-output {
  min-height: 80px;
  white-space: pre-wrap;
}

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

.admin-summary-grid span {
  display: grid;
  gap: 4px;
  min-height: 72px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: #eef6ff;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

.admin-summary-grid strong {
  color: #1d4ed8;
  font-size: 24px;
  line-height: 1;
}

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

.brief-revenue-card {
  grid-column: 1 / -1;
}

.brief-card {
  min-height: 186px;
}

.brief-card h2 {
  margin-bottom: 10px;
}

.brief-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.brief-card:not(.brief-revenue-card) .brief-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.brief-metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  min-height: 76px;
  border: 1px solid rgba(20, 31, 51, 0.1);
  border-radius: 8px;
  padding: 11px;
  background: #f8fafc;
}

.brief-metric span {
  grid-column: 1 / -1;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.brief-metric strong {
  min-width: 0;
  color: #1f2937;
  font-size: 26px;
  line-height: 1;
  font-weight: 950;
  word-break: break-all;
}

.brief-metric small {
  align-self: end;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.brief-metric.token-remaining-alert {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fee4e2;
}

.brief-metric.token-remaining-alert span,
.brief-metric.token-remaining-alert small {
  color: #b42318;
}

.brief-metric.token-remaining-alert strong {
  color: #b42318;
}

.revenue-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 10px;
  margin-bottom: 12px;
}

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

.table-head h2,
.table-head p {
  margin: 0;
}

.table-head p {
  margin-top: 4px;
}

.transaction-tools,
.order-tools {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.member-tools,
.transaction-tools,
.order-tools {
  align-items: center;
  justify-content: flex-end;
  border: 1px solid rgba(20, 31, 51, 0.1);
  border-radius: 8px;
  padding: 6px;
  background: #f8fafc;
}

.member-tools input,
.member-tools select,
.member-tools .page-size-custom,
.transaction-tools input,
.transaction-tools select,
.order-tools input,
.order-tools select,
.order-tools .page-size-custom {
  min-height: 34px;
  border: 1px solid rgba(20, 31, 51, 0.12);
  border-radius: 7px;
  background: #fff;
  color: #29364b;
  font-size: 13px;
  font-weight: 800;
}

.member-tools input {
  width: 190px;
  padding: 7px 10px;
  font-weight: 700;
}

.transaction-tools input,
.order-tools input {
  width: 220px;
  padding: 7px 10px;
  font-weight: 700;
}

.member-tools select {
  min-width: 126px;
  padding: 6px 28px 6px 10px;
}

.transaction-tools select,
.order-tools select {
  min-width: 118px;
  padding: 6px 28px 6px 10px;
}

.order-tools {
  max-width: 380px;
}

.member-tools .button {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 13px;
}

.member-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.member-type-pill.account {
  background: #e9f0ff;
  color: #1d4ed8;
}

.member-type-pill.card {
  background: #fff5d6;
  color: #9a5b00;
}

.token-pool-summary {
  display: grid;
  grid-template-columns: auto;
  justify-items: end;
  gap: 2px;
  min-width: 150px;
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: 8px;
  padding: 9px 12px;
  background: #ecfdf3;
  color: #166534;
}

.token-pool-summary span,
.token-pool-summary small {
  font-size: 12px;
  color: #3f7b55;
}

.token-pool-summary strong {
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

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

.token-table-actions span {
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}

.card-tools {
  align-items: center;
  justify-content: flex-end;
  border: 1px solid rgba(20, 31, 51, 0.1);
  border-radius: 8px;
  padding: 6px;
  background: #f8fafc;
}

.card-tools select,
.card-tools .page-size-custom {
  min-height: 34px;
  border: 1px solid rgba(20, 31, 51, 0.12);
  border-radius: 7px;
  background: #fff;
  color: #29364b;
  font-size: 13px;
  font-weight: 800;
}

.card-tools select {
  min-width: 118px;
  padding: 6px 28px 6px 10px;
}

.card-tools span {
  color: #667085;
  font-size: 13px;
  font-weight: 900;
}

.token-select {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.unused-card-select {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(20, 31, 51, 0.1);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(20, 31, 51, 0.08);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.admin-table th {
  background: #f6f8fb;
  color: #475467;
  font-weight: 800;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table code {
  font-size: 12px;
  color: #1f3450;
}

.admin-mini-input {
  width: 118px;
  min-height: 34px;
  border: 1px solid rgba(20, 31, 51, 0.14);
  border-radius: 7px;
  padding: 7px 9px;
  background: #fff;
}

.page-size-custom {
  width: 92px;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 10px;
}

.mini-button.active {
  border-color: #2563eb;
  background: #e9f0ff;
  color: #1d4ed8;
  font-weight: 900;
}

.mini-button.success {
  border-color: rgba(8, 116, 67, 0.18);
  background: #e8f5ee;
  color: #087443;
  font-weight: 900;
}

.order-action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.order-action-buttons .mini-button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.order-number-stack {
  display: grid;
  gap: 3px;
  min-width: 210px;
}

.order-number-stack code,
.order-number-stack small {
  overflow: hidden;
  max-width: 260px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-number-stack small {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.order-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.order-status.success,
.success-text {
  color: #087443;
}

.muted-text {
  color: #667085;
  font-weight: 800;
}

.order-status.success {
  background: #e8f5ee;
}

.order-status.warning {
  background: #fff5d6;
  color: #9a5b00;
}

.order-status.muted {
  background: #eef2f7;
  color: #667085;
}

.success-row td {
  background: #f5fff9;
}

.muted-row td {
  background: #f8fafc;
  color: #667085;
}

.danger-row td,
.token-row-danger td {
  background: #fff7f6;
}

.token-row-warning td {
  background: #fff9e6;
}

.token-row-success td {
  background: #f1fbf5;
}

.token-row-disabled td {
  background: #f6f7f9;
  color: #98a2b3;
}

.token-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 800;
}

.compact-config {
  background: #fbfcfe;
}

.compact-config-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.compact-config textarea {
  min-height: 88px;
}

.compact-config input[readonly] {
  background: #f3f6fb;
  color: #475467;
}

.config-save-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 900;
}

.config-save-status.success {
  background: #e8f5ee;
  color: #087443;
}

.config-save-status.warning {
  background: #fff5d6;
  color: #9a5b00;
}

.payment-card {
  width: min(420px, calc(100vw - 28px));
  max-width: 420px;
  padding: 20px;
}

.payment-card .confirm-actions {
  justify-content: center;
}

.peer-preview-panel {
  overflow: hidden;
}

.peer-preview-panel .section-head {
  justify-content: center;
  text-align: center;
}

.peer-preview-panel .section-head > div {
  width: 100%;
}

.peer-preview-window {
  width: 100%;
  overflow: hidden;
}

.peer-preview-track {
  display: flex;
  align-items: center;
  width: max-content;
  gap: 12px;
  min-height: 150px;
  animation: peerPreviewScroll var(--peer-preview-duration, 38s) linear infinite;
  will-change: transform;
}

.peer-preview-panel:hover .peer-preview-track {
  animation-play-state: paused;
}

.peer-preview-track.empty {
  display: grid;
  place-items: center;
  width: 100%;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 13px;
  animation: none;
}

.peer-preview-thumb {
  width: 150px;
  height: 150px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.66);
  cursor: zoom-in;
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.18);
}

.peer-preview-thumb img {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.peer-preview-thumb:hover img,
.peer-preview-thumb:focus-visible img {
  transform: scale(1.04);
  filter: saturate(1.08) contrast(1.04);
}

@keyframes peerPreviewScroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - 6px));
  }
}

.peer-preview-card {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  border-color: rgba(59, 130, 246, 0.35);
  background: #0b1220;
  color: #f8fafc;
}

.peer-preview-card strong {
  color: #dbeafe;
  text-align: center;
}

.peer-preview-card img {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 760px);
  margin: 14px auto 16px;
  border-radius: 8px;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  background: #111827;
}

.preview-image-config-card textarea {
  width: 100%;
  resize: vertical;
}

.preview-image-config-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.wechat-pay-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
  text-align: center;
}

.wechat-pay-logo {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #07c160;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
}

.wechat-pay-head strong,
.wechat-pay-head small {
  display: block;
}

.wechat-pay-head strong {
  font-size: 20px;
  line-height: 1.1;
}

.wechat-pay-head small {
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.qr-box {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 326px;
  margin: 12px 0;
  border: 1px solid rgba(20, 31, 51, 0.1);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.qr-box img {
  width: min(280px, 100%);
  height: auto;
  max-width: 100%;
  border-radius: 8px;
  background: #fff;
}

.qr-box strong {
  color: #101828;
  font-size: 16px;
  font-weight: 900;
}

.qr-box small,
.payment-hint,
#paymentModalText {
  color: #667085;
  text-align: center;
}

#paymentModalText {
  margin: 8px 0 10px;
  color: #29364b;
  font-weight: 900;
}

.payment-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid rgba(7, 193, 96, 0.2);
  border-radius: 999px;
  padding: 5px 12px;
  background: #ecfdf3;
  color: #087443;
  font-size: 13px;
  font-weight: 900;
}

.payment-hint {
  margin: 0;
  padding: 16px;
  text-align: center;
}

/* Dark AI workbench theme for the public image workspace. */
body[data-page="image"] {
  --bg: #08111f;
  --panel: #0f1b2d;
  --panel-soft: #111f33;
  --line: rgba(120, 231, 255, 0.18);
  --text: #e7f3ff;
  --muted: #8ea2ba;
  --brand: #15d6b3;
  --brand-dark: #0fb092;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warning: #facc15;
  --warning-soft: rgba(250, 204, 21, 0.14);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.16);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  background:
    radial-gradient(circle at 12% 0%, rgba(20, 184, 166, 0.18), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(56, 189, 248, 0.14), transparent 30%),
    linear-gradient(180deg, #08111f 0%, #0b1220 46%, #090f1a 100%);
}

body[data-page="image"] .app-shell {
  width: min(1460px, calc(100% - 28px));
}

body[data-page="image"] .topbar,
body[data-page="image"] .panel,
body[data-page="image"] .image-workbench-panel {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(15, 27, 45, 0.9);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

body[data-page="image"] .topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-radius: 0 0 8px 8px;
}

body[data-page="image"] .brand-mark {
  background: linear-gradient(135deg, #14b8a6 0%, #38bdf8 100%);
  color: #06111e;
  box-shadow: 0 0 24px rgba(20, 184, 166, 0.32);
}

body[data-page="image"] .brand small,
body[data-page="image"] small,
body[data-page="image"] .lede,
body[data-page="image"] .history-meta,
body[data-page="image"] .history-detail {
  color: var(--muted);
}

body[data-page="image"] .history-success-time {
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(16, 185, 129, 0.14);
  color: #86efac;
}

body[data-page="image"] .topnav a {
  color: #9fb2ca;
}

body[data-page="image"] .topnav a.active,
body[data-page="image"] .topnav a:hover {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
}

body[data-page="image"] .ak-workspace {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.82fr);
  align-items: start;
}

body[data-page="image"] .ak-workspace > .panel:nth-of-type(2) {
  position: static;
  max-height: none;
  overflow: visible;
}

body[data-page="image"] .peer-preview-panel {
  grid-column: 1 / -1;
  width: 100%;
}

body[data-page="image"] .image-workbench-panel,
body[data-page="image"] .image-workbench-panel.mode-kit,
body[data-page="image"] .image-workbench-panel.mode-clone {
  border-color: rgba(56, 189, 248, 0.22);
  background:
    linear-gradient(180deg, rgba(17, 31, 51, 0.98) 0%, rgba(13, 24, 40, 0.98) 100%),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.2), transparent 34%);
}

body[data-page="image"] .image-workbench-panel .section-head,
body[data-page="image"] .image-workbench-panel.mode-kit .section-head,
body[data-page="image"] .image-workbench-panel.mode-clone .section-head {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

body[data-page="image"] .eyebrow,
body[data-page="image"] .image-workbench-panel h1,
body[data-page="image"] .image-workbench-panel.mode-kit h1,
body[data-page="image"] .image-workbench-panel.mode-clone h1 {
  color: #7dd3fc;
}

body[data-page="image"] h1,
body[data-page="image"] h2,
body[data-page="image"] h3,
body[data-page="image"] .history-title,
body[data-page="image"] .field span {
  color: #e7f3ff;
}

body[data-page="image"] .section-head h2 {
  font-size: 1.05rem;
  line-height: 1.16;
  white-space: nowrap;
}

body[data-page="image"] .button,
body[data-page="image"] .mode-tab span,
body[data-page="image"] .history-toolbar span,
body[data-page="image"] .history-status-tab span {
  white-space: nowrap;
}

body[data-page="image"] .history-toolbar {
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
}

body[data-page="image"] .image-workbench-panel .section-head {
  margin-inline: -2px;
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(15, 27, 45, 0.96);
}

body[data-page="image"] .history-date-filter {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(8, 17, 31, 0.58);
}

body[data-page="image"] .history-date-filter input {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.72);
  color: #e7f3ff;
}

body[data-page="image"] .history-date-filter span {
  color: #94a3b8;
}

body[data-page="image"] .history-date-filter strong {
  color: #99f6e4;
}

body[data-page="image"] .history-download-stack span,
body[data-page="image"] .history-select-stack span {
  border-color: rgba(56, 189, 248, 0.24);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
}

body[data-page="image"] .history-toolbar small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="image"] .button.primary {
  background: linear-gradient(135deg, #14b8a6 0%, #38bdf8 100%);
  color: #06111e;
  box-shadow: 0 10px 28px rgba(20, 184, 166, 0.22);
}

body[data-page="image"] .button.primary:hover {
  background: linear-gradient(135deg, #2dd4bf 0%, #7dd3fc 100%);
}

body[data-page="image"] .button.secondary {
  border-color: rgba(56, 189, 248, 0.36);
  background: rgba(56, 189, 248, 0.13);
  color: #bae6fd;
}

body[data-page="image"] .button.ghost,
body[data-page="image"] .mini-button {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
}

body[data-page="image"] .field input,
body[data-page="image"] .field textarea,
body[data-page="image"] .field select,
body[data-page="image"] .image-workbench-panel .field input,
body[data-page="image"] .image-workbench-panel .field textarea,
body[data-page="image"] .image-workbench-panel .field select {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(8, 17, 31, 0.78);
  color: #e7f3ff;
}

body[data-page="image"] .field input::placeholder,
body[data-page="image"] .field textarea::placeholder {
  color: #64748b;
}

body[data-page="image"] input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 7px;
  padding: 6px 10px;
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
  cursor: pointer;
  font-weight: 800;
}

body[data-page="image"] input[type="file"]::file-selector-button:hover {
  border-color: rgba(20, 184, 166, 0.48);
  background: rgba(20, 184, 166, 0.16);
  color: #99f6e4;
}

body[data-page="image"] .field input:focus,
body[data-page="image"] .field textarea:focus,
body[data-page="image"] .field select:focus,
body[data-page="image"] .image-workbench-panel.mode-kit .field input:focus,
body[data-page="image"] .image-workbench-panel.mode-kit .field textarea:focus,
body[data-page="image"] .image-workbench-panel.mode-kit .field select:focus,
body[data-page="image"] .image-workbench-panel.mode-clone .field input:focus,
body[data-page="image"] .image-workbench-panel.mode-clone .field textarea:focus,
body[data-page="image"] .image-workbench-panel.mode-clone .field select:focus {
  border-color: #38bdf8;
  outline-color: rgba(56, 189, 248, 0.2);
}

body[data-page="image"] .member-login,
body[data-page="image"] .member-login.logged-in {
  border-color: rgba(20, 184, 166, 0.26);
  background: linear-gradient(135deg, rgba(6, 18, 34, 0.96), rgba(13, 45, 63, 0.92));
}

body[data-page="image"] .member-login input {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(8, 17, 31, 0.86);
  color: #e7f3ff;
}

body[data-page="image"] .member-tab {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
}

body[data-page="image"] .member-tab.active {
  border-color: rgba(20, 184, 166, 0.44);
  background: rgba(20, 184, 166, 0.16);
  color: #99f6e4;
}

body[data-page="image"] .member-credits-panel,
body[data-page="image"] .member-package-box {
  border-color: rgba(52, 211, 153, 0.24);
  background: rgba(6, 78, 59, 0.22);
}

body[data-page="image"] .package-card,
body[data-page="image"] .mode-tab,
body[data-page="image"] .kit-structure,
body[data-page="image"] .structure-mode label,
body[data-page="image"] .structure-grid label,
body[data-page="image"] .account-card,
body[data-page="image"] .queue-card,
body[data-page="image"] .thumb-card,
body[data-page="image"] .history-card {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.68);
}

body[data-page="image"] .package-card span,
body[data-page="image"] .package-card small {
  color: #94a3b8;
}

body[data-page="image"] .package-card strong,
body[data-page="image"] .package-card b {
  color: #99f6e4;
}

body[data-page="image"] .image-workbench-panel .mode-tab.kit-tab.active,
body[data-page="image"] .image-workbench-panel .mode-tab.clone-tab.active,
body[data-page="image"] .mode-tab.active {
  border-color: rgba(20, 184, 166, 0.42);
  background: rgba(20, 184, 166, 0.14);
  color: #99f6e4;
}

body[data-page="image"] .image-workbench-panel .mode-note,
body[data-page="image"] .image-workbench-panel.mode-clone .mode-note {
  border-color: rgba(56, 189, 248, 0.24);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
}

body[data-page="image"] .kit-structure {
  background: rgba(8, 17, 31, 0.58);
}

body[data-page="image"] .structure-head span,
body[data-page="image"] .structure-head strong {
  color: #7dd3fc;
}

body[data-page="image"] .structure-head strong {
  background: rgba(56, 189, 248, 0.12);
}

body[data-page="image"] .image-workbench-panel .inline-preview {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(8, 17, 31, 0.48);
  color: #94a3b8;
}

body[data-page="image"] .image-workbench-panel .inline-preview:not(.empty),
body[data-page="image"] .image-workbench-panel.mode-clone .inline-preview:not(.empty) {
  border-color: rgba(56, 189, 248, 0.24);
  background: rgba(8, 17, 31, 0.68);
}

body[data-page="image"] .api-result,
body[data-page="image"] .image-workbench-panel .api-result {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(8, 17, 31, 0.7);
  color: #b6c6d8;
}

body[data-page="image"] .history-toolbar,
body[data-page="image"] .history-empty {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(8, 17, 31, 0.58);
  color: #94a3b8;
}

body[data-page="image"] .history-date-tab,
body[data-page="image"] .history-status-tab {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
}

body[data-page="image"] .history-date-tab.active,
body[data-page="image"] .history-status-tab.active,
body[data-page="image"] .history-status-tab.success {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(52, 211, 153, 0.14);
  color: #99f6e4;
}

body[data-page="image"] .history-status-tab.warning {
  border-color: rgba(250, 204, 21, 0.36);
  background: rgba(250, 204, 21, 0.12);
  color: #fde68a;
}

body[data-page="image"] .history-status-tab.accent {
  border-color: rgba(56, 189, 248, 0.36);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
}

body[data-page="image"] .history-card.accent,
body[data-page="image"] .history-card.warning,
body[data-page="image"] .history-card.success,
body[data-page="image"] .history-card.danger {
  background: rgba(15, 23, 42, 0.72);
}

body[data-page="image"] .history-card.success {
  border-color: rgba(52, 211, 153, 0.3);
}

body[data-page="image"] .history-card.warning {
  border-color: rgba(250, 204, 21, 0.28);
}

body[data-page="image"] .history-card.accent {
  border-color: rgba(56, 189, 248, 0.28);
}

body[data-page="image"] .history-card.danger {
  border-color: rgba(251, 113, 133, 0.3);
}

body[data-page="image"] .history-compact-meta span,
body[data-page="image"] .history-items span {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(8, 17, 31, 0.7);
  color: #94a3b8;
}

body[data-page="image"] .history-actions .mini-button.primary {
  border-color: rgba(20, 184, 166, 0.42);
  background: rgba(20, 184, 166, 0.14);
  color: #99f6e4;
}

body[data-page="image"] .history-image {
  border-color: rgba(148, 163, 184, 0.18);
  background: #0b1220;
}

body[data-page="image"] .history-image.selected {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

body[data-page="image"] .status-pill {
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
}

body[data-page="image"] .status-pill.success {
  background: rgba(52, 211, 153, 0.14);
  color: #99f6e4;
}

body[data-page="image"] .status-pill.danger {
  background: rgba(251, 113, 133, 0.16);
  color: #fecdd3;
}

body[data-page="image"] .confirm-card,
body[data-page="image"] .payment-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: #0f1b2d;
  color: #e7f3ff;
}

body[data-page="image"] .wechat-pay-head {
  justify-content: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding-bottom: 12px;
  text-align: center;
}

body[data-page="image"] .wechat-pay-logo {
  box-shadow: 0 0 26px rgba(7, 193, 96, 0.32);
}

body[data-page="image"] .wechat-pay-head small {
  color: #8ea2ba;
}

body[data-page="image"] #paymentModalText {
  color: #dbeafe;
}

body[data-page="image"] .qr-box {
  border-color: rgba(52, 211, 153, 0.26);
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.98) 0%, rgba(226, 232, 240, 0.96) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 16px 42px rgba(0, 0, 0, 0.24);
}

body[data-page="image"] .qr-box img {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}

@media (max-width: 980px) {
  body[data-page="image"] .ak-workspace {
    grid-template-columns: 1fr;
  }

  body[data-page="image"] .ak-workspace > .panel:nth-of-type(2) {
    position: static;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .preview-image-config-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .member-grid,
  .admin-grid,
  .admin-sections,
  .admin-summary-grid,
  .brief-grid,
  .brief-metrics,
  .brief-card:not(.brief-revenue-card) .brief-metrics,
  .package-grid {
    grid-template-columns: 1fr;
  }

  .member-login.mode-register .member-grid,
  .member-login.mode-card .member-grid {
    grid-template-columns: 1fr;
  }

  .member-grid .field {
    grid-template-columns: 1fr;
  }

  .member-auth-card .member-grid .field {
    grid-template-columns: 1fr;
  }

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

  .admin-tab {
    min-height: 38px;
    font-size: 13px;
  }

  .brief-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .brief-hero span {
    width: fit-content;
  }

  .revenue-tools {
    grid-template-columns: 1fr;
  }

  .member-credits-panel {
    grid-template-columns: 1fr;
  }

  .member-credit-count {
    grid-row: auto;
    justify-content: flex-start;
  }

  .member-credits-panel strong {
    font-size: 44px;
  }

  .member-credit-count em {
    font-size: 0.8rem;
  }

  .member-recharge-button {
    width: 100%;
  }

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

  .member-tools,
  .transaction-tools,
  .card-tools {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .member-tools input,
  .member-tools select,
  .member-tools .button,
  .transaction-tools input,
  .transaction-tools select,
  .card-tools select,
  .card-tools .mini-button,
  .card-tools .page-size-custom {
    width: 100%;
  }

  .token-pool-summary {
    justify-items: start;
  }

  .compact-config-grid {
    grid-template-columns: 1fr;
  }

  .admin-quick-config .token-import-card {
    grid-template-columns: 1fr;
  }

  .token-import-card,
  .admin-card-tools {
    grid-template-columns: 1fr;
  }

  .card-create-card .admin-grid {
    grid-template-columns: 1fr;
  }

  .package-config-table {
    overflow-x: auto;
  }

  .package-config-row {
    min-width: 760px;
  }
}
