﻿: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);
}

/* Admin dark tech console theme */
body[data-page="admin"] {
  --bg: #07111f;
  --panel: #0d1b2e;
  --panel-soft: #10243a;
  --line: rgba(103, 232, 249, 0.18);
  --text: #e6f4ff;
  --muted: #8aa4bd;
  --brand: #22d3ee;
  --brand-dark: #0891b2;
  --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.14);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  background:
    radial-gradient(circle at 18% 8%, rgba(34, 211, 238, 0.14), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(59, 130, 246, 0.13), transparent 30%),
    linear-gradient(180deg, #07111f 0%, #0a1423 48%, #07111f 100%);
}

/* Video clone dark tech workspace */
body[data-page="video"] {
  --bg: #07111f;
  --panel: #0d1b2e;
  --panel-soft: #10243a;
  --line: rgba(103, 232, 249, 0.18);
  --text: #e6f4ff;
  --muted: #8aa4bd;
  --brand: #22d3ee;
  --brand-dark: #0891b2;
  --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.14);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  background:
    radial-gradient(circle at 18% 8%, rgba(34, 211, 238, 0.14), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(59, 130, 246, 0.13), transparent 30%),
    linear-gradient(180deg, #07111f 0%, #0a1423 48%, #07111f 100%);
}

body[data-page="home"] {
  --bg: #050b14;
  --panel: #0b1627;
  --line: rgba(148, 163, 184, 0.18);
  --text: #eef8ff;
  --muted: #a8bbcd;
  --accent: #38bdf8;
  min-height: 100vh;
  overflow-x: hidden;
  background: #050b14;
  color: var(--text);
}

.home-shell {
  min-height: 100vh;
}

.home-topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(8, 17, 31, 0.72);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.home-topbar .brand strong {
  color: #f8fbff;
}

.home-topbar .brand small {
  color: #8fb2c8;
}

.home-nav {
  background: rgba(15, 23, 42, 0.66);
}

.home-hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 100svh;
  padding: 116px max(24px, calc((100vw - 1240px) / 2)) 92px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 72% 42%, rgba(16, 185, 129, 0.2), transparent 28%),
    radial-gradient(circle at 26% 24%, rgba(34, 211, 238, 0.2), transparent 30%),
    radial-gradient(circle at 86% 14%, rgba(250, 204, 21, 0.12), transparent 24%),
    linear-gradient(135deg, #030712 0%, #07111f 42%, #061928 100%);
}

.home-hero::before,
.home-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.home-hero::before {
  inset: -24%;
  background:
    linear-gradient(rgba(56, 189, 248, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, 0.09) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(125, 211, 252, 0.12), transparent 28%);
  background-size: 64px 64px, 64px 64px, 100% 100%;
  opacity: 0.3;
  transform: rotate(-10deg);
  animation: homeGridFlow 20s linear infinite;
}

.home-hero::after {
  inset: -12% -10%;
  background:
    linear-gradient(115deg, transparent 0%, rgba(125, 211, 252, 0.08) 30%, rgba(45, 212, 191, 0.24) 47%, rgba(250, 204, 21, 0.1) 58%, transparent 78%),
    radial-gradient(circle at 70% 32%, rgba(34, 211, 238, 0.14), transparent 24%);
  filter: blur(1px);
  opacity: 0.78;
  animation: homeLightSweep 8s ease-in-out infinite;
}

.home-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 0.98;
}

.home-ai-stage {
  position: absolute;
  inset: clamp(24px, 4vw, 58px);
  transform: perspective(1100px) rotateX(58deg) rotateZ(-18deg) translate3d(10%, -8%, 0);
  transform-origin: 62% 42%;
  animation: homeStageFloat 18s ease-in-out infinite alternate;
}

.home-ai-core,
.home-ai-orbit,
.home-ai-beam,
.home-ai-card,
.home-ai-particle {
  position: absolute;
  display: block;
  pointer-events: none;
}

.home-ai-core {
  left: 58%;
  top: 45%;
  width: clamp(170px, 22vw, 310px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 38%, rgba(255, 255, 255, 0.92) 0 4%, rgba(165, 243, 252, 0.58) 5% 13%, transparent 14%),
    radial-gradient(circle, rgba(34, 211, 238, 0.8) 0 12%, rgba(20, 184, 166, 0.24) 32%, transparent 66%);
  box-shadow:
    0 0 42px rgba(34, 211, 238, 0.34),
    0 0 120px rgba(20, 184, 166, 0.2),
    inset 0 0 40px rgba(255, 255, 255, 0.12);
  transform: translate(-50%, -50%);
  animation: homeCorePulse 4.8s ease-in-out infinite;
}

.home-ai-orbit {
  left: 58%;
  top: 45%;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 38px rgba(34, 211, 238, 0.08);
}

.orbit-a {
  width: clamp(380px, 48vw, 720px);
  height: clamp(190px, 25vw, 350px);
  animation: homeOrbitA 13s linear infinite;
}

.orbit-b {
  width: clamp(520px, 64vw, 920px);
  height: clamp(260px, 34vw, 440px);
  border-color: rgba(45, 212, 191, 0.2);
  animation: homeOrbitB 19s linear infinite reverse;
}

.orbit-c {
  width: clamp(250px, 34vw, 520px);
  height: clamp(125px, 18vw, 260px);
  border-color: rgba(250, 204, 21, 0.16);
  animation: homeOrbitA 9s linear infinite reverse;
}

.home-ai-beam {
  height: 1px;
  width: clamp(280px, 34vw, 520px);
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.72), transparent);
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.6));
  opacity: 0.72;
  transform-origin: center;
}

.beam-a {
  left: 48%;
  top: 34%;
  transform: rotate(8deg);
  animation: homeBeamScan 5.6s ease-in-out infinite;
}

.beam-b {
  left: 50%;
  top: 55%;
  transform: rotate(-16deg);
  animation: homeBeamScan 6.8s ease-in-out infinite -2.2s;
}

.beam-c {
  left: 63%;
  top: 68%;
  transform: rotate(24deg);
  animation: homeBeamScan 7.2s ease-in-out infinite -3.6s;
}

.home-ai-card {
  width: clamp(92px, 10vw, 154px);
  aspect-ratio: 4 / 5;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03)),
    radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.72) 0 14%, rgba(34, 211, 238, 0.28) 15% 26%, transparent 27%),
    linear-gradient(135deg, rgba(20, 184, 166, 0.5), rgba(14, 165, 233, 0.28) 52%, rgba(15, 23, 42, 0.78));
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  opacity: 0.82;
  animation: homeCardDrift 10s ease-in-out infinite;
}

.home-ai-card::before,
.home-ai-card::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  height: 7%;
  border-radius: 999px;
  background: rgba(224, 242, 254, 0.52);
}

.home-ai-card::before {
  bottom: 20%;
}

.home-ai-card::after {
  bottom: 10%;
  width: 46%;
  right: auto;
  background: rgba(250, 204, 21, 0.62);
}

.card-a {
  left: 45%;
  top: 14%;
  animation-delay: -1s;
}

.card-b {
  left: 75%;
  top: 21%;
  transform: scale(0.86);
  animation-delay: -3.2s;
}

.card-c {
  left: 68%;
  top: 62%;
  transform: scale(1.08);
  animation-delay: -5.4s;
}

.card-d {
  left: 33%;
  top: 58%;
  transform: scale(0.92);
  animation-delay: -6.4s;
}

.card-e {
  left: 83%;
  top: 52%;
  transform: scale(0.7);
  animation-delay: -7.8s;
}

.card-f {
  left: 53%;
  top: 78%;
  transform: scale(0.74);
  animation-delay: -9s;
}

.home-ai-particle {
  width: 7px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #a5f3fc;
  box-shadow: 0 0 16px rgba(125, 211, 252, 0.8);
  opacity: 0.8;
  animation: homeParticleRise 7s ease-in-out infinite;
}

.particle-a {
  left: 52%;
  top: 28%;
}

.particle-b {
  left: 82%;
  top: 38%;
  animation-delay: -2s;
}

.particle-c {
  left: 64%;
  top: 76%;
  animation-delay: -4s;
}

.particle-d {
  left: 40%;
  top: 46%;
  animation-delay: -5.5s;
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(3, 7, 18, 0.99) 0%, rgba(5, 11, 20, 0.86) 34%, rgba(5, 11, 20, 0.22) 70%, rgba(5, 11, 20, 0.74) 100%),
    linear-gradient(180deg, rgba(5, 11, 20, 0.24) 0%, rgba(5, 11, 20, 0.96) 100%);
}

.home-hero-content {
  position: relative;
  z-index: 2;
  width: min(760px, 100%);
}

@keyframes homeGridFlow {
  0% {
    background-position: 0 0, 0 0;
    transform: rotate(-8deg) translate3d(0, 0, 0);
  }
  100% {
    background-position: 116px 116px, 116px 116px;
    transform: rotate(-8deg) translate3d(-42px, 28px, 0);
  }
}

@keyframes homeLightSweep {
  0%,
  100% {
    transform: translate3d(-10%, 0, 0);
    opacity: 0.42;
  }
  50% {
    transform: translate3d(8%, -2%, 0);
    opacity: 0.8;
  }
}

@keyframes homeStageFloat {
  0% {
    transform: perspective(1100px) rotateX(58deg) rotateZ(-18deg) translate3d(7%, -10%, 0) scale(0.98);
  }
  100% {
    transform: perspective(1100px) rotateX(56deg) rotateZ(-14deg) translate3d(12%, -5%, 0) scale(1.04);
  }
}

@keyframes homeCorePulse {
  0%,
  100% {
    filter: saturate(1) brightness(1);
    opacity: 0.82;
    transform: translate(-50%, -50%) scale(0.96);
  }
  50% {
    filter: saturate(1.18) brightness(1.12);
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

@keyframes homeOrbitA {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes homeOrbitB {
  0% {
    transform: translate(-50%, -50%) rotate(12deg) scale(0.96);
  }
  50% {
    transform: translate(-50%, -50%) rotate(192deg) scale(1.04);
  }
  100% {
    transform: translate(-50%, -50%) rotate(372deg) scale(0.96);
  }
}

@keyframes homeBeamScan {
  0%,
  100% {
    opacity: 0.16;
    clip-path: inset(0 74% 0 0);
  }
  45%,
  58% {
    opacity: 0.78;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes homeCardDrift {
  0%,
  100% {
    translate: 0 0;
    opacity: 0.7;
  }
  50% {
    translate: 0 -18px;
    opacity: 0.95;
  }
}

@keyframes homeParticleRise {
  0% {
    transform: translate3d(0, 18px, 0) scale(0.72);
    opacity: 0;
  }
  28%,
  72% {
    opacity: 0.82;
  }
  100% {
    transform: translate3d(24px, -58px, 0) scale(1.15);
    opacity: 0;
  }
}

.home-kicker {
  margin: 0 0 16px;
  color: #7dd3fc;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.home-hero h1 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(38px, 5.4vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 950;
  text-shadow: 0 14px 36px rgba(56, 189, 248, 0.18);
}

.home-subtitle {
  width: min(620px, 100%);
  margin: 22px 0 0;
  color: #d7e5f2;
  font-size: clamp(15px, 1.45vw, 18px);
  line-height: 1.82;
  font-weight: 760;
}

.home-subtitle span {
  display: block;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
}

.home-primary-button,
.home-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 8px;
  padding: 0 20px;
  text-decoration: none;
  font-weight: 950;
}

.home-primary-button {
  border: 1px solid rgba(125, 211, 252, 0.62);
  background: linear-gradient(135deg, #67e8f9 0%, #38bdf8 48%, #2563eb 100%);
  color: #06111f;
  box-shadow: 0 18px 44px rgba(56, 189, 248, 0.22);
}

.home-primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 56px rgba(56, 189, 248, 0.28);
}

.home-secondary-link {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.62);
  color: #dbeafe;
}

.home-signal-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: min(1240px, calc(100vw - 32px));
  margin: -206px auto 30px;
  position: relative;
  z-index: 3;
}

.home-signal-row > div {
  min-height: 108px;
  border: 1px solid rgba(103, 232, 249, 0.16);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(10, 24, 42, 0.86);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.home-signal-row span {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 950;
}

.home-signal-row strong {
  display: block;
  margin-top: 8px;
  color: #f8fbff;
  font-size: 17px;
}

.home-signal-row p {
  margin: 7px 0 0;
  color: #9fb2c5;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

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

body[data-page="video"] .video-workbench-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  padding-left: 0;
}

body[data-page="video"] .video-form-panel,
body[data-page="video"] .video-history-panel {
  width: 100%;
}

body[data-page="video"] .video-form-panel .section-head,
body[data-page="video"] .video-form-panel h1,
body[data-page="video"] .video-form-panel .eyebrow {
  text-align: left;
}

body[data-page="video"] .video-task-summary {
  display: none;
}

body[data-page="video"] .video-member-credits {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  border: 1px solid rgba(187, 247, 208, 0.34);
  border-radius: 8px;
  padding: 14px;
  background: rgba(4, 120, 87, 0.28);
}

body[data-page="video"] .video-member-credits div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body[data-page="video"] .video-member-credits > div:first-child {
  display: none;
}

body[data-page="video"] .video-member-credits .mini-button,
body[data-page="video"] #refreshVideoMember {
  display: none;
}

body[data-page="video"] .video-member-credits span {
  color: rgba(236, 253, 245, 0.82);
  font-size: 0;
  font-weight: 850;
}

body[data-page="video"] .video-member-credits span::before {
  content: "当前可生成AI视频条数";
  font-size: 0.86rem;
}

body[data-page="video"] .video-member-credits strong {
  overflow: hidden;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: rgba(236, 253, 245, 0.9);
  font-size: 0;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="video"] .video-member-credits strong::after {
  content: "/次 AI视频";
  font-size: 0.86rem;
  font-weight: 850;
}

body[data-page="video"] .video-member-credits b {
  color: #fff;
  font-size: clamp(34px, 4.8vw, 52px);
  line-height: 0.9;
  font-weight: 950;
}

body[data-page="video"] .video-member-credits {
  grid-template-columns: 1fr;
}

body[data-page="video"] .video-member-credits > div:nth-child(2) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 18px;
}

body[data-page="video"] .video-member-credits > div:nth-child(2)::after {
  content: "AI视频次数·不限使用时间";
  grid-column: 1 / -1;
  width: fit-content;
  border: 1px solid rgba(253, 224, 71, 0.5);
  border-radius: 999px;
  padding: 4px 9px;
  background: linear-gradient(135deg, rgba(255, 247, 173, 0.95), rgba(250, 204, 21, 0.88));
  color: #3b2600;
  font-size: 0.82rem;
  font-weight: 950;
}

body[data-page="video"] .video-member-credits span::before {
  content: "AI生视频条数";
  display: inline-block;
  width: fit-content;
  border: 1px solid rgba(253, 224, 71, 0.5);
  border-radius: 999px;
  padding: 4px 9px;
  background: linear-gradient(135deg, rgba(255, 247, 173, 0.95), rgba(250, 204, 21, 0.88));
  color: #3b2600;
  font-size: 0.9rem;
  font-weight: 950;
}

body[data-page="video"] .video-member-credits strong {
  grid-row: span 2;
  justify-self: end;
}

body[data-page="video"] .video-member-credits strong::before {
  content: "当前可生成";
  color: rgba(236, 253, 245, 0.86);
  font-size: 0.82rem;
  font-weight: 850;
}

body[data-page="video"] .video-member-credits strong::after {
  content: "/条 AI视频";
  font-size: 0.82rem;
  font-weight: 850;
}

body[data-page="video"] .topbar,
body[data-page="video"] .panel {
  border-color: rgba(103, 232, 249, 0.18);
  background: linear-gradient(180deg, rgba(13, 27, 46, 0.94), rgba(9, 19, 34, 0.96));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-page="video"] .topbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: center;
  position: sticky;
  top: 10px;
  z-index: 20;
  backdrop-filter: blur(16px);
}

body[data-page="video"] .brand-mark {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.28);
}

body[data-page="video"] .brand strong,
body[data-page="video"] .section-head h1,
body[data-page="video"] .section-head h2,
body[data-page="video"] .subhead,
body[data-page="video"] .queue-title {
  color: #f8fbff;
}

body[data-page="video"] .brand small,
body[data-page="video"] .field span,
body[data-page="video"] .field small,
body[data-page="video"] .queue-detail,
body[data-page="video"] .meta-row,
body[data-page="video"] .eyebrow {
  color: #8aa4bd;
}

body[data-page="video"] .eyebrow {
  color: #67e8f9;
  letter-spacing: 0;
}

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

body[data-page="video"] .topnav a.active,
body[data-page="video"] .topnav a:hover {
  background: rgba(34, 211, 238, 0.13);
  color: #67e8f9;
}

body[data-page="video"] input,
body[data-page="video"] textarea,
body[data-page="video"] select {
  border-color: rgba(103, 232, 249, 0.2);
  background: rgba(5, 13, 24, 0.76);
  color: #e6f4ff;
}

body[data-page="video"] input::placeholder,
body[data-page="video"] textarea::placeholder {
  color: #60758a;
}

body[data-page="video"] input:focus,
body[data-page="video"] textarea:focus,
body[data-page="video"] select:focus {
  outline: 0;
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

body[data-page="video"] .button.primary {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  color: #fff;
  box-shadow: 0 12px 28px rgba(34, 211, 238, 0.18);
}

body[data-page="video"] .button.secondary,
body[data-page="video"] .button.ghost,
body[data-page="video"] .mini-button {
  border-color: rgba(103, 232, 249, 0.16);
  background: rgba(16, 36, 58, 0.72);
  color: #b7cadb;
}

body[data-page="video"] .status-pill {
  border: 1px solid rgba(103, 232, 249, 0.22);
  background: rgba(34, 211, 238, 0.12);
  color: #a5f3fc;
}

body[data-page="video"] .status-pill.success {
  border-color: rgba(52, 211, 153, 0.28);
  background: rgba(52, 211, 153, 0.13);
  color: #b8f7d8;
}

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

body[data-page="video"] .thumb-card,
body[data-page="video"] .queue-card,
body[data-page="video"] .thumb-grid.empty,
body[data-page="video"] .queue-list.empty {
  border-color: rgba(103, 232, 249, 0.14);
  background: rgba(16, 36, 58, 0.72);
  color: #93a9bd;
}

body[data-page="video"] .thumb-body strong {
  color: #f8fbff;
}

body[data-page="video"] .queue-card[data-status="blocked"] {
  border-color: rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.08);
}

body[data-page="video"] .danger-text {
  color: #fca5a5;
}

body[data-page="video"] .video-form-panel {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 116px);
  overflow: auto;
  scrollbar-gutter: stable;
}

body[data-page="video"] .preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  cursor: pointer;
}

body[data-page="video"] .video-upload-thumb {
  position: relative;
}

body[data-page="video"] .video-history-list {
  gap: 12px;
}

body[data-page="video"] .video-result-card[data-status="completed"] {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(20, 83, 45, 0.22);
}

body[data-page="video"] .video-result-card[data-status="running"] {
  border-color: rgba(56, 189, 248, 0.38);
  background: rgba(12, 74, 110, 0.2);
}

body[data-page="video"] .video-result-card[data-status="failed"] {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.22);
}

body[data-page="video"] .video-success-time {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
}

body[data-page="video"] .video-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

body[data-page="video"] .video-result-item {
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.55);
}

body[data-page="video"] .video-result-item video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 360px;
  background: #020617;
  object-fit: contain;
}

body[data-page="video"] .video-result-item figcaption {
  padding: 8px 10px 4px;
  font-size: 12px;
  color: #cbd5e1;
}

body[data-page="video"] .video-result-item .mini-button {
  margin: 0 10px 10px;
}

body[data-page="video"] .video-history-panel {
  border-color: rgba(103, 232, 249, 0.18);
  min-height: calc(100vh - 118px);
}

body[data-page="video"] .video-history-panel .section-head {
  position: sticky;
  top: 88px;
  z-index: 4;
  margin: -2px -2px 14px;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(9, 19, 34, 0.96);
  backdrop-filter: blur(14px);
}

body[data-page="video"] .video-history-panel .compact-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
  margin-bottom: 12px;
}

body[data-page="video"] .video-history-panel .subhead {
  margin-bottom: 7px;
  font-size: 0.86rem;
}

body[data-page="video"] .video-history-panel .thumb-grid {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

body[data-page="video"] .video-history-panel .thumb-card img,
body[data-page="video"] .video-history-panel .thumb-card video {
  aspect-ratio: 1 / 1;
}

body[data-page="video"] .video-history-panel .thumb-body {
  padding: 7px;
}

body[data-page="video"] .video-history-panel .thumb-body strong {
  font-size: 0.76rem;
}

body[data-page="video"] .video-history-panel .thumb-body span {
  font-size: 0.7rem;
}

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

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

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

body[data-page="video"] .history-date-filter strong,
body[data-page="video"] .history-title {
  color: #e7f3ff;
}

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

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

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

body[data-page="video"] .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-date-filter,
body[data-page="video"] .history-date-filter {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  gap: 12px;
  border: 1px solid rgba(125, 211, 252, 0.36);
  border-radius: 14px;
  padding: 11px 12px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(20, 184, 166, 0.14)),
    rgba(7, 17, 31, 0.9);
  box-shadow: 0 16px 34px rgba(3, 10, 24, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body[data-page="video"] .history-date-filter {
  border-color: rgba(167, 139, 250, 0.38);
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.24), rgba(14, 165, 233, 0.15)),
    rgba(7, 17, 31, 0.9);
}

body[data-page="image"] .history-date-filter span,
body[data-page="video"] .history-date-filter span {
  color: rgba(226, 232, 240, 0.86);
  font-size: 0.74rem;
  letter-spacing: 0;
}

body[data-page="image"] .history-date-filter strong,
body[data-page="video"] .history-date-filter strong {
  color: #ffffff;
  font-size: 1.08rem;
  text-shadow: 0 0 18px rgba(125, 211, 252, 0.34);
}

body[data-page="image"] .history-date-filter input,
body[data-page="video"] .history-date-filter input {
  min-height: 40px;
  border: 1px solid rgba(186, 230, 253, 0.52);
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(240, 249, 255, 0.94);
  color: #082f49;
  font-weight: 850;
  color-scheme: light;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 24px rgba(14, 165, 233, 0.14);
}

body[data-page="video"] .history-date-filter input {
  border-color: rgba(221, 214, 254, 0.55);
  background: rgba(245, 243, 255, 0.95);
  color: #312e81;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 24px rgba(124, 58, 237, 0.14);
}

body[data-page="image"] .history-date-filter input:focus,
body[data-page="video"] .history-date-filter input:focus {
  outline: none;
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.22), 0 12px 26px rgba(14, 165, 233, 0.18);
}

body[data-page="image"] .history-date-tabs,
body[data-page="video"] .history-date-tabs {
  gap: 10px;
  padding: 10px 2px 4px;
}

body[data-page="image"] .history-date-tab,
body[data-page="video"] .history-date-tab {
  border: 1px solid rgba(186, 230, 253, 0.36);
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(15, 23, 42, 0.84);
  color: #e0f2fe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body[data-page="video"] .history-date-tab {
  border-color: rgba(221, 214, 254, 0.34);
  color: #ede9fe;
}

body[data-page="image"] .history-date-tab strong,
body[data-page="video"] .history-date-tab strong {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  text-align: center;
}

body[data-page="image"] .history-date-tab.active,
body[data-page="video"] .history-date-tab.active {
  border-color: rgba(250, 204, 21, 0.78);
  background: linear-gradient(135deg, #facc15, #22d3ee);
  color: #09202f;
  box-shadow: 0 12px 26px rgba(34, 211, 238, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

body[data-page="video"] .history-date-tab.active {
  background: linear-gradient(135deg, #facc15, #a78bfa);
  color: #21113d;
}

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

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

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

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

body[data-page="video"] .history-videos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

body[data-page="video"] .history-video {
  position: relative;
  overflow: hidden;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.8);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

body[data-page="video"] .history-video:hover,
body[data-page="video"] .history-video:focus-visible {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
  outline: none;
}

body[data-page="video"] .history-video.selected {
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

body[data-page="video"] .history-video video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 320px;
  background: #020617;
  object-fit: contain;
}

body[data-page="video"] .history-video figcaption {
  overflow: hidden;
  padding: 6px 7px;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="video"] .history-video.selected .image-check {
  border-color: #fff;
  background: #0891b2;
}

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

body[data-page="video"] .history-actions .mini-button.primary {
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(34, 211, 238, 0.14);
  color: #a5f3fc;
}

body[data-page="video"] .video-history-list {
  max-height: min(680px, calc(100vh - 330px));
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

body[data-page="video"] .video-history-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 7px 9px 7px 12px;
  background: rgba(15, 23, 42, 0.68);
  color: #94a3b8;
}

body[data-page="video"] .video-history-pager[hidden] {
  display: none;
}

body[data-page="video"] .history-pager-info {
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

body[data-page="video"] .history-pager-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

body[data-page="video"] .history-pager-buttons .mini-button {
  min-height: 28px;
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(8, 17, 31, 0.7);
  color: #cbd5e1;
}

body[data-page="video"] .history-pager-buttons .mini-button.primary {
  border-color: rgba(34, 211, 238, 0.46);
  background: rgba(34, 211, 238, 0.16);
  color: #a5f3fc;
}

body[data-page="video"] .history-pager-buttons .mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

body[data-page="video"] .history-pager-ellipsis {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 900;
}

@media (max-width: 780px) {
  body[data-page="video"] .video-workbench-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="video"] .topbar {
    position: static;
  }

  body[data-page="video"] .video-form-panel,
  body[data-page="video"] .video-history-panel .section-head {
    position: static;
    max-height: none;
    overflow: visible;
  }

  body[data-page="video"] .video-history-panel {
    min-height: auto;
  }

  body[data-page="video"] .video-history-panel .compact-preview {
    grid-template-columns: 1fr;
  }

  body[data-page="video"] .video-history-pager {
    align-items: stretch;
    border-radius: 8px;
    flex-direction: column;
  }

  body[data-page="video"] .history-pager-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }
}

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

body[data-page="admin"][data-auth-state="checking"] .admin-workspace {
  min-height: 360px;
  display: grid;
  place-items: center;
}

body[data-page="admin"][data-auth-state="checking"] .admin-workspace::before {
  content: "正在同步后台登录状态...";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 260px;
  border: 1px solid rgba(244, 201, 106, 0.24);
  border-radius: 14px;
  padding: 18px 24px;
  color: #fff7e6;
  background: linear-gradient(135deg, rgba(25, 20, 13, 0.96), rgba(12, 10, 7, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 240, 199, 0.08);
  font-weight: 800;
}

body[data-page="admin"][data-auth-state="checking"] .admin-login-panel,
body[data-page="admin"][data-auth-state="checking"] .admin-panel {
  display: none !important;
}

body[data-page="admin"] .topbar,
body[data-page="admin"] .panel,
body[data-page="admin"] .admin-card {
  border-color: rgba(103, 232, 249, 0.18);
  background: linear-gradient(180deg, rgba(13, 27, 46, 0.94), rgba(9, 19, 34, 0.96));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-page="admin"] .topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  backdrop-filter: blur(16px);
}

body[data-page="admin"] .brand-mark {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.28);
}

body[data-page="admin"] .brand strong,
body[data-page="admin"] .section-head h1,
body[data-page="admin"] .brief-hero h2,
body[data-page="admin"] .admin-card h2,
body[data-page="admin"] .table-head h2 {
  color: #f8fbff;
}

body[data-page="admin"] .brand small,
body[data-page="admin"] .admin-card p,
body[data-page="admin"] .table-head p,
body[data-page="admin"] .brief-hero p,
body[data-page="admin"] .eyebrow {
  color: #8aa4bd;
}

body[data-page="admin"] .eyebrow {
  letter-spacing: 0;
  color: #67e8f9;
}

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

body[data-page="admin"] .topnav a.active,
body[data-page="admin"] .topnav a:hover {
  background: rgba(34, 211, 238, 0.13);
  color: #67e8f9;
}

body[data-page="admin"] .admin-workspace {
  width: min(1420px, calc(100vw - 32px));
}

body[data-page="admin"] .admin-panel {
  padding: 18px;
}

body[data-page="admin"] .admin-tabs {
  position: sticky;
  top: 88px;
  z-index: 18;
  border-color: rgba(103, 232, 249, 0.16);
  background: rgba(7, 17, 31, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

body[data-page="admin"] .admin-tab {
  color: #96abc1;
}

body[data-page="admin"] .admin-tab:hover {
  border-color: rgba(103, 232, 249, 0.28);
  background: rgba(16, 36, 58, 0.8);
  color: #dff8ff;
}

body[data-page="admin"] .admin-tab.active {
  border-color: rgba(34, 211, 238, 0.5);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(37, 99, 235, 0.24));
  color: #ffffff;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.18);
}

body[data-page="admin"] .brief-hero {
  border-color: rgba(34, 211, 238, 0.2);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.13), rgba(37, 99, 235, 0.09) 48%, rgba(52, 211, 153, 0.08)),
    rgba(13, 27, 46, 0.9);
}

body[data-page="admin"] .brief-hero span,
body[data-page="admin"] .token-pool-summary {
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(52, 211, 153, 0.12);
  color: #b8f7d8;
}

body[data-page="admin"] .token-pool-summary span,
body[data-page="admin"] .token-pool-summary small {
  color: #97eec8;
}

body[data-page="admin"] .token-pool-summary strong {
  color: #d8fff0;
}

body[data-page="admin"] .admin-summary-grid span,
body[data-page="admin"] .brief-metric,
body[data-page="admin"] .package-config-row,
body[data-page="admin"] .member-tools,
body[data-page="admin"] .transaction-tools,
body[data-page="admin"] .order-tools,
body[data-page="admin"] .card-tools,
body[data-page="admin"] .token-table-actions,
body[data-page="admin"] .compact-config,
body[data-page="admin"] .token-pool-card,
body[data-page="admin"] .token-import-card {
  border-color: rgba(103, 232, 249, 0.14);
  background: rgba(16, 36, 58, 0.72);
}

body[data-page="admin"] .admin-summary-grid strong,
body[data-page="admin"] .brief-metric strong {
  color: #f8fbff;
}

body[data-page="admin"] .admin-summary-grid span,
body[data-page="admin"] .brief-metric span,
body[data-page="admin"] .brief-metric small,
body[data-page="admin"] .token-table-actions span,
body[data-page="admin"] .card-tools span,
body[data-page="admin"] .muted-text,
body[data-page="admin"] .order-number-stack small {
  color: #93a9bd;
}

body[data-page="admin"] .brief-metric.token-remaining-alert {
  border-color: rgba(251, 113, 133, 0.46);
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.22), rgba(127, 29, 29, 0.16));
}

body[data-page="admin"] .brief-metric.token-remaining-alert span,
body[data-page="admin"] .brief-metric.token-remaining-alert small,
body[data-page="admin"] .brief-metric.token-remaining-alert strong {
  color: #fecdd3;
}

body[data-page="admin"] input,
body[data-page="admin"] textarea,
body[data-page="admin"] select,
body[data-page="admin"] .admin-card textarea,
body[data-page="admin"] .admin-output,
body[data-page="admin"] .admin-mini-input,
body[data-page="admin"] .package-config-row input,
body[data-page="admin"] .package-config-row select,
body[data-page="admin"] .member-tools input,
body[data-page="admin"] .member-tools select,
body[data-page="admin"] .transaction-tools input,
body[data-page="admin"] .transaction-tools select,
body[data-page="admin"] .order-tools input,
body[data-page="admin"] .order-tools select,
body[data-page="admin"] .card-tools select,
body[data-page="admin"] .card-tools .page-size-custom {
  border-color: rgba(103, 232, 249, 0.2);
  background: rgba(5, 13, 24, 0.76);
  color: #e6f4ff;
}

body[data-page="admin"] input::placeholder,
body[data-page="admin"] textarea::placeholder {
  color: #60758a;
}

body[data-page="admin"] input:focus,
body[data-page="admin"] textarea:focus,
body[data-page="admin"] select:focus {
  outline: 0;
  border-color: rgba(34, 211, 238, 0.72);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

body[data-page="admin"] .button.primary {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(34, 211, 238, 0.18);
}

body[data-page="admin"] .button.primary:hover {
  background: linear-gradient(135deg, #67e8f9, #3b82f6);
}

body[data-page="admin"] .button.secondary,
body[data-page="admin"] .mini-button.active {
  border-color: rgba(34, 211, 238, 0.32);
  background: rgba(34, 211, 238, 0.12);
  color: #a5f3fc;
}

body[data-page="admin"] .button.ghost,
body[data-page="admin"] .mini-button {
  border-color: rgba(103, 232, 249, 0.16);
  background: rgba(16, 36, 58, 0.72);
  color: #b7cadb;
}

body[data-page="admin"] .button.ghost:hover,
body[data-page="admin"] .mini-button:hover {
  border-color: rgba(103, 232, 249, 0.34);
  color: #f8fbff;
}

body[data-page="admin"] .mini-button.danger {
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
}

body[data-page="admin"] .mini-button.success,
body[data-page="admin"] .config-save-status.success,
body[data-page="admin"] .member-type-pill.account,
body[data-page="admin"] .order-status.success,
body[data-page="admin"] .success-text {
  border-color: rgba(52, 211, 153, 0.26);
  background: rgba(52, 211, 153, 0.13);
  color: #b8f7d8;
}

body[data-page="admin"] .member-type-pill.card,
body[data-page="admin"] .order-status.warning,
body[data-page="admin"] .config-save-status.warning {
  background: rgba(250, 204, 21, 0.14);
  color: #fde68a;
}

body[data-page="admin"] .table-wrap {
  border-color: rgba(103, 232, 249, 0.16);
  background: rgba(5, 13, 24, 0.55);
}

body[data-page="admin"] .admin-table {
  background: transparent;
  color: #dbeafe;
}

body[data-page="admin"] .admin-table th {
  border-bottom-color: rgba(103, 232, 249, 0.16);
  background: rgba(7, 17, 31, 0.94);
  color: #a5f3fc;
}

body[data-page="admin"] .admin-table td {
  border-bottom-color: rgba(103, 232, 249, 0.08);
}

body[data-page="admin"] .admin-table tbody tr:hover td {
  background: rgba(34, 211, 238, 0.055);
}

body[data-page="admin"] .admin-table code {
  color: #bfdbfe;
}

body[data-page="admin"] .success-row td {
  background: rgba(52, 211, 153, 0.075);
}

body[data-page="admin"] .muted-row td,
body[data-page="admin"] .token-row-disabled td {
  background: rgba(148, 163, 184, 0.065);
  color: #7890a7;
}

body[data-page="admin"] .danger-row td,
body[data-page="admin"] .token-row-danger td {
  background: rgba(251, 113, 133, 0.13);
}

body[data-page="admin"] .token-row-warning td {
  background: rgba(250, 204, 21, 0.12);
}

body[data-page="admin"] .token-row-success td {
  background: rgba(52, 211, 153, 0.1);
}

body[data-page="admin"] .token-state-pill,
body[data-page="admin"] .order-status.muted {
  background: rgba(15, 23, 42, 0.72);
  color: #c6d7e7;
}

body[data-page="admin"] .package-config-head {
  background: rgba(7, 17, 31, 0.88);
  color: #a5f3fc;
}

body[data-page="admin"] .pager {
  border-radius: 8px;
  padding: 8px;
  background: rgba(7, 17, 31, 0.44);
}

body[data-page="admin"] .submit-toast {
  border: 1px solid rgba(103, 232, 249, 0.22);
  background: rgba(8, 20, 36, 0.94);
  color: #e6f4ff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

@media (max-width: 780px) {
  body[data-page="admin"] .topbar,
  body[data-page="admin"] .admin-tabs {
    position: static;
  }

  body[data-page="admin"] .admin-panel {
    padding: 12px;
  }
}

* {
  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);
}

.global-recharge-panel {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 12px;
  flex: 0 0 auto;
  min-width: 310px;
  border: 1px solid rgba(45, 212, 191, 0.34);
  border-radius: 8px;
  padding: 8px 10px 9px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(56, 189, 248, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 32px rgba(6, 182, 212, 0.08);
}

.global-recharge-panel[hidden] {
  display: none;
}

.global-member-badge {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border-bottom: 1px solid rgba(125, 211, 252, 0.14);
  padding-bottom: 6px;
}

.global-member-badge span {
  color: rgba(191, 219, 254, 0.78);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.global-member-badge strong {
  overflow: hidden;
  color: #e0f2fe;
  font-size: 0.86rem;
  font-weight: 950;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-logout-button {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(15, 23, 42, 0.68);
  color: rgba(219, 234, 254, 0.86);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.35;
  white-space: nowrap;
}

.global-logout-button:hover {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
}

.global-credit-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
}

.global-credit-copy span,
.global-credit-copy small {
  color: rgba(219, 234, 254, 0.84);
  font-size: 0.76rem;
  font-weight: 850;
}

.global-credit-copy strong {
  color: #ecfeff;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 950;
}

.global-recharge-button {
  flex: 0 0 auto;
  gap: 0;
  border-color: rgba(253, 224, 71, 0.72);
  background: linear-gradient(135deg, #fff7ad 0%, #facc15 42%, #f59e0b 100%);
  color: #3b2600;
  box-shadow: 0 10px 26px rgba(250, 204, 21, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.34);
}

.global-recharge-button:hover {
  border-color: rgba(254, 240, 138, 0.92);
  background: linear-gradient(135deg, #fffbd1 0%, #fde047 38%, #f59e0b 100%);
  color: #2b1b00;
  box-shadow: 0 12px 30px rgba(250, 204, 21, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.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);
}

.module-announcement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -6px 0 16px;
  padding: 10px 12px;
  border: 1px solid rgba(74, 222, 128, 0.38);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.28) 0%, rgba(34, 197, 94, 0.18) 46%, rgba(132, 204, 22, 0.13) 100%),
    rgba(5, 18, 22, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 30px rgba(16, 185, 129, 0.12);
  color: #dcfce7;
}

.module-announcement[hidden] {
  display: none !important;
}

.module-announcement span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: linear-gradient(135deg, #bbf7d0 0%, #34d399 45%, #10b981 100%);
  color: #052e1b;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.22);
}

.module-announcement p {
  margin: 1px 0 0;
  color: #dffbea;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: pre-line;
}

.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;
}

.video-download-link {
  left: 48px;
}

.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.top-package-box {
  margin: 0 0 14px;
  border-color: rgba(45, 212, 191, 0.32);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(56, 189, 248, 0.09));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 34px rgba(6, 182, 212, 0.08);
}

.top-package-box .package-box-head strong {
  font-size: 1.02rem;
}

.top-package-box .package-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.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(4, minmax(0, 1fr));
  gap: 12px;
}

.member-package-box .package-grid {
  grid-template-columns: repeat(4, minmax(0, 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 8px;
  gap: 5px;
  text-align: center;
  min-width: 0;
}

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

.member-package-box .package-card strong {
  max-width: 100%;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

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

.package-custom-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 9px;
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.95), rgba(244, 63, 94, 0.86));
  color: #fff1f2 !important;
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 18px rgba(244, 63, 94, 0.2);
}

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

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

.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(6, 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: 12px;
}

.package-type-section {
  display: grid;
  gap: 7px;
}

.package-type-title {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 12px;
  border: 1px solid rgba(103, 232, 249, 0.18);
  background: rgba(34, 211, 238, 0.12);
  color: #a5f3fc;
  font-size: 13px;
  font-weight: 950;
}

.package-config-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.85fr) minmax(170px, 1.3fr) 88px 88px 72px 84px minmax(130px, 1fr);
  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-row input[readonly],
.package-config-row input:disabled {
  opacity: 0.76;
  cursor: not-allowed;
}

.package-unit-preview {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(16, 185, 129, 0.12);
  color: #bbf7d0;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.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 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  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;
}

.pool-log-card {
  margin-top: 14px;
}

.pool-log-tools {
  justify-content: flex-end;
}

.pool-log-table-wrap {
  max-height: 430px;
  overflow: auto;
}

.pool-log-table th,
.pool-log-table td {
  font-size: 12px;
  white-space: nowrap;
}

.pool-log-table .pool-log-detail {
  max-width: 420px;
  white-space: normal;
  line-height: 1.5;
  color: #475569;
}

.image-monitor-card {
  border-color: rgba(245, 190, 92, 0.24);
}

.image-monitor-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.image-monitor-tools span,
.image-monitor-tools small {
  border: 1px solid rgba(245, 190, 92, 0.22);
  border-radius: 999px;
  background: rgba(16, 18, 24, 0.76);
  color: #f8e3aa;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
}
.image-monitor-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 12px;
  padding: 10px;
  border: 1px solid rgba(245, 190, 92, 0.16);
  border-radius: 14px;
  background: rgba(8, 13, 22, 0.58);
}

.image-monitor-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-monitor-filter-tabs .mini-button.active {
  border-color: rgba(245, 190, 92, 0.64);
  background: linear-gradient(135deg, rgba(245, 190, 92, 0.26), rgba(20, 184, 166, 0.16));
  color: #fff4c7;
  box-shadow: 0 10px 24px rgba(245, 190, 92, 0.12);
}

.image-monitor-search {
  min-width: 260px;
  max-width: 360px;
  height: 34px;
  border-radius: 999px;
}

.image-monitor-pager {
  justify-content: flex-end;
  margin-top: 12px;
}


.image-monitor-table-wrap {
  max-height: 430px;
  overflow: auto;
}

.image-monitor-table th,
.image-monitor-table td {
  white-space: nowrap;
}

.monitor-status,
.monitor-timeout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.monitor-status.submitted {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.monitor-status.generating {
  color: #fde68a;
  background: rgba(180, 83, 9, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.monitor-status.completed,
.monitor-timeout.ok {
  color: #bbf7d0;
  background: rgba(22, 101, 52, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.32);
}

.monitor-status.failed {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.34);
  border: 1px solid rgba(248, 113, 113, 0.42);
}

.monitor-timeout.danger {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.34);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.monitor-row-timeout td {
  background: rgba(127, 29, 29, 0.22) !important;
}

.pool-log-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #eef2ff;
  color: #4338ca;
}

.pool-log-action.manual_import {
  background: #ecfeff;
  color: #0e7490;
}

.pool-log-action.auto_sync {
  background: #fef3c7;
  color: #b45309;
}

.pool-log-action.manual_delete,
.pool-log-action.auto_delete {
  background: #fee2e2;
  color: #b91c1c;
}

.video-cookie-tools {
  justify-content: space-between;
  margin: 0 0 10px;
}

.video-cookie-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.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;
}

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

.announcement-config-block {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(103, 232, 249, 0.16);
  border-radius: 10px;
  padding: 12px;
  background: rgba(5, 13, 24, 0.42);
}

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

.announcement-config-head strong {
  color: #e6f4ff;
  font-size: 14px;
}

.announcement-config-block textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid rgba(103, 232, 249, 0.16);
  background: rgba(16, 36, 58, 0.74);
  color: #a5f3fc;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.inline-toggle input {
  width: 14px;
  height: 14px;
  accent-color: #22d3ee;
}

.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-success-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 10px 8px;
  color: #087443;
}

.payment-success-icon {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #07c160;
  color: #fff;
  font-size: 32px;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(7, 193, 96, 0.28);
}

.payment-success-state strong {
  color: #087443;
  font-size: 22px;
  font-weight: 900;
}

.payment-success-state small {
  color: #475467;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.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 {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: center;
  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"] .button.primary.global-recharge-button,
body[data-page="video"] .button.primary.global-recharge-button {
  border-color: rgba(253, 224, 71, 0.72);
  background: linear-gradient(135deg, #fff7ad 0%, #facc15 42%, #f59e0b 100%);
  color: #3b2600;
  box-shadow: 0 10px 26px rgba(250, 204, 21, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.34);
}

body[data-page="image"] .button.primary.global-recharge-button:hover,
body[data-page="video"] .button.primary.global-recharge-button:hover {
  border-color: rgba(254, 240, 138, 0.92);
  background: linear-gradient(135deg, #fffbd1 0%, #fde047 38%, #f59e0b 100%);
  color: #2b1b00;
  box-shadow: 0 12px 30px rgba(250, 204, 21, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="image"] .global-recharge-panel.packages-open .button.primary.global-recharge-button {
  border-color: rgba(45, 212, 191, 0.56);
  background: linear-gradient(135deg, #14b8a6 0%, #38bdf8 100%);
  color: #06111e;
  box-shadow: 0 10px 28px rgba(20, 184, 166, 0.24);
  text-shadow: none;
}

body[data-page="video"] .global-recharge-panel.packages-open .button.primary.global-recharge-button {
  border-color: rgba(125, 211, 252, 0.58);
  background: linear-gradient(135deg, #22d3ee 0%, #2563eb 100%);
  color: #e0faff;
  box-shadow: 0 10px 28px rgba(34, 211, 238, 0.24);
  text-shadow: none;
}

body[data-page="image"] .member-credits-panel .member-recharge-button {
  display: none;
}

body[data-page="image"] .member-login.logged-in .member-summary {
  display: none;
}

body[data-page="image"] .member-credits-panel,
body[data-page="video"] .video-member-credits {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  min-height: 54px;
  margin: 0 0 10px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 8px;
  padding: 9px 11px;
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.62), rgba(6, 78, 59, 0.4));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body[data-page="video"] .video-member-credits {
  min-height: 54px;
  padding-block: 7px;
}

body[data-page="video"] .video-member-credits > div:nth-child(2)::after,
body[data-page="video"] .video-member-credits span::before {
  padding-block: 2px;
}

body[data-page="image"] .member-credits-panel span,
body[data-page="video"] .video-member-credits span {
  grid-column: 1;
  width: fit-content;
  border: 1px solid rgba(253, 224, 71, 0.42);
  border-radius: 999px;
  padding: 3px 8px;
  background: linear-gradient(135deg, rgba(255, 247, 173, 0.96), rgba(250, 204, 21, 0.86));
  color: #3b2600;
  font-size: 0;
  font-weight: 950;
  line-height: 1.2;
}

body[data-page="image"] .member-credits-panel span::before {
  content: "AI生图次数";
  font-size: 0.76rem;
}

body[data-page="video"] .video-member-credits span::before {
  content: "AI生视频条数";
  font-size: 0.76rem;
}

body[data-page="image"] .member-credit-count,
body[data-page="video"] .video-member-credits strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}

body[data-page="image"] .member-credit-count em,
body[data-page="video"] .video-member-credits strong::before,
body[data-page="video"] .video-member-credits strong::after {
  color: rgba(236, 253, 245, 0.86);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
}

body[data-page="video"] .video-member-credits strong::before {
  content: "当前可生成";
}

body[data-page="video"] .video-member-credits strong::after {
  content: "/条 AI视频";
}

body[data-page="image"] .member-credits-panel strong,
body[data-page="video"] .video-member-credits b {
  color: #ffffff;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 0.9;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="image"] .member-credits-panel small,
body[data-page="video"] .video-member-credits > div:nth-child(2)::after {
  grid-column: 1;
  width: fit-content;
  border: 1px solid rgba(253, 224, 71, 0.34);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(250, 204, 21, 0.12);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
}

body[data-page="video"] .video-member-credits > div:first-child,
body[data-page="video"] #refreshVideoMember {
  display: none;
}

body[data-page="video"] .video-member-credits > div:nth-child(2) {
  display: contents;
}

body[data-page="video"] .video-member-credits > div:nth-child(2)::after {
  content: "AI视频次数·不限使用时间";
}

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"] .global-recharge-button,
body[data-page="video"] .global-recharge-button {
  border-color: rgba(253, 224, 71, 0.72);
  background: linear-gradient(135deg, #fff7ad 0%, #facc15 42%, #f59e0b 100%);
  color: #3b2600;
  box-shadow: 0 10px 26px rgba(250, 204, 21, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.58);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.34);
}

body[data-page="image"] .global-recharge-button:hover,
body[data-page="video"] .global-recharge-button:hover {
  border-color: rgba(254, 240, 138, 0.92);
  background: linear-gradient(135deg, #fffbd1 0%, #fde047 38%, #f59e0b 100%);
  color: #2b1b00;
  box-shadow: 0 12px 30px rgba(250, 204, 21, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body[data-page="image"] .global-recharge-panel.packages-open .button.primary.global-recharge-button {
  border-color: rgba(45, 212, 191, 0.56);
  background: linear-gradient(135deg, #14b8a6 0%, #38bdf8 100%);
  color: #06111e;
  box-shadow: 0 10px 28px rgba(20, 184, 166, 0.24);
  text-shadow: none;
}

body[data-page="video"] .global-recharge-panel.packages-open .button.primary.global-recharge-button {
  border-color: rgba(125, 211, 252, 0.58);
  background: linear-gradient(135deg, #22d3ee 0%, #2563eb 100%);
  color: #e0faff;
  box-shadow: 0 10px 28px rgba(34, 211, 238, 0.24);
  text-shadow: none;
}

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,
body[data-page="video"] 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,
body[data-page="video"] 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="video"] .video-package-box .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.image-package-card,
body[data-page="video"] .video-package-box .package-card.image-package-card {
  border-color: rgba(56, 189, 248, 0.28);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(37, 99, 235, 0.12)),
    rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(186, 230, 253, 0.08);
}

body[data-page="image"] .package-card.video-package-card,
body[data-page="video"] .video-package-box .package-card.video-package-card {
  border-color: rgba(251, 191, 36, 0.38);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(249, 115, 22, 0.12)),
    rgba(15, 23, 42, 0.72);
  box-shadow: inset 0 1px 0 rgba(254, 240, 138, 0.1);
}

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

body[data-page="image"] .package-card strong,
body[data-page="image"] .package-card b,
body[data-page="video"] .video-package-box .package-card strong,
body[data-page="video"] .video-package-box .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="video"] .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-page="video"] .topnav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  body[data-page="video"] .global-recharge-panel {
    min-width: 230px;
  }

  body[data-page="image"] .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-page="image"] .topnav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  body[data-page="image"] .global-recharge-panel {
    min-width: 230px;
  }

  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) {
  body[data-page="video"] .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

  body[data-page="video"] .topnav,
  body[data-page="video"] .global-recharge-panel {
    grid-column: 1;
  }

  body[data-page="video"] .global-recharge-panel {
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }

  .global-recharge-panel {
    grid-template-columns: 1fr;
  }

  .global-credit-copy,
  .global-recharge-button {
    width: 100%;
  }

  .top-package-box .package-grid {
    grid-template-columns: 1fr;
  }

  body[data-page="image"] .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

  body[data-page="image"] .topnav,
  body[data-page="image"] .global-recharge-panel {
    grid-column: 1;
  }

  body[data-page="image"] .global-recharge-panel {
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }

  .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;
  }
}

body[data-page="image"] .member-credits-panel,
body[data-page="video"] .video-member-credits {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0 0 8px;
  border: 1px solid rgba(250, 204, 21, 0.28);
  border-radius: 8px;
  padding: 6px 10px;
  background:
    radial-gradient(circle at 16% 10%, rgba(250, 204, 21, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(8, 47, 73, 0.78), rgba(6, 78, 59, 0.48));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 28px rgba(0, 0, 0, 0.16);
}

body[data-page="image"] .member-credits-panel span,
body[data-page="video"] .video-member-credits span {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  width: fit-content;
  border: 1px solid rgba(253, 224, 71, 0.42);
  border-radius: 999px;
  padding: 3px 9px;
  background: linear-gradient(135deg, #fff3a3 0%, #facc15 100%);
  color: #3b2600;
  font-size: 0;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

body[data-page="image"] .member-credits-panel span::before {
  content: "AI生图次数";
  font-size: 0.76rem;
}

body[data-page="video"] .video-member-credits span::before {
  content: "AI生视频条数";
  font-size: 0.76rem;
}

body[data-page="image"] .member-credit-count,
body[data-page="video"] .video-member-credits strong {
  grid-column: 2;
  grid-row: auto;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  color: rgba(236, 253, 245, 0.86);
  font-size: 0;
  font-weight: 850;
  white-space: nowrap;
}

body[data-page="image"] .member-credit-count em,
body[data-page="video"] .video-member-credits strong::before,
body[data-page="video"] .video-member-credits strong::after {
  color: rgba(236, 253, 245, 0.82);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
}

body[data-page="video"] .video-member-credits strong::before {
  content: "当前可生成";
}

body[data-page="video"] .video-member-credits strong::after {
  content: "/条 AI视频";
}

body[data-page="image"] .member-credits-panel strong,
body[data-page="video"] .video-member-credits b {
  color: #ffffff;
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 0.9;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="image"] .member-credits-panel small,
body[data-page="video"] .video-member-credits > div:nth-child(2)::after {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  width: fit-content;
  border: 1px solid rgba(253, 224, 71, 0.26);
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(250, 204, 21, 0.1);
  color: #fde68a;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

body[data-page="image"] .member-credits-panel small {
  font-size: 0;
}

body[data-page="image"] .member-credits-panel small::before {
  content: "AI主图次数·不限使用时间";
  font-size: 0.72rem;
}

body[data-page="video"] .video-member-credits > div:first-child,
body[data-page="video"] #refreshVideoMember {
  display: none;
}

body[data-page="video"] .video-member-credits > div:nth-child(2) {
  display: contents;
}

body[data-page="video"] .video-member-credits > div:nth-child(2)::after {
  content: "AI视频次数·不限使用时间";
}

@media (max-width: 760px) {
  body[data-page="image"] .member-credits-panel,
  body[data-page="video"] .video-member-credits {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body[data-page="image"] .member-credits-panel small,
  body[data-page="video"] .video-member-credits > div:nth-child(2)::after {
    grid-column: 1 / -1;
  }
}

body[data-page="image"] .member-login.logged-in {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="image"] .member-login.logged-in .member-credits-panel {
  margin: 0 0 8px;
}

body[data-page="image"] .member-credits-panel,
body[data-page="video"] .video-member-credits {
  grid-template-columns: auto auto minmax(0, 1fr);
}

body[data-page="image"] .member-credits-panel span,
body[data-page="video"] .video-member-credits span,
body[data-page="image"] .member-credits-panel small,
body[data-page="video"] .video-member-credits > div:nth-child(2)::after {
  min-height: 24px;
  border: 1px solid rgba(253, 224, 71, 0.26);
  background: rgba(250, 204, 21, 0.1);
  color: #fde68a;
}

body[data-page="image"] .member-credits-panel span,
body[data-page="video"] .video-member-credits span {
  justify-self: start;
}

body[data-page="image"] .member-credit-count,
body[data-page="video"] .video-member-credits strong {
  grid-column: 2;
  justify-content: flex-start;
  justify-self: start;
  padding-right: 10px;
}

body[data-page="image"] .member-credits-panel small,
body[data-page="video"] .video-member-credits > div:nth-child(2)::after {
  grid-column: 3;
  justify-self: end;
}

@media (max-width: 760px) {
  body[data-page="image"] .member-credits-panel,
  body[data-page="video"] .video-member-credits {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body[data-page="image"] .member-credit-count,
  body[data-page="video"] .video-member-credits strong {
    grid-column: 2;
    justify-content: flex-start;
  }

  body[data-page="image"] .member-credits-panel small,
  body[data-page="video"] .video-member-credits > div:nth-child(2)::after {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

body[data-page="image"] .member-package-box .package-card .button.primary,
body[data-page="image"] .member-package-box .package-card button[data-package-id],
body[data-page="video"] .video-package-box .package-card .button.primary,
body[data-page="video"] .video-package-box .package-card button[data-package-id] {
  border-color: rgba(253, 224, 71, 0.72);
  background: linear-gradient(135deg, #fff3a3 0%, #facc15 46%, #f59e0b 100%);
  color: #3b2600;
  box-shadow: 0 10px 26px rgba(250, 204, 21, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: none;
}

body[data-page="image"] .member-package-box .package-card .button.primary:hover,
body[data-page="image"] .member-package-box .package-card button[data-package-id]:hover,
body[data-page="video"] .video-package-box .package-card .button.primary:hover,
body[data-page="video"] .video-package-box .package-card button[data-package-id]:hover {
  border-color: rgba(254, 240, 138, 0.9);
  background: linear-gradient(135deg, #fff7c2 0%, #fde047 45%, #f59e0b 100%);
  color: #2f1d00;
  box-shadow: 0 12px 30px rgba(250, 204, 21, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

body[data-page="video"] .video-form-panel .section-head {
  border-color: rgba(56, 189, 248, 0.2);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.62), rgba(8, 47, 73, 0.22));
}

body[data-page="video"] .video-form-panel .section-head h1 {
  color: #7dd3fc;
  font-size: clamp(21px, 2.4vw, 25px);
  line-height: 1.15;
  letter-spacing: 0;
}

body[data-page="video"] .video-form-panel .section-head .eyebrow {
  color: #67e8f9;
}

body[data-page="video"] .video-form-panel {
  position: static;
  max-height: none;
  overflow: visible;
  scrollbar-gutter: auto;
}

/* AICopy video generation controls */
body[data-page="video"] .video-task-summary:not([hidden]) {
  display: inline-flex;
  max-width: min(320px, 44%);
  white-space: normal;
  line-height: 1.45;
}

body[data-page="video"] .video-option-field {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

body[data-page="video"] .video-option-field legend {
  margin-bottom: 8px;
  color: #8aa4bd;
  font-size: 0.84rem;
  font-weight: 800;
}

body[data-page="video"] .video-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-height: 44px;
  border: 1px solid rgba(103, 232, 249, 0.2);
  border-radius: 8px;
  padding: 4px;
  background: rgba(5, 13, 24, 0.76);
}

body[data-page="video"] .video-segmented label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

body[data-page="video"] .video-segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body[data-page="video"] .video-segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 8px;
  color: #8fa8bf;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

body[data-page="video"] .video-segmented input:checked + span {
  border-color: rgba(103, 232, 249, 0.42);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.42), rgba(37, 99, 235, 0.34));
  color: #ecfeff;
  box-shadow: 0 5px 16px rgba(8, 145, 178, 0.18);
}

body[data-page="video"] .video-segmented input:focus-visible + span {
  outline: 2px solid #67e8f9;
  outline-offset: 2px;
}

body[data-page="video"] .production-direction-field {
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 8px;
  padding: 13px;
  background: rgba(6, 18, 32, 0.64);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

body[data-page="video"] .production-direction-field legend {
  padding: 0 6px;
  color: #dff8ff;
  font-size: 0.86rem;
  font-weight: 850;
}

body[data-page="video"] .production-direction-field legend span {
  margin-left: 6px;
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 800;
}

body[data-page="video"] .production-direction-field.needs-selection {
  border-color: rgba(251, 191, 36, 0.66);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.08);
}

body[data-page="video"] .production-direction-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

body[data-page="video"] .production-direction-grid label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

body[data-page="video"] .production-direction-grid input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body[data-page="video"] .production-direction-grid label > span {
  display: grid;
  align-content: center;
  min-height: 62px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 7px;
  padding: 8px 9px;
  background: rgba(4, 12, 23, 0.72);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

body[data-page="video"] .production-direction-grid strong {
  overflow-wrap: anywhere;
  color: #dcecf7;
  font-size: 0.76rem;
  line-height: 1.3;
}

body[data-page="video"] .production-direction-grid small {
  margin-top: 2px;
  overflow-wrap: anywhere;
  color: #7590a8;
  font-size: 0.66rem;
  line-height: 1.3;
}

body[data-page="video"] .production-direction-grid label:hover > span {
  border-color: rgba(103, 232, 249, 0.36);
  background: rgba(8, 47, 73, 0.55);
}

body[data-page="video"] .production-direction-grid input:checked + span {
  border-color: rgba(103, 232, 249, 0.68);
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.42), rgba(30, 64, 175, 0.26));
  box-shadow: inset 3px 0 0 #22d3ee, 0 7px 18px rgba(8, 145, 178, 0.15);
}

body[data-page="video"] .production-direction-grid input:checked + span strong,
body[data-page="video"] .production-direction-grid input:checked + span small {
  color: #ecfeff;
}

body[data-page="video"] .production-direction-grid input:focus-visible + span {
  outline: 2px solid #67e8f9;
  outline-offset: 2px;
}

body[data-page="video"] .production-direction-hint {
  display: block;
  margin-top: 9px;
  color: #8aa4bd;
  font-size: 0.74rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

body[data-page="video"] .video-spec-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 8px;
  background: rgba(103, 232, 249, 0.16);
}

body[data-page="video"] .video-spec-strip > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  background: rgba(6, 18, 32, 0.94);
  color: #8ea6bb;
  font-size: 0.74rem;
  text-align: center;
}

body[data-page="video"] .video-spec-strip strong {
  color: #e9fbff;
  font-size: 0.84rem;
}

body[data-page="video"] .video-copy-field {
  border: 1px solid rgba(52, 211, 153, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 120, 87, 0.08);
}

body[data-page="video"] .video-copy-field .field-heading,
body[data-page="video"] .video-copy-field .field-assist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body[data-page="video"] .video-copy-field .field-heading label {
  color: #a7f3d0;
  font-size: 0.86rem;
  font-weight: 850;
}

body[data-page="video"] .video-ai-write-button {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(110, 231, 183, 0.54);
  border-radius: 7px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #047857, #065f46);
  color: #ecfdf5;
  box-shadow: 0 8px 20px rgba(4, 120, 87, 0.25);
  cursor: pointer;
  font-weight: 900;
}

body[data-page="video"] .video-ai-write-button:hover {
  border-color: #a7f3d0;
  background: linear-gradient(135deg, #059669, #047857);
}

body[data-page="video"] .video-ai-write-button:disabled {
  opacity: 0.64;
  cursor: wait;
}

body[data-page="video"] .video-copy-field .field-assist-row {
  align-items: flex-start;
  margin-top: 6px;
}

body[data-page="video"] .video-copy-field .field-assist-row > small:first-child {
  max-width: 72%;
}

body[data-page="video"] .video-copy-field .ai-write-status {
  color: #6ee7b7;
  font-weight: 800;
  text-align: right;
}

body[data-page="video"] input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 6px;
  padding: 7px 11px;
  background: rgba(14, 116, 144, 0.24);
  color: #cffafe;
  cursor: pointer;
  font-weight: 800;
}

body[data-page="admin"] .aicopy-video-config-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="admin"] .aicopy-model-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  background: #fff;
}

body[data-page="admin"] .aicopy-model-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.6fr) minmax(130px, 0.6fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  border-bottom: 1px solid #e8e8ed;
  padding: 10px 12px;
}

body[data-page="admin"] .aicopy-model-row:last-child {
  border-bottom: 0;
}

body[data-page="admin"] .aicopy-model-head {
  background: #f5f5f7;
  color: #6e6e73;
  font-size: 0.75rem;
  font-weight: 700;
}

body[data-page="admin"] .aicopy-model-row strong {
  color: #1d1d1f;
  font-size: 0.84rem;
}

body[data-page="admin"] .aicopy-model-row small {
  color: #6e6e73;
}

body[data-page="admin"] .aicopy-model-row input {
  width: 100%;
  min-width: 0;
}

body[data-page="admin"] .aicopy-direction-prompts {
  margin: 18px 0 14px;
  border-top: 1px solid #e8e8ed;
  padding-top: 18px;
}

body[data-page="admin"] .aicopy-direction-prompts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

body[data-page="admin"] .aicopy-direction-prompts-head > div {
  display: grid;
  gap: 4px;
}

body[data-page="admin"] .aicopy-direction-prompts-head strong {
  color: #1d1d1f;
  font-size: 0.95rem;
}

body[data-page="admin"] .aicopy-direction-prompts-head small {
  color: #6e6e73;
}

body[data-page="admin"] .aicopy-direction-prompts-head > span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef5ff;
  color: #0066cc;
  font-size: 0.72rem;
  font-weight: 750;
}

body[data-page="admin"] .aicopy-direction-prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="admin"] .aicopy-direction-prompt-grid .field:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

body[data-page="admin"] .aicopy-direction-prompt-grid textarea {
  min-height: 126px;
  resize: vertical;
}

@media (max-width: 760px) {
  body[data-page="video"] .video-task-summary:not([hidden]) {
    max-width: 100%;
  }

  body[data-page="video"] .video-spec-strip {
    grid-template-columns: 1fr;
  }

  body[data-page="video"] .video-copy-field .field-heading,
  body[data-page="video"] .video-copy-field .field-assist-row {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-page="video"] .video-copy-field .field-assist-row > small:first-child {
    max-width: none;
  }

  body[data-page="video"] .video-copy-field .ai-write-status {
    text-align: left;
  }

  body[data-page="admin"] .aicopy-video-config-grid,
  body[data-page="admin"] .aicopy-direction-prompt-grid,
  body[data-page="admin"] .aicopy-model-row {
    grid-template-columns: 1fr;
  }

  body[data-page="admin"] .aicopy-direction-prompt-grid .field:last-child:nth-child(odd) {
    grid-column: auto;
  }

  body[data-page="video"] .production-direction-field legend span {
    display: block;
    margin: 3px 0 0;
    white-space: normal;
  }

  body[data-page="admin"] .aicopy-model-head {
    display: none;
  }
}

@media (max-width: 1200px) {
  body[data-page="video"] .production-direction-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  body[data-page="video"] .production-direction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  body[data-page="video"] .production-direction-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1020px) {
  .package-grid,
  .member-package-box .package-grid,
  .top-package-box .package-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-ai-stage {
    inset: 72px -80px 26px 8%;
    transform-origin: 64% 50%;
  }

  .home-ai-card {
    opacity: 0.68;
  }

  .home-signal-row {
    grid-template-columns: 1fr;
    margin-top: -18px;
  }
}

@media (max-width: 760px) {
  .home-topbar {
    position: relative;
    top: 0;
    grid-template-columns: 1fr;
    align-items: stretch;
    margin-top: 12px;
  }

  .home-nav {
    justify-content: stretch;
  }

  .home-nav a {
    flex: 1;
    justify-content: center;
  }

  .home-hero {
    min-height: 100vh;
    padding: 72px 18px 64px;
  }

  .home-ai-stage {
    inset: 98px -220px 18px 12%;
    opacity: 0.58;
    transform-origin: 70% 52%;
  }

  .home-ai-core {
    left: 66%;
    top: 50%;
  }

  .home-ai-orbit {
    left: 66%;
    top: 50%;
  }

  .home-ai-card {
    width: clamp(76px, 24vw, 112px);
    opacity: 0.58;
  }

  .card-a,
  .card-d,
  .card-f {
    display: none;
  }

  .home-kicker {
    font-size: 0.72rem;
  }

  .home-subtitle {
    font-size: 15px;
  }

  .home-primary-button,
  .home-secondary-link {
    width: 100%;
  }

  .home-signal-row {
    width: calc(100vw - 28px);
    margin-bottom: 28px;
  }

  .module-announcement {
    align-items: flex-start;
    margin-top: -2px;
  }

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

@media (prefers-reduced-motion: reduce) {
  .home-hero::before,
  .home-hero::after,
  .home-ai-stage,
  .home-ai-core,
  .home-ai-orbit,
  .home-ai-beam,
  .home-ai-card,
  .home-ai-particle {
    animation: none;
  }
}

.reference-limit-notice {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(250, 204, 21, 0.38);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(245, 158, 11, 0.12));
  color: #f8d75f;
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 30px rgba(245, 158, 11, 0.08);
}

.reference-limit-notice[hidden] {
  display: none;
}

.reference-limit-notice.notice-pop {
  animation: referenceNoticePop 220ms ease-out;
}

@keyframes referenceNoticePop {
  from { transform: translateY(-4px); opacity: 0.72; }
  to { transform: translateY(0); opacity: 1; }
}

/* Admin black gold member commercial theme START */
body[data-page="admin"] {
  --bg: #070604;
  --panel: rgba(18, 15, 10, 0.94);
  --panel-soft: rgba(31, 25, 15, 0.92);
  --line: rgba(236, 201, 120, 0.22);
  --text: #fff7e6;
  --muted: #b8a47f;
  --brand: #f4c96a;
  --brand-dark: #b98221;
  --accent: #f4c96a;
  --accent-soft: rgba(244, 201, 106, 0.14);
  --success: #d6b15a;
  --success-soft: rgba(214, 177, 90, 0.16);
  --warning: #f6c15f;
  --warning-soft: rgba(246, 193, 95, 0.16);
  --danger: #ff7a6f;
  --danger-soft: rgba(255, 122, 111, 0.15);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.52);
  background:
    radial-gradient(circle at 18% 8%, rgba(244, 201, 106, 0.18), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(185, 130, 33, 0.16), transparent 30%),
    linear-gradient(180deg, #050403 0%, #0d0a06 44%, #050403 100%);
}

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

body[data-page="admin"] .topbar,
body[data-page="admin"] .panel,
body[data-page="admin"] .admin-card,
body[data-page="admin"] .admin-login-panel {
  border-color: rgba(236, 201, 120, 0.2);
  background:
    linear-gradient(180deg, rgba(25, 20, 13, 0.96), rgba(12, 10, 7, 0.98)),
    radial-gradient(circle at 12% 0%, rgba(244, 201, 106, 0.08), transparent 30%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 240, 199, 0.08);
}

body[data-page="admin"] .topbar {
  border-color: rgba(244, 201, 106, 0.28);
  background: linear-gradient(135deg, rgba(18, 14, 8, 0.96), rgba(35, 26, 13, 0.92));
}

body[data-page="admin"] .brand-mark {
  background: linear-gradient(135deg, #fff2b8 0%, #f4c96a 42%, #b98221 100%);
  color: #251600;
  box-shadow: 0 0 30px rgba(244, 201, 106, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

body[data-page="admin"] .brand strong,
body[data-page="admin"] .section-head h1,
body[data-page="admin"] .brief-hero h2,
body[data-page="admin"] .admin-card h2,
body[data-page="admin"] .table-head h2,
body[data-page="admin"] .compact-card-head h2 {
  color: #fff7e6;
}

body[data-page="admin"] .brand small,
body[data-page="admin"] .admin-card p,
body[data-page="admin"] .table-head p,
body[data-page="admin"] .brief-hero p,
body[data-page="admin"] .muted-text,
body[data-page="admin"] .order-number-stack small {
  color: #b8a47f;
}

body[data-page="admin"] .eyebrow {
  color: #f4c96a;
  font-weight: 950;
  letter-spacing: 0;
}

body[data-page="admin"] .topnav a {
  color: #c8b487;
}

body[data-page="admin"] .topnav a.active,
body[data-page="admin"] .topnav a:hover {
  background: rgba(244, 201, 106, 0.14);
  color: #ffe7a1;
}

body[data-page="admin"] .admin-tabs {
  border-color: rgba(236, 201, 120, 0.22);
  background: rgba(9, 8, 6, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 240, 199, 0.06), 0 16px 38px rgba(0, 0, 0, 0.34);
}

body[data-page="admin"] .admin-tab {
  color: #b8a47f;
}

body[data-page="admin"] .admin-tab:hover {
  border-color: rgba(244, 201, 106, 0.28);
  background: rgba(49, 38, 19, 0.76);
  color: #ffe7a1;
}

body[data-page="admin"] .admin-tab.active {
  border-color: rgba(244, 201, 106, 0.62);
  background: linear-gradient(135deg, rgba(255, 242, 184, 0.22), rgba(244, 201, 106, 0.24) 46%, rgba(185, 130, 33, 0.2));
  color: #fff7d6;
  box-shadow: 0 0 26px rgba(244, 201, 106, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

body[data-page="admin"] .brief-hero {
  border-color: rgba(244, 201, 106, 0.25);
  background:
    linear-gradient(135deg, rgba(244, 201, 106, 0.18), rgba(30, 23, 13, 0.92) 42%, rgba(185, 130, 33, 0.12)),
    rgba(18, 15, 10, 0.94);
}

body[data-page="admin"] .brief-hero span,
body[data-page="admin"] .token-pool-summary {
  border-color: rgba(244, 201, 106, 0.36);
  background: linear-gradient(135deg, rgba(244, 201, 106, 0.2), rgba(185, 130, 33, 0.13));
  color: #ffe7a1;
}

body[data-page="admin"] .token-pool-summary span,
body[data-page="admin"] .token-pool-summary small {
  color: #d7bd78;
}

body[data-page="admin"] .token-pool-summary strong {
  color: #fff2b8;
  text-shadow: 0 0 18px rgba(244, 201, 106, 0.18);
}

body[data-page="admin"] .admin-summary-grid span,
body[data-page="admin"] .brief-metric,
body[data-page="admin"] .package-config-row,
body[data-page="admin"] .member-tools,
body[data-page="admin"] .transaction-tools,
body[data-page="admin"] .order-tools,
body[data-page="admin"] .card-tools,
body[data-page="admin"] .token-table-actions,
body[data-page="admin"] .compact-config,
body[data-page="admin"] .token-pool-card,
body[data-page="admin"] .token-import-card,
body[data-page="admin"] .pool-log-card {
  border-color: rgba(236, 201, 120, 0.16);
  background: rgba(31, 25, 15, 0.72);
}

body[data-page="admin"] .admin-summary-grid strong,
body[data-page="admin"] .brief-metric strong {
  color: #fff7e6;
}

body[data-page="admin"] .admin-summary-grid span,
body[data-page="admin"] .brief-metric span,
body[data-page="admin"] .brief-metric small,
body[data-page="admin"] .token-table-actions span,
body[data-page="admin"] .card-tools span {
  color: #b8a47f;
}

body[data-page="admin"] .brief-metric.token-remaining-alert {
  border-color: rgba(255, 122, 111, 0.48);
  background: linear-gradient(135deg, rgba(255, 122, 111, 0.22), rgba(76, 27, 20, 0.18));
}

body[data-page="admin"] input,
body[data-page="admin"] textarea,
body[data-page="admin"] select,
body[data-page="admin"] .admin-card textarea,
body[data-page="admin"] .admin-output,
body[data-page="admin"] .admin-mini-input,
body[data-page="admin"] .package-config-row input,
body[data-page="admin"] .package-config-row select,
body[data-page="admin"] .member-tools input,
body[data-page="admin"] .member-tools select,
body[data-page="admin"] .transaction-tools input,
body[data-page="admin"] .transaction-tools select,
body[data-page="admin"] .order-tools input,
body[data-page="admin"] .order-tools select,
body[data-page="admin"] .card-tools select,
body[data-page="admin"] .card-tools .page-size-custom {
  border-color: rgba(236, 201, 120, 0.2);
  background: rgba(8, 7, 5, 0.82);
  color: #fff7e6;
}

body[data-page="admin"] input::placeholder,
body[data-page="admin"] textarea::placeholder {
  color: #7c6b4d;
}

body[data-page="admin"] input:focus,
body[data-page="admin"] textarea:focus,
body[data-page="admin"] select:focus {
  outline: 0;
  border-color: rgba(244, 201, 106, 0.78);
  box-shadow: 0 0 0 3px rgba(244, 201, 106, 0.14);
}

body[data-page="admin"] .button.primary {
  border-color: rgba(255, 242, 184, 0.54);
  background: linear-gradient(135deg, #fff2b8 0%, #f4c96a 42%, #b98221 100%);
  color: #281800;
  box-shadow: 0 14px 34px rgba(244, 201, 106, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.54);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.32);
}

body[data-page="admin"] .button.primary:hover {
  background: linear-gradient(135deg, #fff8cf 0%, #ffd86d 40%, #c9902d 100%);
  color: #1d1100;
}

body[data-page="admin"] .button.secondary,
body[data-page="admin"] .mini-button.active {
  border-color: rgba(244, 201, 106, 0.34);
  background: rgba(244, 201, 106, 0.13);
  color: #ffe7a1;
}

body[data-page="admin"] .button.ghost,
body[data-page="admin"] .mini-button {
  border-color: rgba(236, 201, 120, 0.18);
  background: rgba(31, 25, 15, 0.72);
  color: #d6c392;
}

body[data-page="admin"] .button.ghost:hover,
body[data-page="admin"] .mini-button:hover {
  border-color: rgba(244, 201, 106, 0.38);
  color: #fff7e6;
}

body[data-page="admin"] .mini-button.danger {
  border-color: rgba(255, 122, 111, 0.32);
  background: rgba(255, 122, 111, 0.12);
  color: #ffc2bb;
}

body[data-page="admin"] .mini-button.success,
body[data-page="admin"] .config-save-status.success,
body[data-page="admin"] .member-type-pill.account,
body[data-page="admin"] .order-status.success,
body[data-page="admin"] .success-text {
  border-color: rgba(244, 201, 106, 0.28);
  background: rgba(244, 201, 106, 0.14);
  color: #fff0b8;
}

body[data-page="admin"] .member-type-pill.card,
body[data-page="admin"] .order-status.warning,
body[data-page="admin"] .config-save-status.warning {
  background: rgba(246, 193, 95, 0.16);
  color: #ffe1a1;
}

body[data-page="admin"] .table-wrap {
  border-color: rgba(236, 201, 120, 0.16);
  background: rgba(8, 7, 5, 0.58);
}

body[data-page="admin"] .admin-table {
  background: transparent;
  color: #f5e8c8;
}

body[data-page="admin"] .admin-table th {
  border-bottom-color: rgba(236, 201, 120, 0.18);
  background: rgba(10, 8, 5, 0.96);
  color: #f4c96a;
}

body[data-page="admin"] .admin-table td {
  border-bottom-color: rgba(236, 201, 120, 0.09);
}

body[data-page="admin"] .admin-table tbody tr:hover td {
  background: rgba(244, 201, 106, 0.06);
}

body[data-page="admin"] .admin-table code {
  color: #ffe7a1;
}

body[data-page="admin"] .success-row td,
body[data-page="admin"] .token-row-success td {
  background: rgba(244, 201, 106, 0.1);
}

body[data-page="admin"] .token-row-warning td {
  background: rgba(246, 193, 95, 0.13);
}

body[data-page="admin"] .danger-row td,
body[data-page="admin"] .token-row-danger td {
  background: rgba(255, 122, 111, 0.14);
}

body[data-page="admin"] .muted-row td,
body[data-page="admin"] .token-row-disabled td {
  background: rgba(124, 107, 77, 0.1);
  color: #8d7c5e;
}

body[data-page="admin"] .token-state-pill,
body[data-page="admin"] .order-status.muted {
  background: rgba(31, 25, 15, 0.78);
  color: #d6c392;
}

body[data-page="admin"] .package-config-head {
  background: rgba(10, 8, 5, 0.9);
  color: #f4c96a;
}

body[data-page="admin"] .pager {
  background: rgba(10, 8, 5, 0.54);
}

body[data-page="admin"] .submit-toast {
  border-color: rgba(236, 201, 120, 0.26);
  background: rgba(18, 14, 8, 0.96);
  color: #fff7e6;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.44);
}
/* Admin black gold member commercial theme END */

/* Admin vertical layout update START */
body[data-page="admin"] .admin-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-areas:
    "head head"
    "tabs content";
  align-items: start;
  gap: 16px;
}

body[data-page="admin"] .admin-panel > .section-head {
  grid-area: head;
  margin-bottom: 0;
}

body[data-page="admin"] .admin-tabs {
  grid-area: tabs;
  position: sticky;
  top: 96px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(236, 201, 120, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(24, 19, 11, 0.96), rgba(9, 8, 6, 0.94)),
    radial-gradient(circle at 20% 0%, rgba(244, 201, 106, 0.1), transparent 36%);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 240, 199, 0.08);
}

body[data-page="admin"] .admin-tabs::before {
  content: "后台模块";
  display: block;
  margin: 0 4px 2px;
  color: #f4c96a;
  font-size: 12px;
  font-weight: 950;
}

body[data-page="admin"] .admin-tab {
  position: relative;
  justify-content: flex-start;
  width: 100%;
  min-height: 46px;
  padding: 0 38px 0 16px;
  text-align: left;
  border-radius: 10px;
}

body[data-page="admin"] .admin-tab::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: rgba(184, 164, 127, 0.6);
  box-shadow: 0 0 0 4px rgba(244, 201, 106, 0.05);
}

body[data-page="admin"] .admin-tab.active::before,
body[data-page="admin"] .admin-tab:hover::before {
  background: #f4c96a;
  box-shadow: 0 0 18px rgba(244, 201, 106, 0.42);
}

body[data-page="admin"] .admin-tab.active::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid #ffe7a1;
  border-right: 2px solid #ffe7a1;
  transform: translateY(-50%) rotate(45deg);
  opacity: 0.9;
}

body[data-page="admin"] .admin-view {
  grid-area: content;
  min-width: 0;
}

body[data-page="admin"] .admin-view[hidden] {
  display: none;
}

/* Admin overflow guard START */
body[data-page="admin"] .admin-panel,
body[data-page="admin"] .admin-view,
body[data-page="admin"] .admin-card,
body[data-page="admin"] .table-wrap {
  min-width: 0;
  max-width: 100%;
}

body[data-page="admin"] .admin-view {
  width: 100%;
  overflow: hidden;
}

body[data-page="admin"] .table-wrap {
  overflow-x: auto;
}

body[data-page="admin"] .image-monitor-card {
  overflow: hidden;
}

body[data-page="admin"] .image-monitor-table-wrap {
  max-height: 430px;
  overflow: auto;
}

body[data-page="admin"] .image-monitor-table {
  min-width: 1380px;
}

body[data-page="admin"] .image-monitor-table th,
body[data-page="admin"] .image-monitor-table td {
  white-space: nowrap;
}

body[data-page="admin"] .image-monitor-table .pool-log-detail {
  max-width: 300px;
  white-space: normal;
  word-break: break-word;
}
/* Admin overflow guard END */

@media (max-width: 980px) {
  body[data-page="admin"] .admin-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "tabs"
      "content";
  }

  body[data-page="admin"] .admin-tabs {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="admin"] .admin-tabs::before {
    grid-column: 1 / -1;
  }

  body[data-page="admin"] .admin-tab {
    min-height: 40px;
    padding-right: 14px;
  }

  body[data-page="admin"] .admin-tab.active::after {
    display: none;
  }
}
/* Admin vertical layout update END */

/* Home promotion conversion update START */
.home-trial-strip {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(250, 204, 21, 0.32);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(20, 184, 166, 0.12));
  color: #fef3c7;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
}

.home-trial-strip strong {
  font-size: 14px;
  white-space: nowrap;
}

.home-trial-strip span {
  color: #c7d2fe;
  font-size: 13px;
}

.home-promo-row {
  margin-top: -70px;
  position: relative;
  z-index: 3;
}

.home-case-section,
.home-community-strip {
  width: min(1180px, calc(100% - 40px));
  margin: 22px auto 0;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(8, 19, 34, 0.86), rgba(6, 33, 44, 0.72));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.home-case-section {
  padding: 18px;
}

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

.home-case-head h2 {
  margin: 2px 0 0;
  color: #f8fbff;
  font-size: clamp(22px, 2.2vw, 32px);
  letter-spacing: 0;
}

.home-case-head a,
.home-community-strip a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  color: #04111f;
  font-weight: 950;
  text-decoration: none;
  background: linear-gradient(135deg, #fef08a, #facc15 48%, #14b8a6);
  box-shadow: 0 16px 36px rgba(250, 204, 21, 0.22);
}

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

.home-case-grid article {
  min-height: 142px;
  padding: 16px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 10px;
  background:
    radial-gradient(circle at 82% 14%, rgba(34, 211, 238, 0.18), transparent 32%),
    rgba(2, 6, 23, 0.52);
}

.home-case-grid b {
  color: #67e8f9;
  font-size: 12px;
}

.home-case-grid strong {
  display: block;
  margin-top: 10px;
  color: #ffffff;
  font-size: 17px;
}

.home-case-grid p {
  margin: 10px 0 0;
  color: #9fb3c8;
  line-height: 1.65;
}

.home-community-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 34px;
}

.home-community-strip strong,
.home-community-strip span {
  display: block;
}

.home-community-strip strong {
  color: #ecfeff;
  font-size: 20px;
}

.home-community-strip span {
  margin-top: 6px;
  color: #a7f3d0;
}

@media (max-width: 860px) {
  .home-trial-strip,
  .home-case-head,
  .home-community-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .home-promo-row {
    margin-top: 0;
  }

  .home-case-grid {
    grid-template-columns: 1fr;
  }
}
/* Home promotion conversion update END */


body[data-page="admin"] .admin-login-panel {
  width: min(460px, 100%);
  margin: 42px auto 0;
}

body[data-page="admin"] .admin-login-panel .section-head {
  text-align: center;
  justify-content: center;
}

body[data-page="admin"] .admin-login-panel .admin-grid {
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 380px;
  margin: 0 auto;
}

body[data-page="admin"] .admin-login-panel .button.primary {
  width: 100%;
  min-height: 42px;
}

body[data-page="admin"] .admin-password-card {
  border-color: rgba(245, 190, 92, 0.22);
}

body[data-page="admin"] .admin-password-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

body[data-page="admin"] .admin-password-grid .actions {
  align-self: end;
}

@media (max-width: 900px) {
  body[data-page="admin"] .admin-password-grid {
    grid-template-columns: 1fr;
  }
}

body[data-page="image"] .history-date-filter,
body[data-page="video"] .history-date-filter {
  position: relative;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  gap: 12px;
  border: 1px solid rgba(125, 211, 252, 0.38);
  border-radius: 14px;
  padding: 11px 12px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(20, 184, 166, 0.14)),
    rgba(7, 17, 31, 0.92);
  box-shadow: 0 16px 34px rgba(3, 10, 24, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body[data-page="video"] .history-date-filter {
  border-color: rgba(167, 139, 250, 0.42);
  background:
    linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(14, 165, 233, 0.15)),
    rgba(7, 17, 31, 0.92);
}

body[data-page="image"] .history-date-filter.has-records {
  border-color: rgba(34, 197, 94, 0.72);
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.26), rgba(14, 165, 233, 0.18)),
    rgba(7, 17, 31, 0.94);
  box-shadow: 0 18px 38px rgba(34, 197, 94, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body[data-page="video"] .history-date-filter.has-records {
  border-color: rgba(251, 191, 36, 0.72);
  background:
    linear-gradient(135deg, rgba(251, 191, 36, 0.24), rgba(167, 139, 250, 0.2)),
    rgba(7, 17, 31, 0.94);
  box-shadow: 0 18px 38px rgba(251, 191, 36, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body[data-page="image"] .history-date-filter span,
body[data-page="video"] .history-date-filter span {
  color: rgba(226, 232, 240, 0.88);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
}

body[data-page="image"] .history-date-filter strong,
body[data-page="video"] .history-date-filter strong {
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 950;
  text-shadow: 0 0 18px rgba(125, 211, 252, 0.34);
}

body[data-page="image"] .history-date-filter input,
body[data-page="video"] .history-date-filter input {
  min-height: 40px;
  border: 1px solid rgba(186, 230, 253, 0.56);
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(240, 249, 255, 0.96);
  color: #082f49;
  font-weight: 900;
  color-scheme: light;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 24px rgba(14, 165, 233, 0.14);
}

body[data-page="video"] .history-date-filter input {
  border-color: rgba(221, 214, 254, 0.58);
  background: rgba(245, 243, 255, 0.96);
  color: #312e81;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 24px rgba(124, 58, 237, 0.14);
}

body[data-page="image"] .history-date-filter input:focus,
body[data-page="video"] .history-date-filter input:focus {
  outline: none;
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.24), 0 12px 26px rgba(14, 165, 233, 0.18);
}

body[data-page="image"] .history-date-tabs,
body[data-page="video"] .history-date-tabs {
  gap: 10px;
  padding: 10px 2px 4px;
}

body[data-page="image"] .history-date-tab,
body[data-page="video"] .history-date-tab {
  border: 1px solid rgba(186, 230, 253, 0.38);
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(15, 23, 42, 0.86);
  color: #e0f2fe;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body[data-page="video"] .history-date-tab {
  border-color: rgba(221, 214, 254, 0.38);
  color: #ede9fe;
}

body[data-page="image"] .history-date-tab.has-records:not(.active) {
  border-color: rgba(34, 197, 94, 0.56);
  background: rgba(22, 101, 52, 0.42);
  color: #bbf7d0;
}

body[data-page="video"] .history-date-tab.has-records:not(.active) {
  border-color: rgba(251, 191, 36, 0.58);
  background: rgba(113, 63, 18, 0.44);
  color: #fde68a;
}

body[data-page="image"] .history-date-tab.has-records:not(.active) strong,
body[data-page="video"] .history-date-tab.has-records:not(.active) strong {
  background: rgba(255, 255, 255, 0.18);
}

body[data-page="image"] .history-date-tab strong,
body[data-page="video"] .history-date-tab strong {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  text-align: center;
}

body[data-page="image"] .history-date-tab.active,
body[data-page="video"] .history-date-tab.active {
  border-color: rgba(250, 204, 21, 0.8);
  background: linear-gradient(135deg, #facc15, #22d3ee);
  color: #09202f;
  box-shadow: 0 12px 26px rgba(34, 211, 238, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

body[data-page="video"] .history-date-tab.active {
  background: linear-gradient(135deg, #facc15, #a78bfa);
  color: #21113d;
}

@media (max-width: 720px) {
  body[data-page="image"] .history-date-filter,
  body[data-page="video"] .history-date-filter {
    grid-template-columns: 1fr;
  }
}

.zip-progress-notice {
  overflow: hidden;
  max-height: 0;
  margin: 0;
  opacity: 0;
  transform: translateY(-8px);
  border: 1px solid rgba(255, 211, 105, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 202, 74, 0.18), rgba(68, 214, 255, 0.12)),
    rgba(8, 14, 30, 0.9);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: max-height 0.28s ease, opacity 0.2s ease, transform 0.24s ease, margin 0.24s ease;
}

.zip-progress-notice.show {
  max-height: 150px;
  margin: 12px 0 14px;
  opacity: 1;
  transform: translateY(0);
}

.zip-progress-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
}

.zip-progress-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd35f, #20dcff);
  box-shadow: 0 0 18px rgba(255, 211, 95, 0.7);
}

.zip-progress-title {
  display: block;
  color: #fff7d1;
  font-size: 14px;
  letter-spacing: 0;
}

.zip-progress-detail {
  margin: 4px 0 0;
  color: rgba(226, 240, 255, 0.82);
  font-size: 12px;
  line-height: 1.55;
}

.zip-progress-track {
  height: 4px;
  margin: 0 16px 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.zip-progress-track span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd35f, #24d8ff, #ffd35f);
  animation: zipProgressSlide 1.15s ease-in-out infinite;
}

.zip-progress-notice.is-success {
  border-color: rgba(67, 232, 153, 0.42);
  background:
    linear-gradient(135deg, rgba(67, 232, 153, 0.18), rgba(68, 214, 255, 0.12)),
    rgba(8, 14, 30, 0.92);
}

.zip-progress-notice.is-success .zip-progress-dot,
.zip-progress-notice.is-success .zip-progress-track span {
  background: linear-gradient(135deg, #43e899, #24d8ff);
}

.zip-progress-notice.is-danger {
  border-color: rgba(255, 103, 103, 0.46);
  background:
    linear-gradient(135deg, rgba(255, 103, 103, 0.18), rgba(255, 211, 95, 0.1)),
    rgba(8, 14, 30, 0.92);
}

.zip-progress-notice.is-danger .zip-progress-dot,
.zip-progress-notice.is-danger .zip-progress-track span {
  background: linear-gradient(135deg, #ff6767, #ffd35f);
}

@keyframes zipProgressSlide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(240%);
  }
}

/* 电商详情页与 AI 帮写 */
.image-workbench-panel .mode-tab-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  text-align: left;
}

.image-workbench-panel .mode-tab-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: 0.82rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-workbench-panel .mode-tab-copy small {
  color: #667085;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
}

.copy-field .field-heading,
.copy-field .field-assist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copy-field .field-heading label {
  min-width: 0;
  color: #344054;
  font-size: 0.82rem;
  font-weight: 800;
}

.copy-field .field-assist-row {
  align-items: flex-start;
}

.copy-field .field-assist-row > small:first-child {
  min-width: 0;
}

.clone-settings-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 6px 14px;
}

.clone-settings-row .field {
  grid-template-rows: 20px 42px;
  align-content: start;
}

.clone-settings-row .field > span {
  display: flex;
  align-items: center;
  min-height: 20px;
}

.image-workbench-panel .clone-settings-row .field input,
.image-workbench-panel .clone-settings-row .field select {
  height: 42px;
  min-height: 42px;
}

.clone-settings-help {
  grid-column: 1 / -1;
  margin: 0;
  color: #667085;
  font-size: 0.72rem;
  line-height: 1.45;
}

.ai-write-button {
  min-width: 72px;
  min-height: 30px;
  flex: 0 0 auto;
  border: 1px solid #15803d;
  border-radius: 7px;
  padding: 5px 10px;
  background: linear-gradient(135deg, #14532d 0%, #15803d 100%);
  color: #f0fdf4;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 7px 18px rgba(21, 128, 61, 0.2), inset 0 1px 0 rgba(220, 252, 231, 0.16);
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.ai-write-button:hover {
  border-color: #22c55e;
  background: linear-gradient(135deg, #166534 0%, #16a34a 100%);
  box-shadow: 0 9px 22px rgba(22, 163, 74, 0.28), inset 0 1px 0 rgba(220, 252, 231, 0.2);
  transform: translateY(-1px);
}

.ai-write-button:focus-visible {
  outline: 3px solid rgba(74, 222, 128, 0.25);
  outline-offset: 2px;
}

.ai-write-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ai-write-status {
  min-height: 18px;
  flex: 0 0 auto;
  color: #667085;
  font-weight: 800;
  text-align: right;
}

.ai-write-status.loading {
  color: #2563eb;
}

.ai-write-status.success {
  color: #047857;
}

.ai-write-status.danger {
  color: #b42318;
}

.detail-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 7px;
}

.detail-module-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  min-height: 54px;
  gap: 7px;
  border: 1px solid #d8e2ff;
  border-radius: 7px;
  padding: 7px 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.detail-module-option:hover,
.detail-module-option.selected {
  border-color: #7aa7ff;
  background: #eef5ff;
}

.detail-module-option.selected {
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.detail-module-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #2563eb;
}

.detail-module-option > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.detail-module-option strong,
.detail-module-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-module-option strong {
  color: #344054;
  font-size: 0.76rem;
}

.detail-module-option small {
  color: #667085;
  font-size: 0.67rem;
}

body[data-page="image"] .image-workbench-panel .mode-tab-copy small,
body[data-page="image"] .detail-module-option small,
body[data-page="image"] .copy-field .field-assist-row > small:first-child {
  color: #8ea2ba;
}

body[data-page="image"] .copy-field .field-heading label,
body[data-page="image"] .detail-module-option strong {
  color: #e7f3ff;
}

body[data-page="image"] .ai-write-button {
  border-color: rgba(74, 222, 128, 0.7);
  background: linear-gradient(135deg, #064e3b 0%, #047857 58%, #059669 100%);
  color: #ecfdf5;
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.24), inset 0 1px 0 rgba(209, 250, 229, 0.18);
}

body[data-page="image"] .ai-write-button:hover {
  border-color: rgba(134, 239, 172, 0.9);
  background: linear-gradient(135deg, #065f46 0%, #059669 58%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(236, 253, 245, 0.22);
}

body[data-page="image"] .ai-write-status {
  color: #8ea2ba;
}

body[data-page="image"] .ai-write-status.loading {
  color: #7dd3fc;
}

body[data-page="image"] .ai-write-status.success {
  color: #99f6e4;
}

body[data-page="image"] .ai-write-status.danger {
  color: #fecdd3;
}

body[data-page="image"] .detail-module-option {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.72);
}

body[data-page="image"] .detail-module-option:hover,
body[data-page="image"] .detail-module-option.selected {
  border-color: rgba(45, 212, 191, 0.48);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(56, 189, 248, 0.1));
}

body[data-page="image"] .detail-module-option.selected {
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.08);
}

body[data-page="image"] .detail-module-option input {
  accent-color: #2dd4bf;
}

body[data-page="image"] .clone-settings-help {
  color: #8ea2ba;
}

@media (max-width: 1180px) {
  .detail-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .image-workbench-panel .mode-tab-copy strong {
    font-size: 0.75rem;
  }

  .image-workbench-panel .mode-tab-copy small {
    display: none;
  }

  .copy-field .field-assist-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-write-status {
    text-align: left;
  }

  .clone-settings-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .clone-settings-help {
    grid-column: 1;
  }
}

@media (max-width: 420px) {
  .detail-module-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Admin Apple-inspired operations UI */
body[data-page="admin"] {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: #f5f5f7;
  --line: #d2d2d7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --brand: #0071e3;
  --brand-dark: #0058b0;
  --accent: #0071e3;
  --accent-soft: #e8f2ff;
  --success: #248a3d;
  --success-soft: #eaf6ed;
  --warning: #b25000;
  --warning-soft: #fff4e5;
  --danger: #d70015;
  --danger-soft: #fff0f1;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  min-height: 100vh;
  background: #f5f5f7;
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

body[data-page="admin"] .app-shell {
  width: min(1520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 34px;
}

body[data-page="admin"] .topbar {
  position: sticky;
  top: 10px;
  z-index: 80;
  min-height: 68px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

body[data-page="admin"] .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #0071e3;
  color: #ffffff;
  box-shadow: none;
}

body[data-page="admin"] .brand strong,
body[data-page="admin"] .section-head h1,
body[data-page="admin"] .brief-hero h2,
body[data-page="admin"] .admin-card h2,
body[data-page="admin"] .table-head h2,
body[data-page="admin"] .compact-card-head h2 {
  color: #1d1d1f;
  letter-spacing: 0;
}

body[data-page="admin"] .brand strong {
  font-size: 15px;
  font-weight: 700;
}

body[data-page="admin"] .brand small,
body[data-page="admin"] .admin-card p,
body[data-page="admin"] .table-head p,
body[data-page="admin"] .brief-hero p,
body[data-page="admin"] .muted-text,
body[data-page="admin"] .order-number-stack small {
  color: #6e6e73;
}

body[data-page="admin"] .topnav {
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #f5f5f7;
}

body[data-page="admin"] .topnav a {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 7px;
  color: #515154;
  font-size: 13px;
  font-weight: 600;
}

body[data-page="admin"] .topnav a.active,
body[data-page="admin"] .topnav a:hover {
  background: #ffffff;
  color: #0071e3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

body[data-page="admin"] .admin-workspace {
  width: 100%;
  margin: 0;
}

body[data-page="admin"] .panel,
body[data-page="admin"] .admin-card,
body[data-page="admin"] .admin-login-panel {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.045);
}

body[data-page="admin"] .admin-panel {
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="admin"] .admin-panel > .section-head {
  min-height: 68px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

body[data-page="admin"] .section-head h1 {
  font-size: 21px;
  font-weight: 700;
}

body[data-page="admin"] .eyebrow {
  color: #86868b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

body[data-page="admin"] .admin-tabs {
  top: 96px;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.045);
}

body[data-page="admin"] .admin-tabs::before {
  margin: 5px 8px 8px;
  color: #86868b;
  font-size: 11px;
  font-weight: 700;
}

body[data-page="admin"] .admin-tab {
  min-height: 42px;
  padding: 0 12px 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #515154;
  font-size: 13px;
  font-weight: 600;
}

body[data-page="admin"] .admin-tab::before {
  width: 3px;
  height: 18px;
  margin-right: 10px;
  border-radius: 2px;
  background: transparent;
  box-shadow: none;
}

body[data-page="admin"] .admin-tab:hover {
  border-color: transparent;
  background: #f5f5f7;
  color: #1d1d1f;
}

body[data-page="admin"] .admin-tab.active {
  border-color: #cfe5ff;
  background: #e8f2ff;
  color: #0066cc;
  box-shadow: none;
}

body[data-page="admin"] .admin-tab.active::before,
body[data-page="admin"] .admin-tab:hover::before {
  background: #0071e3;
  box-shadow: none;
}

body[data-page="admin"] .admin-tab.active::after {
  display: none;
}

body[data-page="admin"] .admin-view {
  display: grid;
  gap: 14px;
  overflow: visible;
}

body[data-page="admin"] .admin-card {
  padding: 18px;
}

body[data-page="admin"] .brief-hero {
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

body[data-page="admin"] .brief-hero h2,
body[data-page="admin"] .admin-card h2,
body[data-page="admin"] .table-head h2,
body[data-page="admin"] .compact-card-head h2 {
  font-size: 17px;
  font-weight: 700;
}

body[data-page="admin"] .brief-hero span,
body[data-page="admin"] .token-pool-summary,
body[data-page="admin"] .config-save-status {
  border: 1px solid #d2d2d7;
  border-radius: 7px;
  background: #f5f5f7;
  color: #515154;
}

body[data-page="admin"] .token-pool-summary span,
body[data-page="admin"] .token-pool-summary small {
  color: #6e6e73;
}

body[data-page="admin"] .token-pool-summary strong {
  color: #1d1d1f;
  text-shadow: none;
}

body[data-page="admin"] .admin-summary-grid {
  gap: 8px;
}

body[data-page="admin"] .admin-summary-grid span,
body[data-page="admin"] .brief-metric,
body[data-page="admin"] .package-config-row,
body[data-page="admin"] .member-tools,
body[data-page="admin"] .transaction-tools,
body[data-page="admin"] .order-tools,
body[data-page="admin"] .card-tools,
body[data-page="admin"] .token-table-actions,
body[data-page="admin"] .compact-config,
body[data-page="admin"] .token-pool-card,
body[data-page="admin"] .token-import-card,
body[data-page="admin"] .pool-log-card {
  border-color: rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #f5f5f7;
}

body[data-page="admin"] .admin-summary-grid strong,
body[data-page="admin"] .brief-metric strong {
  color: #1d1d1f;
}

body[data-page="admin"] .admin-summary-grid span,
body[data-page="admin"] .brief-metric span,
body[data-page="admin"] .brief-metric small,
body[data-page="admin"] .token-table-actions span,
body[data-page="admin"] .card-tools span {
  color: #6e6e73;
}

body[data-page="admin"] .brief-metric.token-remaining-alert {
  border-color: #ffd6b3;
  background: #fff8f0;
}

body[data-page="admin"] input,
body[data-page="admin"] textarea,
body[data-page="admin"] select,
body[data-page="admin"] .admin-card textarea,
body[data-page="admin"] .admin-output,
body[data-page="admin"] .admin-mini-input,
body[data-page="admin"] .package-config-row input,
body[data-page="admin"] .package-config-row select,
body[data-page="admin"] .member-tools input,
body[data-page="admin"] .member-tools select,
body[data-page="admin"] .transaction-tools input,
body[data-page="admin"] .transaction-tools select,
body[data-page="admin"] .order-tools input,
body[data-page="admin"] .order-tools select,
body[data-page="admin"] .card-tools select,
body[data-page="admin"] .card-tools .page-size-custom {
  border: 1px solid #d2d2d7;
  border-radius: 7px;
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: none;
}

body[data-page="admin"] input::placeholder,
body[data-page="admin"] textarea::placeholder {
  color: #a1a1a6;
}

body[data-page="admin"] input:focus,
body[data-page="admin"] textarea:focus,
body[data-page="admin"] select:focus {
  outline: 0;
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

body[data-page="admin"] .button,
body[data-page="admin"] .mini-button {
  min-height: 34px;
  border-radius: 7px;
  font-weight: 650;
  letter-spacing: 0;
  box-shadow: none;
}

body[data-page="admin"] .button.primary {
  border-color: #0071e3;
  background: #0071e3;
  color: #ffffff;
  text-shadow: none;
}

body[data-page="admin"] .button.primary:hover {
  border-color: #0077ed;
  background: #0077ed;
  color: #ffffff;
}

body[data-page="admin"] .button.secondary,
body[data-page="admin"] .mini-button.active {
  border-color: #cfe5ff;
  background: #e8f2ff;
  color: #0066cc;
}

body[data-page="admin"] .button.ghost,
body[data-page="admin"] .mini-button {
  border-color: #d2d2d7;
  background: #ffffff;
  color: #515154;
}

body[data-page="admin"] .button.ghost:hover,
body[data-page="admin"] .mini-button:hover {
  border-color: #b7b7bc;
  background: #f5f5f7;
  color: #1d1d1f;
}

body[data-page="admin"] .mini-button.danger {
  border-color: #ffc2c8;
  background: #fff0f1;
  color: #d70015;
}

body[data-page="admin"] .mini-button.success,
body[data-page="admin"] .config-save-status.success,
body[data-page="admin"] .member-type-pill.account,
body[data-page="admin"] .order-status.success,
body[data-page="admin"] .success-text {
  border-color: #b8dfc0;
  background: #eaf6ed;
  color: #248a3d;
}

body[data-page="admin"] .member-type-pill.card,
body[data-page="admin"] .order-status.warning,
body[data-page="admin"] .config-save-status.warning {
  border-color: #ffd6ad;
  background: #fff4e5;
  color: #9a4b00;
}

body[data-page="admin"] .table-wrap {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #ffffff;
}

body[data-page="admin"] .admin-table {
  background: #ffffff;
  color: #1d1d1f;
  font-size: 12px;
}

body[data-page="admin"] .admin-table th {
  border-bottom-color: #d2d2d7;
  background: #f5f5f7;
  color: #6e6e73;
  font-size: 11px;
  font-weight: 700;
}

body[data-page="admin"] .admin-table td {
  border-bottom-color: #e8e8ed;
}

body[data-page="admin"] .admin-table tbody tr:hover td {
  background: #f8fbff;
}

body[data-page="admin"] .admin-table code {
  color: #0066cc;
}

body[data-page="admin"] .success-row td,
body[data-page="admin"] .token-row-success td {
  background: #f2faf4;
}

body[data-page="admin"] .token-row-warning td {
  background: #fff9f0;
}

body[data-page="admin"] .danger-row td,
body[data-page="admin"] .token-row-danger td,
body[data-page="admin"] .monitor-row-timeout td {
  background: #fff5f5;
}

body[data-page="admin"] .muted-row td,
body[data-page="admin"] .token-row-disabled td {
  background: #f5f5f7;
  color: #86868b;
}

body[data-page="admin"] .token-state-pill,
body[data-page="admin"] .order-status.muted,
body[data-page="admin"] .monitor-status {
  border: 1px solid #d2d2d7;
  background: #f5f5f7;
  color: #515154;
}

body[data-page="admin"] .package-config-head {
  background: #f5f5f7;
  color: #6e6e73;
}

body[data-page="admin"] .pager {
  background: transparent;
}

body[data-page="admin"] .submit-toast {
  border-color: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.14);
}

body[data-page="admin"] .image-monitor-table {
  min-width: 1040px;
}

body[data-page="admin"] .image-monitor-table-wrap {
  max-height: 520px;
}

body[data-page="admin"] .admin-login-panel {
  width: min(440px, 100%);
  margin: 72px auto 0;
  padding: 24px;
}

body[data-page="admin"] .admin-login-panel .admin-grid {
  grid-template-columns: 1fr;
}

body[data-page="admin"] .aicopy-connection-test,
body[data-page="admin"] .opentk-connection-test {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  padding: 12px;
  background: #f5f5f7;
}

body[data-page="admin"] .aicopy-connection-test .button,
body[data-page="admin"] .opentk-connection-test .button {
  flex: 0 0 auto;
  min-width: 190px;
}

body[data-page="admin"] .aicopy-connection-test small,
body[data-page="admin"] .opentk-connection-test small,
body[data-page="admin"] #openTkImageModelStatus,
body[data-page="admin"] #openTkCopyModelStatus {
  min-width: 0;
  color: #6e6e73;
  overflow-wrap: anywhere;
}

body[data-page="admin"] #openTkModel,
body[data-page="admin"] #openTkCopyModel {
  width: 100%;
}

@media (max-width: 980px) {
  body[data-page="admin"] .app-shell {
    width: min(100% - 20px, 1520px);
    padding-top: 10px;
  }

  body[data-page="admin"] .topbar {
    top: 6px;
  }

  body[data-page="admin"] .admin-panel {
    grid-template-columns: 1fr;
  }

  body[data-page="admin"] .admin-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body[data-page="admin"] .topbar {
    align-items: flex-start;
  }

  body[data-page="admin"] .brand small {
    display: none;
  }

  body[data-page="admin"] .admin-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="admin"] .admin-card,
  body[data-page="admin"] .brief-hero,
  body[data-page="admin"] .admin-panel > .section-head {
    padding: 14px;
  }

  body[data-page="admin"] .aicopy-connection-test,
  body[data-page="admin"] .opentk-connection-test {
    align-items: stretch;
    flex-direction: column;
  }

  body[data-page="admin"] .aicopy-connection-test .button,
  body[data-page="admin"] .opentk-connection-test .button {
    width: 100%;
  }
}
