:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --panel-soft: #f2f2ef;
  --ink: #161616;
  --muted: #858585;
  --line: #e7e5df;
  --brand: #111111;
  --accent: #e60012;
  --green: #15a05c;
  --warn: #b45309;
  --shadow: 0 18px 50px rgba(22, 22, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-compliance-footer {
  padding: 22px 20px 28px;
  color: #767676;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

.site-compliance-footer a {
  color: inherit;
  text-decoration: none;
}

.site-compliance-footer a:hover,
.site-compliance-footer a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

.top-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 24px;
  background: #dfff4c;
  color: #20220c;
  font-size: 14px;
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 78px;
  padding: 0 28px;
  background: rgba(246, 246, 244, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231, 229, 223, 0.65);
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.nav-pill {
  color: #5d5d5d;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 14px;
}

.nav-pill.active {
  color: #111;
  background: #e9e8e3;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #565656;
  font-weight: 700;
}

.user-quota-card {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  max-width: min(46vw, 520px);
}

.user-name {
  color: #202020;
  font-weight: 800;
}

.user-role {
  color: #696969;
  font-weight: 700;
}

.quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff7d7;
  color: #6f5214;
  white-space: nowrap;
}

.quota-number {
  color: #151515;
  font-weight: 850;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8e7e2;
}

.hero {
  padding: 58px 28px 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafaf8;
  color: #777;
  font-size: 13px;
  font-weight: 700;
}

.hero h1 {
  margin: 18px 0 10px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.steps {
  width: min(900px, calc(100% - 48px));
  margin: 12px auto 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: #929292;
  font-weight: 750;
  font-size: 14px;
  white-space: nowrap;
}

.step + .step::before {
  content: "";
  width: clamp(34px, 5vw, 74px);
  height: 1px;
  background: var(--line);
  margin: 0 14px;
}

.step-dot {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ededeb;
  color: #8a8a8a;
}

.step.done .step-dot,
.step.active .step-dot {
  background: #111;
  color: white;
}

.step.done,
.step.active {
  color: #191919;
}

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  padding: 0 28px 36px;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel,
.stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.panel {
  padding: 22px;
}

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

.panel-title h3 {
  margin: 0;
  font-size: 17px;
}

.panel-title p,
.hint,
.empty p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.auth-loading-stage {
  min-height: 60vh;
  display: grid;
  place-items: center;
}

.auth-form-stage {
  max-width: 560px;
  min-height: auto;
  margin: 48px auto;
}

.formal-login-section,
.dev-login-section {
  display: grid;
  gap: 12px;
}

.dev-login-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.dev-role-card {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.dev-role-option {
  width: 100%;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 20px rgba(24, 24, 24, 0.06);
}

.dev-role-option:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.dev-role-card.super-admin .dev-role-option {
  background: #f1f7ff;
  border-color: #9bc3f2;
}

.dev-role-card.reviewer-admin .dev-role-option {
  background: #f5fbf7;
  border-color: #a8d6b8;
}

.dev-role-card.employee .dev-role-option {
  background: #fffaf0;
  border-color: #ead3a0;
}

.dev-role-option strong {
  font-size: 17px;
}

.dev-role-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.dev-role-option:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.dev-department-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dev-department-field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 0 8px;
}

.upload-area {
  border: 1.5px dashed #dad8d1;
  border-radius: 14px;
  min-height: 120px;
  display: grid;
  place-items: center;
  background: #fcfcfa;
  color: #9a9a9a;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.upload-copy {
  display: grid;
  place-items: center;
  gap: 10px;
}

.upload-copy strong {
  display: block;
  color: #555;
  font-size: 28px;
  line-height: 1;
}

.upload-copy em {
  color: #8a8a8a;
  font-style: normal;
  font-size: 15px;
}

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

.upload-note {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.thumb {
  position: relative;
  width: 82px;
  height: 82px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--panel-soft);
}

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

.thumb img[data-action="open-upload-preview"],
.clone-ref-item img[data-caction="preview-upload"] {
  cursor: zoom-in;
}

.thumb-role {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.74);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
}

.asset-status {
  position: absolute;
  left: 6px;
  bottom: 6px;
  max-width: calc(100% - 12px);
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.74);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-status.success {
  background: rgba(22, 163, 74, 0.86);
}

.asset-status.failed {
  background: rgba(220, 38, 38, 0.88);
}

.asset-status.fallback {
  background: rgba(120, 113, 108, 0.88);
}

.remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: white;
}

.add-thumb {
  width: 82px;
  height: 82px;
  border: 1.5px dashed #d7d4cc;
  border-radius: 14px;
  background: #fbfbf9;
  font-size: 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.tab {
  height: 44px;
  border-radius: 12px;
  background: #f0efeb;
  color: #777;
  font-weight: 800;
}

.tab.active {
  background: #0d0d0d;
  color: #fff;
}

.field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.field label {
  font-size: 14px;
  font-weight: 850;
}

.select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.select,
textarea,
.project-input {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 12px;
  background: #f8f7f3;
  color: #202020;
  box-shadow: inset 0 0 0 1px transparent;
}

.select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 150px;
  padding: 14px;
  resize: vertical;
  line-height: 1.55;
}

.ai-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -54px;
  padding: 0 12px 12px;
  pointer-events: none;
}

.ai-btn {
  pointer-events: auto;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e4e1d9;
  font-weight: 850;
}

.primary,
.secondary,
.ghost {
  min-height: 48px;
  border-radius: 13px;
  font-weight: 850;
}

.primary {
  width: 100%;
  background: #111;
  color: #fff;
}

.secondary {
  width: 100%;
  background: #f7f6f2;
  color: #222;
  box-shadow: inset 0 0 0 1px var(--line);
}

.ghost {
  padding: 0 14px;
  background: #f5f4f0;
  color: #222;
}

.generate-card {
  padding: 18px;
}

.generate-card .primary + .secondary {
  margin-top: 10px;
}

.stage {
  min-height: 620px;
  padding: 26px;
  position: relative;
}

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

.stage-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #f0f0ec;
  font-size: 22px;
}

.stage h2,
.stage h3,
.modal h2 {
  margin: 0;
}

.empty {
  min-height: 470px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #a1a1a1;
}

.empty-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f8f7f3;
  font-size: 34px;
}

.planning {
  display: grid;
  gap: 18px;
}

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

.rule-card,
.image-plan,
.error-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 20px;
}

.rule-card ul,
.image-plan ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #555;
  line-height: 1.7;
}

.prompt-block {
  margin: 12px 0 0;
  padding: 14px;
  max-height: 220px;
  overflow: auto;
  border-radius: 12px;
  background: #f8f7f4;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.color-chip {
  padding: 12px;
  border-radius: 12px;
  background: #f8f7f4;
  font-size: 12px;
}

.error-box {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 750;
}

.generating {
  min-height: 460px;
  display: grid;
  place-items: center;
  text-align: center;
}

.generation-status-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
  color: #5f5a52;
  font-size: 12px;
  font-weight: 700;
}

.generation-status-panel strong {
  color: #171717;
}

.generation-status-panel a {
  color: #6d5bd0;
  font-weight: 900;
  text-decoration: none;
}

.spinner {
  width: 70px;
  height: 70px;
  border-radius: 999px;
  border: 5px solid #ece9e2;
  border-top-color: #111;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.result-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.batch-download {
  width: auto;
  min-width: 190px;
  padding: 0 18px;
}

.save-path {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  word-break: break-all;
}

.result-grid {
  display: block;
}

.result-gallery {
  display: grid;
  gap: 16px;
}

.result-gallery.one {
  grid-template-columns: minmax(320px, 620px);
}

.result-gallery.two {
  grid-template-columns: minmax(320px, 680px);
}

.result-gallery.multi {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.result-gallery.compact-grid.multi {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}

.result-gallery.compact-grid.two {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.result-pair {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
}

.result-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #f0efeb;
  border: 1px solid var(--line);
}

.compact-result-card {
  min-height: 168px;
}

.result-card.redo-added {
  border: 3px solid #22c55e;
  box-shadow: 0 16px 40px rgba(34, 197, 94, 0.16);
}

.result-card.redo-editing {
  background: #fff;
}

.result-card.fallback-preview {
  border-color: #f59e0b;
  background: #fff7ed;
}

.result-thumb-wrap {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  background: #f8f7f3;
  border-bottom: 1px solid var(--line);
}

.result-thumb-wrap img[data-action="open-preview"] {
  cursor: zoom-in;
}

.result-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.compact-task-placeholder {
  min-height: 104px;
  padding: 14px;
  background: #f8fafc;
  border-bottom: 1px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  color: #64748b;
  font-weight: 800;
}

.compact-task-placeholder strong {
  color: #1f2937;
  font-size: 14px;
  line-height: 1.25;
}

.compact-task-placeholder p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.task-index {
  color: #9ca3af;
  font-size: 11px;
  font-weight: 900;
}

.spinner.small {
  width: 28px;
  height: 28px;
  border-width: 3px;
}

.result-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px 0;
  background: #fff;
  flex-wrap: wrap;
}

.fallback-badge {
  margin: 10px 14px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 12px;
  font-weight: 850;
}

.result-meta {
  padding: 10px 12px 0;
  background: #fff;
}

.result-meta-row,
.clone-result-meta,
.clone-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.result-meta p {
  margin: 8px 0 0;
  color: #6f6c66;
  font-size: 12px;
  line-height: 1.5;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge.success {
  background: #dcfce7;
  color: #166534;
}

.status-badge.fallback {
  background: #ffedd5;
  color: #9a3412;
}

.status-badge.failed {
  background: #fee2e2;
  color: #991b1b;
}

.status-badge.partial {
  background: #fef3c7;
  color: #92400e;
}

.trace-id {
  color: #6f6c66;
  font-size: 12px;
  font-weight: 800;
  word-break: break-word;
}

.result-check {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 850;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.round-action {
  min-width: 76px;
  height: 34px;
  border-radius: 999px;
  background: #f5f4f0;
  color: #111;
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 850;
}

.redo-editor {
  min-height: 420px;
  padding: 56px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.redo-editor textarea {
  min-height: 250px;
  flex: 1;
}

.redo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.redo-compare-panel {
  margin: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #dbe3ef;
}

.redo-compare-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #334155;
  font-size: 12px;
}

.redo-compare-head strong {
  color: #111827;
  font-size: 13px;
}

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

.redo-attempt-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
}

.redo-attempt-card span {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.redo-attempt-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 8px;
  background: #f5f4f0;
}

.redo-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #22c55e;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.result-caption {
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--line);
  font-weight: 850;
  font-size: 13px;
}

.project-input {
  height: 46px;
  padding: 0 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f0efeb;
  color: #4f4f4f;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.tag.green {
  background: #ddf7e8;
  color: #126c3e;
}

.tag.yellow {
  background: #fff1c2;
  color: #7a4a07;
}

.tag.red {
  background: #ffe2df;
  color: #a61c10;
}

.tag.blue {
  background: #ddeafa;
  color: #24508d;
}

.history-page {
  width: min(1280px, calc(100% - 56px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

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

.history-hero h1 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.1;
}

.history-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ── 标签页 ── */
.history-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0;
}

.history-tab {
  padding: 8px 18px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  border-radius: 0;
}

.history-tab:hover {
  color: var(--text);
}

.history-tab.active {
  color: var(--text);
  border-bottom-color: #8b7dd6;
}

/* ── 网格卡片 ── */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.history-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.history-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: #c4b8e0;
}

.history-card.expanded {
  grid-column: 1 / -1;
  cursor: default;
}

.history-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #f5f4f0;
  overflow: hidden;
}

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

.history-card-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}

.history-empty-state {
  padding: 40px 0;
  text-align: center;
}

.history-card-count {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.history-card-stack {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(139, 125, 214, 0.9);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.history-card-body {
  padding: 10px 12px 12px;
}

.history-card-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.history-card-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.history-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.history-card-tags .tag {
  font-size: 10px;
  padding: 1px 6px;
}

.history-card-stats {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  align-items: center;
}

.history-card-stats .tag {
  font-size: 10px;
  padding: 1px 6px;
}

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

.history-lifecycle-actions .small {
  min-height: 30px;
}

.history-card-error {
  margin: 6px 0 0;
  font-size: 11px;
  color: #dc2626;
  line-height: 1.4;
}

.history-record {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(22, 22, 22, 0.06);
}

.history-record-main {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.history-record-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.history-record-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-date {
  color: #171717;
  font-size: 15px;
  font-weight: 900;
}

.history-success-line {
  color: #2f2f2f;
  font-size: 13px;
  font-weight: 900;
}

.history-record-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 10px;
}

.history-record-stats div {
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7f6f2;
}

.history-record-stats strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.history-record-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-record-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff4f2;
  color: #a61c10;
  font-weight: 750;
}

.history-preview-strip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 112px;
}

.history-preview-strip.empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  border-radius: 8px;
  background: #f1f0ec;
}

.history-preview-empty {
  display: grid;
  gap: 4px;
  color: #5f5f5f;
  text-align: center;
  font-weight: 850;
}

.history-preview-empty small {
  max-width: 220px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.history-preview-thumb {
  position: relative;
  overflow: hidden;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f3ef;
}

.history-preview-thumb:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

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

.history-preview-thumb span,
.history-preview-more {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.history-preview-thumb.muted img {
  filter: saturate(0.55);
  opacity: 0.72;
}

.history-preview-thumb .history-preview-error {
  position: static;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 8px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.history-preview-more {
  left: auto;
  right: 8px;
}

.history-record-detail {
  display: grid;
  gap: 20px;
  padding: 0 18px 18px;
}

.history-detail-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.history-detail-head h4,
.history-detail-section h4 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.history-image-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.history-image-card.failed {
  background: #fffafa;
}

.history-image-wrap {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: #f5f4f0;
}

.history-image-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.history-image-wrap .empty-result {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 850;
}

.history-image-load-error {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 850;
}

.history-image-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
}

.toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 80;
  padding: 14px 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  font-weight: 850;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(0, 0, 0, 0.68);
}

.modal {
  width: min(720px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.36);
}

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

.modal-body {
  padding: 24px 26px 28px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 190px);
}

.modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.06);
}

.modal-footer button {
  min-width: 120px;
}

.plan-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.plan-tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f2f1ed;
  font-weight: 800;
}

.plan-tab.active {
  color: white;
  background: #111;
}

.plan-tab.loading {
  color: #8b8b8b;
  background: #f7f6f2;
  box-shadow: inset 0 0 0 1px var(--line);
}

.ai-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.ai-mode-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 900;
  color: #4b4b4b;
}

.ai-mode-tab.active {
  color: #111;
  border-color: #111;
  background: #f7f6f2;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.08);
}

.ai-style-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.ai-style-grid.muted {
  opacity: 0.45;
}

.ai-style-tag {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  color: #555;
}

.ai-style-tag.active {
  color: #fff;
  border-color: #111;
  background: #111;
}

.modal textarea {
  min-height: 290px;
  margin-bottom: 16px;
}

.close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #f1f0ec;
}

.lightbox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.lightbox img {
  width: min(680px, 84vw);
  max-height: 86vh;
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.36);
}

.lightbox-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.lightbox-nav {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.lightbox-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.image-preview-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.studio-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
}

.studio-lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  padding: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.studio-lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.image-preview-modal {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
}

.image-preview-modal img {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.36);
}

.image-preview-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
}

.clone-lightbox-single {
  display: grid;
  place-items: center;
}

.clone-compare-lightbox {
  padding: 28px;
}

.clone-lightbox-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, calc(100vw - 44px));
}

.clone-lightbox-compare figure {
  margin: 0;
  min-width: 0;
}

.clone-lightbox-compare figcaption {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.clone-lightbox-compare img {
  width: 100%;
  height: min(72vh, 720px);
  max-height: 72vh;
  object-fit: contain;
  border-radius: 12px;
}

.clone-lightbox-compare .empty-result {
  min-height: min(72vh, 720px);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 12px;
}

/* ================================
   复刻爆款
   ================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.clone-workspace {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.clone-uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
  align-items: start;
}

.clone-upload-col {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.clone-upload-col h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.clone-upload-col h3 small {
  font-weight: normal;
  color: #999;
}

.clone-thumb {
  position: relative;
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
}

.clone-thumb img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  display: block;
}

.clone-thumb button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.clone-controls {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.clone-controls .select-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.clone-controls .select-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: #666;
}

.clone-model-select {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.clone-model-label {
  font-size: 0.85rem;
  color: #666;
  white-space: nowrap;
}
.clone-model-select select {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line, #ddd);
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

.clone-generating {
  text-align: center;
  padding: 48px 20px;
}

.clone-generating .spinner {
  margin: 0 auto 20px;
}

/* ── 生成中页面 ── */
.clone-generating-stage {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.clone-gen-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.clone-gen-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.clone-gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.clone-gen-card {
  background: #fafafa;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.clone-gen-ref {
  flex-shrink: 0;
  width: 120px;
}

.clone-gen-ref .img-wrap {
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
}

.clone-gen-ref img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  display: block;
}

.clone-gen-waiting {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clone-gen-waiting-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clone-gen-waiting-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e8e4dc;
  border-radius: 8px;
  color: #7a756e;
  font-size: 13px;
}

.mini-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #e0dcd4;
  border-top-color: #8b7dd6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.clone-gen-footer {
  margin-top: 20px;
  text-align: center;
}

.clone-result {
  margin-top: 32px;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.clone-result h3 {
  margin-bottom: 16px;
}

.clone-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.clone-side {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
}

.clone-side img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}

.clone-side .tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.clone-arrow {
  font-size: 2rem;
  color: #aaa;
}

.clone-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.clone-actions-spaced {
  margin-top: 20px;
}

.clone-hint-centered {
  text-align: center;
}

.clone-zoom-preview {
  cursor: zoom-in;
}

/* ── 爆款参考图列表（左侧，纵向排列）─── */
.clone-ref-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.clone-ref-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 8px;
}

.clone-ref-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.clone-ref-item .num {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clone-ref-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(220,60,60,0.75);
  color: #fff;
  font-size: .85rem;
  cursor: pointer;
  line-height: 1;
}

.clone-ref-item .asset-status {
  left: 96px;
  right: 34px;
  bottom: 8px;
  max-width: none;
}

.clone-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  color: #aaa;
  font-size: .9rem;
}
.clone-add-btn input { display: none; }
.clone-add-btn:hover { border-color: #999; color: #666; }

/* ── 批量结果 ── */
.clone-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.clone-result-card {
  background: #fafafa;
  border-radius: 12px;
  padding: 12px;
}

.clone-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.clone-result-head h3 {
  margin: 0;
}

.clone-summary {
  padding: 8px 10px;
  border-radius: 12px;
  background: #f7f5ef;
  color: #3b3935;
  font-size: 13px;
  font-weight: 850;
}

.clone-summary.partial_success {
  background: #fffbeb;
  color: #92400e;
}

.clone-summary.failed {
  background: #fef2f2;
  color: #991b1b;
}

.clone-failure {
  padding: 18px;
  border: 1px solid #fecaca;
  background: #fffafa;
}

.clone-result-pair {
  display: grid;
  grid-template-columns: minmax(140px, 160px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 8px;
}

.clone-result-side {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f5f4f0;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.clone-result-ref-side {
  min-width: 140px;
}

.clone-result-two {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.clone-result-side img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  display: block;
}

.clone-result-ref-frame {
  min-height: 220px;
  display: grid;
  place-items: center;
}

.clone-result-ref-frame img {
  height: 220px;
}

.clone-result-side .tag {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: .7rem;
  z-index: 2;
}

.clone-result-side .tag.green {
  background: rgba(0,160,110,0.85);
}

/* reviewStatus 样式 */
.clone-result-side.review-accepted {
  border-color: #22c55e;
  background: #f0fdf4;
}

.clone-result-side.review-rejected {
  border-color: #d1d5db;
  background: #f9fafb;
}

.clone-result-side.review-rejected img {
  filter: saturate(0.5) opacity(0.55);
}

.review-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: .7rem;
  font-weight: 700;
  z-index: 2;
}

.review-badge.accepted {
  background: #22c55e;
  color: #fff;
}

.review-badge.rejected {
  background: #6b7280;
  color: #fff;
}

.review-badge.pending {
  background: rgba(245, 158, 11, 0.9);
  color: #fff;
}

/* 失败图卡片 */
.clone-result-failed-side {
  border-radius: 10px;
  background: #fef2f2;
  padding: 14px;
}

.clone-result-failed-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  text-align: center;
}

.clone-result-loading-side {
  border-color: #dbeafe;
  background: #f8fbff;
}

.clone-result-loading-box {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}

.clone-result-meta {
  padding: 8px;
  background: #fff;
  border-top: 1px solid #ece9e2;
}

/* 图片容器 + 悬浮下载按钮 */
.clone-result-side .img-wrap {
  position: relative;
}

.clone-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border-top: 1px solid #ece9e2;
}

.clone-preview-actions button {
  flex: 1 1 86px;
  min-height: 30px;
  border: 1px solid #e4ded2;
  border-radius: 7px;
  background: #fbfaf7;
  color: #3b3935;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.clone-preview-actions button:hover {
  background: #f2eee5;
}

.clone-preview-actions button.reject {
  border-color: #fecaca;
  color: #991b1b;
}

.clone-preview-actions button.restore {
  border-color: #bbf7d0;
  color: #166534;
}

.clone-result-side .img-dl {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .2s;
  z-index: 2;
}
.clone-result-side:hover .img-dl {
  opacity: 1;
}
.clone-result-side .img-dl:hover {
  background: rgba(0,0,0,0.7);
}

/* ── 新版操作按钮 ── */
.clone-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: #fff;
  border-top: 1px solid #ece9e2;
}

.clone-result-actions .btn-icon,
.clone-result-actions .btn-accept,
.clone-result-actions .btn-reject {
  flex: 1 1 70px;
  min-height: 32px;
  border: 1px solid #e4ded2;
  border-radius: 8px;
  background: #fbfaf7;
  color: #3b3935;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.clone-result-actions .btn-icon:hover {
  background: #f2eee5;
  border-color: #d4ccb8;
}

.clone-result-actions .btn-accept {
  border-color: #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.clone-result-actions .btn-accept:hover {
  background: #dcfce7;
}

.clone-result-actions .btn-accept.active {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}

.clone-result-actions .btn-reject {
  border-color: #e5e7eb;
  color: #6b7280;
  background: #f9fafb;
}

.clone-result-actions .btn-reject:hover {
  background: #f3f4f6;
}

.clone-result-actions .btn-reject.active {
  background: #6b7280;
  color: #fff;
  border-color: #6b7280;
}

.clone-mini-arrow {
  font-size: 1.2rem;
  color: #bbb;
}

.clone-result-actions {
  text-align: center;
}

@media (max-width: 640px) {
  .clone-uploads,
  .clone-controls .select-row,
  .clone-compare,
  .clone-result-pair,
  .clone-result-grid {
    grid-template-columns: 1fr;
  }

  .clone-workspace {
    max-width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    overflow-x: hidden;
  }

  .clone-upload-col,
  .clone-controls {
    min-width: 0;
  }

  .clone-model-select {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .clone-model-label {
    white-space: normal;
  }

  .clone-model-select select {
    width: 100%;
    min-width: 0;
  }

  .clone-actions {
    flex-direction: column;
  }

  .clone-arrow,
  .clone-mini-arrow {
    text-align: center;
    transform: rotate(90deg);
  }

  .clone-lightbox-compare {
    grid-template-columns: 1fr;
  }

  .clone-lightbox-compare img,
  .clone-lightbox-compare .empty-result {
    height: min(42vh, 420px);
  }
}

.lightbox .close {
  position: absolute;
  top: 26px;
  right: 26px;
}

@media (max-width: 980px) {
  .nav {
    overflow-x: auto;
  }

  .workspace,
  .result-gallery.multi,
  .result-pair {
    grid-template-columns: 1fr;
  }

  .steps {
    justify-content: flex-start;
    overflow-x: auto;
  }

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

@media (max-width: 640px) {
  .hero,
  .workspace {
    padding-left: 14px;
    padding-right: 14px;
  }

  .nav {
    padding: 0 14px;
    height: auto;
    min-height: 78px;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .nav-links {
    display: flex;
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-pill {
    flex: 0 0 auto;
  }

  .nav-actions {
    margin-left: auto;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .user-quota-card {
    max-width: calc(100vw - 118px);
    justify-content: flex-end;
    gap: 6px;
  }

  .quota-pill {
    min-height: 28px;
    padding: 5px 8px;
    white-space: normal;
  }

  .history-page {
    width: calc(100% - 28px);
    padding-top: 22px;
  }

  .history-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-summary {
    width: 100%;
  }

  .history-toolbar,
  .history-detail-head {
    align-items: stretch;
    flex-direction: column;
  }

  .history-record-main {
    grid-template-columns: 1fr;
    padding: 12px;
  }

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

  .history-record-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .history-preview-strip {
    min-height: 0;
  }

  .history-record-detail {
    padding: 0 12px 12px;
  }

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

  .select-row,
  .planning-prompts {
    grid-template-columns: 1fr;
  }

  .steps {
    width: calc(100% - 28px);
    justify-content: flex-start;
    overflow-x: auto;
    padding: 14px 16px;
    -webkit-overflow-scrolling: touch;
  }

  .step {
    gap: 8px;
    font-size: 13px;
  }

  .step + .step::before {
    width: clamp(18px, 6vw, 32px);
    margin: 0 8px;
  }

  .toast {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: calc(100vw - 28px);
  }

  .overlay {
    padding: 14px;
  }

  .modal-head,
  .modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .plan-tabs {
    flex-wrap: wrap;
  }

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

/* ═══════════════════════════════════════════════════ */
/* 产品身份包 — 3×3 采集表 + 质检栏 + 放大预览          */
/* ═══════════════════════════════════════════════════ */

.identity-workbench {
  max-width: 1360px;
  margin: 0 auto;
  padding: 16px 24px 50px;
}

/* ── Hero ── */
.ip-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.ip-hero-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ip-breadcrumb {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.ip-hero h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ip-hero-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ip-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ip-status-badge.sm {
  padding: 2px 8px;
  font-size: 10px;
}

.ip-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-draft    { background: #f0f0ed; color: #6b6b6b; }
.status-pending  { background: #fff3e0; color: #e65100; }
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #ffebee; color: #c62828; }

.ip-pack-id {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 10px;
  color: var(--muted);
}

/* ── Error Bar ── */
.ip-error-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #c62828;
  font-weight: 600;
}

.ip-error-icon { font-weight: 700; }

/* ═══════════════════════════════════════════════════ */
/* 素材库 Tab / 列表 / 审核详情                         */
/* ═══════════════════════════════════════════════════ */

.ip-library-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 16px;
}

.ip-library-tab-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ip-library-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ip-library-tab.active {
  color: var(--ink);
  border-color: #8b7dd6;
  background: #f4f1ff;
}

.ip-library-panel,
.ip-review-layout {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ip-library-panel {
  overflow: hidden;
}

.ip-list-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.ip-list-empty.error {
  color: #c62828;
}

.ip-profile-table {
  display: flex;
  flex-direction: column;
}

.ip-profile-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(180px, 1.5fr) 120px 100px 130px 120px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.ip-profile-row:first-child {
  border-top: 0;
}

.ip-profile-row.head {
  background: #f7f7f4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ip-profile-row.pending {
  background: #fffaf2;
}

.ip-profile-row strong,
.ip-profile-row small {
  display: block;
}

.ip-profile-row small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.ip-btn-primary.slim,
.ip-btn-secondary.slim {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.ip-btn-danger {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #ffcdd2;
  background: #ffebee;
  color: #b71c1c;
  font-family: inherit;
}

.ip-btn-danger:hover {
  background: #ffcdd2;
}

.ip-btn-danger.ghost {
  background: #fff;
  color: #9f1d1d;
}

.ip-btn-danger.ghost:hover {
  background: #fff5f5;
}

.ip-review-layout {
  display: grid;
  grid-template-columns: minmax(680px, 1fr) 360px;
  gap: 18px;
  align-items: start;
  overflow: visible;
}

.ip-review-media {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.ip-review-media-sticky {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
}

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

.ip-review-head h3 {
  margin: 0;
  font-size: 16px;
}

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

.ip-detail-cell,
.ip-reference-card {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  color: var(--ink);
  font-family: inherit;
}

.ip-detail-cell.empty {
  border-style: dashed;
  color: var(--muted);
}

.ip-detail-cell.needs-retake {
  border-color: #ef9a9a;
  background: #fff7f7;
}

.ip-detail-cell.selected-current,
.ip-slot.selected-current {
  border-color: #7c68d6;
  box-shadow: 0 0 0 2px rgba(124, 104, 214, 0.18);
}

.ip-detail-cell.selected-retake {
  box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.18);
}

.ip-detail-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 156px;
  border: 0;
  padding: 0;
  background: #fff;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}

.ip-detail-thumb:disabled {
  cursor: default;
  background: #f8fafc;
}

.ip-detail-cell img,
.ip-reference-card img {
  width: 100%;
  height: 156px;
  object-fit: contain;
  background: #fff;
}

.ip-detail-cell span,
.ip-reference-card span {
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.ip-detail-cell-meta {
  border-top: 1px solid var(--line);
  background: #fff;
  min-height: 38px;
  position: relative;
}

.ip-detail-cell-meta span {
  display: block;
}

.ip-detail-cell-meta small {
  display: inline-flex;
  margin: 0 8px 6px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.ip-retake-status {
  background: #ffebee;
  color: #b71c1c;
}

.ip-approved-status {
  background: #e8f5e9;
  color: #2e7d32;
}

.ip-review-slot-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 8px;
  padding: 6px 8px;
  border: 1px solid #f0d5d5;
  border-radius: 6px;
  background: #fffafa;
  color: #8d1b1b;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.ip-review-slot-check input {
  width: 14px;
  height: 14px;
  accent-color: #b71c1c;
}

.ip-review-slot-check span {
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}

.ip-detail-zoom-mini {
  margin: 0 8px 8px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.ip-detail-zoom-mini:hover {
  color: #5f4fc6;
  border-color: #c8c0ef;
}

.ip-reference-card {
  margin-top: 12px;
  width: min(260px, 100%);
}

.ip-review-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding-right: 4px;
}

.ip-review-side-top,
.ip-side-sticky-top {
  position: sticky;
  top: 0;
  z-index: 4;
}

.ip-overview-card {
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.ip-detail-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px dashed var(--line);
}

.ip-detail-line span {
  color: var(--muted);
  font-weight: 700;
}

.ip-detail-line strong {
  text-align: right;
}

.ip-review-summary {
  margin-bottom: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #f7f7f4;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.ip-check-line {
  display: grid;
  grid-template-columns: minmax(54px, 0.8fr) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12px;
}

.ip-check-line span {
  color: var(--muted);
  font-weight: 700;
}

.ip-check-line strong {
  justify-self: end;
  font-size: 12px;
}

.ip-check-line.ok strong {
  color: #2e7d32;
}

.ip-check-line.missing strong {
  color: #b45309;
}

.ip-check-line small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.ip-missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}

.ip-missing-list span {
  padding: 3px 6px;
  border-radius: 5px;
  background: #fff3e0;
  color: #9a4a00;
  font-size: 11px;
  font-weight: 800;
}

.ip-retake-card {
  border-color: #f0c7c7;
  background: #fffafa;
}

.ip-retake-card p {
  margin: 6px 0 8px;
  color: #7f1d1d;
  font-size: 12px;
  font-weight: 750;
}

.ip-retake-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}

.ip-retake-list span {
  padding: 3px 6px;
  border-radius: 5px;
  background: #ffebee;
  color: #b71c1c;
  font-size: 11px;
  font-weight: 800;
}

.ip-retake-list.compact {
  margin: 6px 0 8px;
  gap: 4px;
}

.ip-retake-list.compact span {
  font-size: 10px;
  padding: 2px 5px;
}

.ip-advice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.ip-advice-list p {
  margin: 0;
  padding: 7px 9px;
  border-radius: 6px;
  background: #f4f1ff;
  color: #3f347c;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.ip-detail-rule {
  margin-bottom: 10px;
}

.ip-detail-rule span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  margin-bottom: 3px;
}

.ip-detail-rule p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
}

.ip-permission-note {
  background: #fffaf2;
  border-color: #ead6a8;
}

.ip-permission-note p {
  margin: 0;
  color: #7a5b1a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.ip-review-comment,
.ip-sb-field textarea {
  min-height: 62px;
  resize: vertical;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}

.ip-review-comment:focus,
.ip-sb-field textarea:focus {
  outline: none;
  border-color: #8b7dd6;
}

.ip-empty-line {
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.ip-btn-secondary.wide {
  width: 100%;
  margin-top: 10px;
}

.ip-review-panel-card {
  border-color: #d9d1f1;
}

.ip-review-subtitle {
  margin: 10px 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.ip-review-basics {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}

.ip-keep-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}

.ip-keep-list span {
  padding: 3px 6px;
  border-radius: 5px;
  background: #eef7ee;
  color: #2e7d32;
  font-size: 11px;
  font-weight: 800;
}

.ip-keep-list.compact {
  gap: 4px;
  margin: 6px 0 8px;
}

.ip-keep-list.compact span {
  padding: 2px 5px;
  font-size: 10px;
}

.ip-review-comment.compact {
  min-height: 52px;
  margin: 8px 0;
}

.ip-review-comment-label {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.ip-review-self-notice {
  margin: 8px 0 0;
  padding: 8px 9px;
  border: 1px solid #ead6a8;
  border-radius: 7px;
  background: #fffaf2;
  color: #7a5b1a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.ip-sb-field textarea:disabled,
.ip-sb-field input:disabled,
.ip-sb-field select:disabled {
  background: #f5f4f0;
  color: var(--muted);
}

.ip-ref-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 10px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f4;
}

.ip-ref-grid-large {
  gap: 5px;
  padding: 8px;
}

.ip-ref-item {
  margin: 0;
  min-width: 0;
}

.ip-ref-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 5px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px dashed #d9d7d0;
}

.ip-ref-cell.filled {
  border-style: solid;
}

.ip-ref-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ip-ref-caption {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.ip-ref-empty {
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.ip-ref-empty.slim {
  margin-top: 0;
  padding: 10px;
}

.ip-ref-empty p {
  margin: 4px 0 0;
}

.ip-ref-empty-icon {
  font-size: 22px;
  display: block;
}

.ip-final-grid-preview {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: var(--muted);
  cursor: zoom-in;
  font-family: inherit;
  text-align: left;
}

.ip-final-grid-preview:hover {
  border-color: #b9addf;
  box-shadow: 0 4px 14px rgba(139, 125, 214, 0.12);
}

.ip-final-grid-image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f5f4f0;
}

.ip-final-grid-preview span {
  display: block;
  padding: 7px 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
}

.ip-final-grid-empty {
  margin-top: 8px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  color: var(--muted);
}

.ip-final-grid-empty p {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.ip-final-grid-empty small {
  display: block;
  font-size: 11px;
  line-height: 1.45;
}

.ip-retake-note {
  margin: 10px 0;
  padding: 9px;
  border-radius: 7px;
  border: 1px solid #f0c7c7;
  background: #fff7f7;
}

.ip-retake-note strong {
  display: block;
  color: #9f1d1d;
  font-size: 12px;
}

.ip-retake-note p {
  margin: 5px 0;
  color: #7f1d1d;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.ip-retake-note small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════ */
/* 两列布局：左九宫格 + 右质检栏                        */
/* ═══════════════════════════════════════════════════ */

.ip-workspace {
  display: grid;
  grid-template-columns: minmax(680px, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

/* ═══════════════════════════════════════════════════ */
/* 标准 3×3 九宫格 — 9 格完全统一                       */
/* ═══════════════════════════════════════════════════ */

.ip-grid-9 {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 12px;
  position: sticky;
  top: 16px;
}

.ip-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
  aspect-ratio: 5 / 3;
  min-height: 130px;
  max-height: 155px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ip-slot.empty {
  border-style: dashed;
  border-color: #c4b8e0;
  background: #fafaff;
}

.ip-slot.filled {
  border-color: #d4cce8;
}

.ip-slot.needs-retake {
  border-color: #ef9a9a;
  background: #fffafa;
}

.ip-slot.filled:hover {
  box-shadow: 0 2px 8px rgba(139, 125, 214, 0.12);
  border-color: #8b7dd6;
}

/* ── 顶部行 ── */
.ip-slot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px;
  height: 20px;
  flex-shrink: 0;
  background: #f5f3fa;
  border-bottom: 1px solid var(--line);
}

.ip-slot.empty .ip-slot-top {
  background: #f0eef5;
}

.ip-slot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 15px;
  padding: 0 4px;
  background: #8b7dd6;
  color: #fff;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", monospace;
}

/* ── 按钮组 ── */
.ip-slot-btns {
  display: flex;
  gap: 2px;
}

.ip-slot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
  padding: 0;
  line-height: 1;
  color: #888;
}

.ip-slot-btn.zoom:hover { background: #e8e4f3; color: #6b5fa3; }
.ip-slot-btn.replace:hover { background: #e8e4f3; color: #6b5fa3; }
.ip-slot-btn.delete:hover { background: #ffebee; color: #c62828; }
.ip-slot-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── 图片区域 ── */
.ip-slot-img {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
  min-height: 0;
}

.ip-slot-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.ip-slot-clickable {
  cursor: pointer;
}

.ip-slot-clickable:hover {
  background: #f0eeff;
}

/* 空状态上传 */
.ip-slot.empty .ip-slot-img {
  flex-direction: column;
  cursor: pointer;
}

.ip-slot-upload-icon {
  font-size: 22px;
  font-weight: 300;
  color: #8b7dd6;
  line-height: 1;
}

.ip-slot-upload-text {
  font-size: 11px;
  font-weight: 700;
  color: #6b5fa3;
  margin-top: 3px;
}

.ip-slot-upload-hint {
  font-size: 9px;
  color: var(--muted);
  margin-top: 1px;
}

/* ── 底部行 ── */
.ip-slot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px;
  height: 20px;
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: #fafafa;
  gap: 4px;
}

.ip-slot-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ip-slot-state {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

.ip-slot-state.empty { color: var(--muted); }
.ip-slot-state.uploading { color: #e65100; background: #fff3e0; }
.ip-slot-state.done { color: #2e7d32; background: #e8f5e9; }
.ip-slot-state.retake { color: #b71c1c; background: #ffebee; }

/* ── 上传中 spinner ── */
.ip-slot-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid #e0dde8;
  border-top-color: #8b7dd6;
  border-radius: 50%;
  animation: ip-spin 0.8s linear infinite;
}

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

/* ═══════════════════════════════════════════════════ */
/* 右侧质检栏                                           */
/* ═══════════════════════════════════════════════════ */

.ip-sidebar {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding-right: 4px;
}

.ip-sidebar-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.ip-status-compact .ip-sb-missing.compact {
  max-height: 54px;
  overflow: auto;
}

.ip-side-details {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}

.ip-side-details summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  background: #f8f7f3;
  list-style: none;
}

.ip-side-details summary::-webkit-details-marker {
  display: none;
}

.ip-side-details summary::after {
  content: "+";
  float: right;
  color: var(--muted);
}

.ip-side-details[open] summary::after {
  content: "-";
}

.ip-side-details .ip-sidebar-card {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ip-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

/* ── 表单字段 ── */
.ip-sb-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.ip-sb-field:last-child { margin-bottom: 0; }

.ip-sb-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.ip-sb-field input,
.ip-sb-field select {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  width: 100%;
}

.ip-sb-field input:focus,
.ip-sb-field select:focus { border-color: #8b7dd6; }
.ip-sb-field input:disabled { background: #f5f4f0; color: var(--muted); }

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

.ip-sb-row .ip-sb-field { margin-bottom: 0; }

/* ── 状态行 ── */
.ip-sb-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}

.ip-sb-status-label {
  color: var(--muted);
  font-weight: 600;
}

.ip-sb-progress-text {
  font-weight: 700;
  font-family: "SF Mono", "Fira Code", monospace;
}

.ip-sb-progress-text.complete { color: #2e7d32; }

.ip-sb-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  padding-top: 4px;
}

.ip-sb-missing-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.ip-sb-missing-chip {
  display: inline-block;
  padding: 1px 5px;
  background: #fff3e0;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  color: #e65100;
  font-family: "SF Mono", "Fira Code", monospace;
}

.ip-sb-ready {
  font-size: 12px;
  color: #2e7d32;
  font-weight: 600;
  margin: 4px 0 0;
}

.ip-sb-grid-status {
  font-size: 11px;
  font-weight: 600;
}

.ip-sb-grid-status.done { color: #2e7d32; }
.ip-sb-grid-status.pending { color: var(--muted); }

/* ── 拍摄规范 checklist ── */
.ip-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ip-checklist li {
  padding: 4px 0 4px 20px;
  position: relative;
  font-size: 12px;
  color: var(--ink);
  line-height: 1.4;
}

.ip-checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #8b7dd6;
  font-weight: 700;
  font-size: 11px;
}

/* ── 拍摄参数 ── */
.ip-shoot-guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.ip-shoot-param {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ip-shoot-param-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ip-shoot-param-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  font-family: "SF Mono", "Fira Code", monospace;
}

/* ── 逐角度拍摄提示 ── */
.ip-angle-tips {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.ip-angle-tips-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ip-angle-tip {
  display: flex;
  gap: 5px;
  padding: 2px 0;
  font-size: 11px;
  line-height: 1.35;
  color: #555;
}

.ip-angle-tip-id {
  flex-shrink: 0;
  font-weight: 700;
  color: #8b7dd6;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 10px;
  min-width: 18px;
}

/* ── 操作按钮 ── */
.ip-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ip-btn-primary,
.ip-btn-secondary {
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
  text-align: center;
}

.ip-btn-primary { background: #8b7dd6; color: #fff; }
.ip-btn-primary:hover:not(.disabled) { background: #7965cc; }
.ip-btn-primary.disabled { background: #d4d0e0; color: #a09aaf; cursor: not-allowed; }

.ip-btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.ip-btn-secondary:hover:not(:disabled) { background: #f5f4f0; }
.ip-btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════ */
/* 图片放大预览 Modal                                   */
/* ═══════════════════════════════════════════════════ */

.ip-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: ip-fade-in 0.15s ease;
}

@keyframes ip-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ip-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.ip-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: #f5f3fa;
}

.ip-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.ip-modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  color: #666;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ip-modal-close:hover {
  background: #ffebee;
  color: #c62828;
}

.ip-modal-body {
  padding: 20px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.ip-modal-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
}

/* ── Toast ── */
.ip-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #161616;
  color: #fff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  z-index: 1500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* ── 响应式 ── */
@media (max-width: 1100px) {
  .ip-workspace {
    grid-template-columns: minmax(560px, 1fr) 300px;
    gap: 16px;
  }

  .ip-review-layout {
    grid-template-columns: minmax(560px, 1fr) 320px;
  }

  .ip-detail-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

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

  .ip-review-layout {
    grid-template-columns: 1fr;
  }

  .ip-review-media {
    border: 1px solid var(--line);
  }

  .ip-review-media-sticky,
  .ip-side-sticky-top,
  .ip-review-side-top,
  .ip-grid-9 {
    position: static;
    top: auto;
  }

  .ip-review-media-sticky,
  .ip-review-side,
  .ip-sidebar {
    max-height: none;
    overflow: visible;
  }

  .ip-profile-row {
    grid-template-columns: 1fr 1fr;
  }

  .ip-profile-row.head {
    display: none;
  }

  .ip-sidebar {
    position: static;
    order: -1;
  }

  .ip-slot {
    max-height: 140px;
    min-height: 115px;
  }
}

@media (max-width: 640px) {
  .identity-workbench {
    padding: 14px 12px 50px;
  }

  .ip-library-tabs {
    align-items: stretch;
    flex-direction: column;
  }

  .ip-library-tab-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ip-profile-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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

  .ip-grid-9 {
    grid-template-columns: 1fr 1fr;
  }

  .ip-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .ip-hero h1 { font-size: 18px; }

  .ip-grid-9 { gap: 8px; }

  .ip-slot {
    max-height: 120px;
    min-height: 100px;
  }

  .ip-slot-badge { font-size: 8px; min-width: 18px; height: 13px; }
  .ip-slot-name { font-size: 9px; }
  .ip-slot-upload-icon { font-size: 18px; }
  .ip-slot-upload-text { font-size: 10px; }

  .ip-sb-row { grid-template-columns: 1fr; }

  .ip-sidebar-actions { flex-direction: column; }
  .ip-btn-primary, .ip-btn-secondary { width: 100%; }
}

/* ── 官方图片入口面板 ── */
.official-image-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f9fafb;
}
.official-image-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.official-image-title {
  font-size: 20px;
  font-weight: 900;
  color: #111827;
}
.official-image-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #6b7280;
}
.official-image-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.official-image-btn,
label.official-image-btn {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  height: 48px;
  min-width: 0;
  padding: 0;
  border-radius: 14px;
  border: 1px solid #d8dee9;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  user-select: none;
  text-decoration: none;
}
.official-image-btn:hover {
  border-color: #93c5fd;
  background: #f8fbff;
  transform: translateY(-1px);
}
.official-image-btn input {
  display: none;
}
.official-image-btn-library {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.official-image-btn-library:hover {
  background: #dbeafe;
  border-color: #60a5fa;
}
.ip-selector-foot-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}

  /* ── 已选择官方图片卡片 ── */
  .ip-selected-pack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border: 1px solid #c7d2fe;
    border-radius: 16px;
    background: #f5f3ff;
  }
  .ip-selected-pack-head {
    display: flex;
    align-items: center;
  }
  .ip-selected-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 800;
    color: #3730a3;
    background: #e0e7ff;
    border-radius: 999px;
  }
  .ip-selected-pack-body {
    display: flex;
    gap: 16px;
    align-items: flex-start;
  }
  .ip-selected-pack-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .ip-selected-pack-sku {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
  }
  .ip-selected-pack-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
  }
  .ip-selected-pack-meta {
    font-size: 13px;
    color: #6b7280;
  }
  .ip-selected-pack-preview {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
  }
  .ip-selected-pack-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .ip-selected-pack-change {
    height: 40px;
    border: 1px solid #93c5fd;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: all 0.15s ease;
  }
  .ip-selected-pack-change:hover {
    background: #dbeafe;
    border-color: #60a5fa;
  }
  .ip-selected-pack-clear {
    height: 40px;
    border: 1px solid #fca5a5;
    border-radius: 10px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: all 0.15s ease;
  }
  .ip-selected-pack-clear:hover {
    background: #fee2e2;
    border-color: #f87171;
  }

  /* ── 选择器 Modal ── */
  .ip-selector-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
  }
  .ip-selector-modal {
    background: var(--panel);
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
  }
  .ip-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
  }
  .ip-selector-header h3 {
    margin: 0;
    font-size: 16px;
  }
  .ip-selector-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--muted);
  }
  .ip-selector-search {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
  }
  .ip-selector-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 13px;
  }
  .ip-selector-search-btn {
    padding: 8px 16px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
  }
  .ip-selector-status {
    padding: 0 20px 8px;
    font-size: 12px;
    color: var(--muted);
    min-height: 18px;
  }
  .ip-selector-error { color: var(--accent); }
  .ip-selector-results {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
  }
  .ip-selector-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .ip-selector-item:hover {
    border-color: var(--brand);
    background: var(--panel-soft);
  }
  .ip-selector-item-sku { font-size: 12px; font-weight: 600; }
  .ip-selector-item-name { font-size: 12px; }
  .ip-selector-item-meta { font-size: 11px; color: var(--muted); }
.ip-selector-item-progress { font-size: 11px; color: var(--muted); }

/* ── 企业账号治理 ── */
.admin-governance-page {
  width: min(1440px, calc(100% - 56px));
  margin: 0 auto;
  padding: 34px 0 56px;
}
.admin-page-head,
.admin-section-head,
.admin-filter-row,
.admin-grant-row,
.admin-danger-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-page-head,
.admin-section-head {
  justify-content: space-between;
}
.admin-page-head { margin-bottom: 22px; }
.admin-page-head h1,
.admin-section-head h2,
.admin-users-panel h2,
.admin-role-templates h2 { margin: 4px 0; }
.admin-page-head p,
.admin-section-head p,
.admin-detail-facts,
.admin-user-table small,
.admin-audit-list span,
.admin-one-time-secret p { color: var(--muted); }
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.admin-summary-grid > div,
.admin-form-card,
.admin-users-panel,
.admin-drawer,
.admin-role-templates,
.admin-loading,
.admin-empty,
.admin-access-denied {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.admin-summary-grid > div { padding: 14px; }
.admin-summary-grid span { display: block; color: var(--muted); font-size: 12px; }
.admin-summary-grid strong { display: block; margin-top: 7px; font-size: 23px; }
.admin-filter-row { margin: 16px 0; justify-content: flex-end; }
.admin-filter-row label,
.admin-form-grid label,
.admin-mini-section label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.admin-filter-row select,
.admin-form-grid input,
.admin-form-grid select,
.admin-mini-section input,
.admin-mini-section select,
.admin-mini-section textarea {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}
.admin-mini-section textarea { min-height: 64px; resize: vertical; }
.admin-form-card { padding: 18px; margin: 16px 0; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.admin-console-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .42fr); gap: 16px; align-items: start; }
.admin-users-panel,
.admin-drawer,
.admin-role-templates { padding: 16px; }
.admin-table-wrap { overflow: auto; }
.admin-user-table { width: 100%; border-collapse: collapse; min-width: 880px; font-size: 13px; }
.admin-user-table th,
.admin-user-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-user-table th { color: var(--muted); font-weight: 750; white-space: nowrap; }
.admin-user-table strong,
.admin-user-table small { display: block; }
.admin-user-table tr.selected { background: #f7f9fc; }
.admin-table-button,
.admin-mini-section button,
.admin-one-time-secret button {
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 7px 10px;
}
.admin-table-button:hover,
.admin-mini-section button:hover,
.admin-one-time-secret button:hover { border-color: #94a3b8; background: #f8fafc; }
.admin-status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.admin-status.enabled { color: #166534; background: #dcfce7; }
.admin-status.disabled { color: #991b1b; background: #fee2e2; }
.admin-drawer { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; }
.admin-drawer-empty { min-height: 180px; display: grid; place-items: center; color: var(--muted); }
.admin-detail-facts { display: grid; gap: 6px; font-size: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-mini-section { display: grid; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.admin-mini-section h3 { margin: 0; font-size: 15px; }
.admin-mini-section:last-child { border-bottom: 0; }
.admin-checkbox { display: flex !important; align-items: center; grid-template-columns: auto 1fr; }
.admin-checkbox input { width: auto; min-height: 0; }
.admin-danger-actions { flex-wrap: wrap; }
.admin-danger-actions button:last-child,
.admin-danger-actions button:nth-child(2) { color: #9f1239; border-color: #fda4af; background: #fff1f2; }
.admin-override-list,
.admin-audit-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.admin-override-list li,
.admin-audit-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.admin-audit-list li { padding-bottom: 7px; border-bottom: 1px solid #f1f5f9; }
.admin-role-templates { margin-top: 16px; }
.admin-role-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.admin-role-list details { border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.admin-role-list summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.admin-role-list ul { list-style: none; padding: 8px 0 0; margin: 0; display: grid; gap: 5px; }
.admin-role-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.admin-one-time-secret { border: 1px solid #fbbf24; background: #fffbeb; border-radius: 8px; padding: 14px; margin: 16px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-one-time-secret code { background: #111827; color: #fff; padding: 7px 9px; border-radius: 5px; }
.admin-one-time-secret p { width: 100%; margin: 0; font-size: 12px; }
.admin-error { color: #991b1b; background: #fff1f2; border: 1px solid #fda4af; border-radius: 8px; padding: 12px; }
.admin-notice { color: #166534; background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px; padding: 12px; }
.admin-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.admin-loading,
.admin-empty,
.admin-access-denied { padding: 32px; color: var(--muted); }
.feedback-fab { position: fixed; right: 22px; bottom: 22px; z-index: 9000; min-width: 72px; min-height: 44px; border: 1px solid #1d4ed8; border-radius: 8px; background: #2563eb; color: #fff; font: inherit; font-weight: 750; cursor: pointer; box-shadow: 0 10px 24px rgba(37, 99, 235, .24); }
.feedback-overlay { position: fixed; inset: 0; z-index: 9001; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .42); }
.feedback-modal { width: min(720px, 100%); max-height: min(820px, calc(100vh - 40px)); overflow: auto; border: 1px solid #dbe3ef; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .25); }
.feedback-modal-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.feedback-modal-head span { color: var(--muted); font-size: 12px; font-weight: 700; }
.feedback-modal-head h2 { margin: 4px 0 0; font-size: 20px; }
.feedback-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 21px; cursor: pointer; }
.feedback-form { display: grid; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.feedback-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.feedback-form select, .feedback-form input, .feedback-form textarea, .feedback-admin-actions select, .feedback-admin-actions input { width: 100%; box-sizing: border-box; min-height: 38px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fff; color: var(--text); font: inherit; }
.feedback-form textarea { min-height: 88px; resize: vertical; }
.feedback-form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.feedback-check { display: flex !important; align-items: center; gap: 7px; min-height: 38px; white-space: nowrap; }
.feedback-check input { width: auto; min-height: 0; }
.feedback-upload-row, .feedback-list-head, .feedback-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.feedback-upload-row button, .feedback-list-head button, .feedback-admin-actions button { min-height: 34px; border: 1px solid #bfdbfe; border-radius: 6px; background: #eff6ff; color: #1d4ed8; font: inherit; font-weight: 700; cursor: pointer; padding: 7px 10px; }
.feedback-upload-row small, .feedback-muted, .feedback-item small { color: var(--muted); font-size: 12px; }
.feedback-submit { min-height: 42px; border: 1px solid #1d4ed8; border-radius: 6px; background: #2563eb; color: #fff; font: inherit; font-weight: 750; cursor: pointer; }
.feedback-submit:disabled { opacity: .6; cursor: wait; }
.feedback-error, .feedback-notice { margin: 0; border-radius: 6px; padding: 10px; font-size: 13px; }
.feedback-error { color: #9f1239; background: #fff1f2; border: 1px solid #fecdd3; }
.feedback-notice { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; }
.feedback-list-section { padding: 18px 20px; }
.feedback-list-head h3 { margin: 0; font-size: 16px; }
.feedback-items { display: grid; gap: 10px; margin-top: 12px; }
.feedback-item { display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.feedback-item p { margin: 0; line-height: 1.55; }
.feedback-status { border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 750; background: #f1f5f9; color: #475569; }
.feedback-status-open { background: #dbeafe; color: #1d4ed8; }
.feedback-status-in_progress { background: #fef3c7; color: #92400e; }
.feedback-status-resolved { background: #dcfce7; color: #166534; }
.feedback-reply { display: grid; gap: 4px; border-left: 3px solid #93c5fd; padding-left: 9px; color: #334155; font-size: 13px; }
.feedback-admin-actions { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; margin-top: 3px; }
@media (max-width: 980px) {
  .admin-governance-page { width: min(100% - 28px, 1440px); }
  .admin-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-console-layout { grid-template-columns: 1fr; }
  .admin-drawer { position: static; max-height: none; }
  .admin-role-list { grid-template-columns: 1fr; }
  .feedback-admin-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .admin-page-head,
  .admin-section-head { align-items: flex-start; flex-direction: column; }
  .admin-summary-grid,
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-filter-row { justify-content: stretch; align-items: stretch; flex-direction: column; }
  .feedback-overlay { padding: 10px; }
  .feedback-fab { right: 14px; bottom: 14px; }
  .feedback-form-row, .feedback-admin-actions { grid-template-columns: 1fr; }
}
