/* ============================================================
   hi-light Studio UI
   Shared by front desk and admin. Keep existing JS ids/classes.
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #06070c;
  --bg-2: #0a0d16;
  --panel: rgba(12, 16, 29, 0.78);
  --panel-strong: rgba(17, 22, 38, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.055);
  --field: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.105);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f7f3ea;
  --text-dim: #b7bdcc;
  --text-muted: #747d93;
  --blue: #6ba7ff;
  --cyan: #66e4ff;
  --violet: #a78bfa;
  --pink: #f0a7ff;
  --gold: #f8d481;
  --green: #72f0b0;
  --red: #ff7d91;
  --grad: linear-gradient(135deg, #6ba7ff 0%, #8f7bff 43%, #f0a7ff 100%);
  --grad-hot: linear-gradient(135deg, #f8d481 0%, #f0a7ff 45%, #6ba7ff 100%);
  --glow-blue: 0 24px 80px rgba(72, 136, 255, 0.32);
  --glow-violet: 0 24px 80px rgba(151, 104, 255, 0.28);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
  --shadow-xl: 0 44px 120px rgba(0, 0, 0, 0.68);
  --r-xs: 10px;
  --r-sm: 14px;
  --r: 20px;
  --r-lg: 30px;
  --r-xl: 38px;
  --sidebar-w: 286px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(107, 167, 255, 0.22), transparent 30vw),
    radial-gradient(circle at 80% 0%, rgba(240, 167, 255, 0.16), transparent 28vw),
    radial-gradient(circle at 70% 92%, rgba(102, 228, 255, 0.11), transparent 34vw),
    linear-gradient(180deg, #080913 0%, #05060b 100%);
  font-family: Inter, "SF Pro Display", "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 50% 18%, #000 0, transparent 72%);
}

body::after {
  opacity: 0.38;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
  background-clip: padding-box;
}

::selection {
  color: #fff;
  background: rgba(107, 167, 255, 0.38);
}

.hidden {
  display: none !important;
}

.eyebrow,
.side-panel-kicker,
.composer-kicker {
  margin: 0;
  color: var(--cyan);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.logo {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 13px;
  color: #fff;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 20px),
    var(--grad);
  box-shadow: var(--glow-blue), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  font-size: 17px;
}

.logo-lg {
  width: 62px;
  height: 62px;
  border-radius: 22px;
  font-size: 30px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 16px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.048));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  cursor: pointer;
  font: 750 14px/1.2 inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.07));
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  border: 0;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 18px 48px rgba(107, 167, 255, 0.28), 0 12px 34px rgba(167, 139, 250, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.btn-primary:hover {
  box-shadow: 0 24px 64px rgba(107, 167, 255, 0.36), 0 18px 46px rgba(167, 139, 250, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.045);
}

.btn-block {
  width: 100%;
  min-height: 48px;
}

.btn-sm {
  min-height: 31px;
  padding: 6px 11px;
  border-radius: 11px;
  font-size: 12px;
}

.btn-danger {
  color: #ffd2db;
  border-color: rgba(255, 125, 145, 0.34);
  background: rgba(255, 125, 145, 0.09);
}

.btn-danger:hover {
  border-color: rgba(255, 125, 145, 0.58);
  background: rgba(255, 125, 145, 0.15);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

textarea,
select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  padding: 11px 13px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(3, 7, 18, 0.52), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  font: 500 14px/1.45 inherit;
  resize: vertical;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

textarea::placeholder,
input::placeholder {
  color: rgba(183, 189, 204, 0.54);
}

textarea:hover,
select:hover,
input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

textarea:focus,
select:focus,
input:focus {
  border-color: rgba(102, 228, 255, 0.72);
  background: rgba(4, 10, 24, 0.7);
  box-shadow: 0 0 0 4px rgba(102, 228, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

select {
  appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='9' viewBox='0 0 14 9' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23b7bdcc' d='M7 8.2.7 1.8 2.1.4 7 5.3 11.9.4l1.4 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

select option {
  color: var(--text);
  background: #101522;
}

input[type="number"] {
  appearance: textfield;
}

.status {
  min-height: 0;
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
}

.status:empty {
  display: none;
}

.status.err {
  color: var(--red);
}

.status.ok {
  color: var(--green);
}

.hint {
  margin: 8px 0 18px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.8;
}

code,
.hint code,
.auth-hint code {
  border: 1px solid rgba(102, 228, 255, 0.16);
  border-radius: 8px;
  padding: 2px 7px;
  color: #d8fbff;
  background: rgba(102, 228, 255, 0.08);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
}

/* Auth */
.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
}

.auth-shell {
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: stretch;
}

.auth-hero,
.auth-card,
.modal-card,
.composer,
.card,
.sidebar,
.workspace,
.side-panel,
.user-box,
.topbar,
.admin-hero,
.admin-nav-wrap,
.admin-pane,
.table-wrap {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.052));
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(1.18);
  -webkit-backdrop-filter: blur(26px) saturate(1.18);
}

.auth-hero {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
}

.auth-hero::before {
  content: "";
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  top: 50px;
  right: 34px;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 32% 24%, rgba(248, 212, 129, 0.45), transparent 20%),
    radial-gradient(circle at 70% 35%, rgba(102, 228, 255, 0.38), transparent 22%),
    radial-gradient(circle at 42% 74%, rgba(240, 167, 255, 0.34), transparent 24%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 40px 120px rgba(0, 0, 0, 0.34);
  transform: rotate(7deg);
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: auto 42px 40px 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
}

.auth-hero .logo {
  position: relative;
  z-index: 1;
  margin-bottom: auto;
}

.auth-hero > * {
  position: relative;
  z-index: 1;
}

.auth-hero h1 {
  max-width: 640px;
  margin: 16px 0;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.92;
  letter-spacing: -0.075em;
}

.auth-hero-copy {
  max-width: 560px;
  margin: 0;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.85;
}

.auth-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 32px;
}

.auth-feature-grid span {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 17px;
  padding: 12px 13px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.062);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.auth-card {
  align-self: center;
  width: auto;
  border-radius: 34px;
  padding: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.145), rgba(255, 255, 255, 0.05)),
    rgba(9, 12, 24, 0.86);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.auth-sub {
  margin: 0 0 26px;
  color: var(--text-dim);
  font-size: 13.5px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.24);
}

.auth-tab {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 10px 0;
  color: var(--text-dim);
  background: transparent;
  cursor: pointer;
  font: 850 14px/1 inherit;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab--active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.auth-card .status {
  margin-top: 13px;
  text-align: center;
}

.auth-hint {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.75;
}

/* Front desk shell */
.app-shell {
  display: flex;
  gap: 18px;
  height: 100vh;
  padding: 18px;
  overflow: hidden;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 31px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)),
    rgba(8, 11, 24, 0.78);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 24px;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.side-label {
  padding: 0 10px 8px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.side-nav,
.side-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-item,
.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text-dim);
  background: transparent;
  cursor: pointer;
  font: 750 14px/1.2 inherit;
  text-align: left;
  text-decoration: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.side-item {
  min-height: 48px;
  padding: 0 13px;
}

.side-link {
  min-height: 39px;
  padding: 0 11px;
  font-size: 13px;
}

.side-item svg,
.side-link svg {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.side-item:hover,
.side-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.side-item.tab--active {
  color: #fff;
  border-color: rgba(102, 228, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(107, 167, 255, 0.18), rgba(167, 139, 250, 0.14)),
    rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 16px 36px rgba(0, 0, 0, 0.18);
}

.side-item.tab--active svg {
  color: var(--cyan);
}

.side-panel {
  position: relative;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 23px;
  padding: 17px;
  background:
    radial-gradient(circle at 88% 4%, rgba(248, 212, 129, 0.18), transparent 42%),
    radial-gradient(circle at 20% 88%, rgba(102, 228, 255, 0.14), transparent 46%),
    rgba(255, 255, 255, 0.058);
}

.side-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 34%, rgba(255, 255, 255, 0.04));
  pointer-events: none;
}

.side-panel strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 7px;
  font-size: 15px;
}

.side-panel p {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.75;
}

.side-spacer {
  flex: 1;
}

.side-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 21px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
  display: inline-grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  border-radius: 15px;
  color: #fff;
  background: var(--grad-hot);
  box-shadow: 0 14px 34px rgba(240, 167, 255, 0.22);
  font-weight: 900;
}

.user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.user-meta .user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 850;
}

.token-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
}

.token-state--on {
  color: var(--green);
}

.token-state--off {
  color: var(--red);
}

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 34px;
  background:
    radial-gradient(circle at 48% 0%, rgba(107, 167, 255, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.026)),
    rgba(7, 10, 22, 0.66);
}

.work-top {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 23px 28px;
  background: rgba(255, 255, 255, 0.035);
}

.work-top h2 {
  margin: 5px 0 0;
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.055em;
}

.work-tabs {
  display: inline-flex;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.2);
}

.work-tab {
  border-radius: 13px;
  padding: 9px 18px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 850;
}

.work-tab--active {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 16px 38px rgba(107, 167, 255, 0.24);
}

.stage-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px 32px 12px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  max-width: 1260px;
  margin: 0 auto;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: min(58vh, 610px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8vh 20px;
}

.hello {
  max-width: 860px;
  margin: 14px 0 0;
  font-size: clamp(48px, 9vw, 96px);
  line-height: 0.88;
  letter-spacing: -0.085em;
  background: linear-gradient(110deg, #fff 8%, #fff4cc 28%, #ccf7ff 54%, #e6d7ff 82%, #f0a7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 18px 42px rgba(107, 167, 255, 0.1));
}

.hello-sub {
  max-width: 620px;
  margin: 20px 0 0;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.8;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.prompt-chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  font-size: 12px;
  font-weight: 850;
}

.showcase-strip {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.showcase-card {
  position: relative;
  overflow: hidden;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px;
  text-align: left;
  background:
    radial-gradient(circle at 82% 16%, rgba(102, 228, 255, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.showcase-card--hot {
  background:
    radial-gradient(circle at 84% 18%, rgba(248, 212, 129, 0.24), transparent 35%),
    radial-gradient(circle at 18% 80%, rgba(240, 167, 255, 0.16), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.052));
}

.showcase-card::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.48), transparent);
}

.showcase-card span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.showcase-card strong {
  display: block;
  margin-top: 28px;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 25px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    rgba(9, 12, 24, 0.86);
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
  animation: cardin 0.42s var(--ease) both;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 32%, rgba(255, 255, 255, 0.04));
}

.card:hover {
  transform: translateY(-7px) scale(1.012);
  border-color: rgba(102, 228, 255, 0.28);
  box-shadow: var(--shadow-xl);
}

@keyframes cardin {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card img,
.card video {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
  background: #02040a;
}

.card video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.card img {
  cursor: zoom-in;
}

.card-imgs {
  display: grid;
  grid-template-columns: 1fr;
}

.card-imgs.multi {
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.card-imgs img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
  background: #02040a;
  cursor: zoom-in;
}

.card-loading {
  min-height: 230px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: var(--text-dim);
  background:
    radial-gradient(circle at 50% 36%, rgba(102, 228, 255, 0.15), transparent 34%),
    radial-gradient(circle at 45% 70%, rgba(167, 139, 250, 0.12), transparent 34%),
    rgba(0, 0, 0, 0.2);
}

.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(102, 228, 255, 0.26);
  animation: spin 0.82s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-bar {
  width: 70%;
  height: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--grad-hot);
  transition: width 0.34s var(--ease);
}

.card-progress-text {
  font-size: 12px;
  font-weight: 850;
}

.card-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 18px;
  color: #ffd2db;
  text-align: center;
  background: rgba(255, 125, 145, 0.09);
  font-size: 13px;
}

.card-foot {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
  font-weight: 750;
}

.card-foot a {
  color: var(--cyan);
  text-decoration: none;
}

.card-foot a:hover {
  text-decoration: underline;
}

.composer {
  flex: 0 0 auto;
  width: min(1040px, calc(100% - 56px));
  margin: 0 auto 26px;
  border-radius: 31px;
  padding: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.055)),
    rgba(6, 8, 18, 0.88);
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 6px 14px;
}

.composer-head strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

.composer-pill {
  border: 1px solid rgba(248, 212, 129, 0.25);
  border-radius: 999px;
  padding: 8px 12px;
  color: #ffe8a6;
  background: rgba(248, 212, 129, 0.09);
  font-size: 12px;
  font-weight: 900;
}

.composer .status {
  margin: 0 5px 10px;
}

.composer-input {
  min-height: 64px;
  border: 0;
  padding: 13px 9px;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  resize: none;
}

.composer-input:focus {
  background: transparent;
  box-shadow: none;
}

.composer-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.composer-opts {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: flex-end;
}

.mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.mini-label {
  padding-left: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 900;
}

.mini select {
  width: auto;
  min-width: 98px;
  min-height: 39px;
  border-radius: 999px;
  padding: 8px 32px 8px 12px;
  font-size: 12.5px;
}

.native-model-select {
  display: none;
}

.model-field {
  position: relative;
  min-width: 210px;
}

.model-select {
  position: relative;
}

.model-trigger {
  position: relative;
  width: 210px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  border: 1px solid rgba(102, 228, 255, 0.36);
  border-radius: 20px;
  padding: 9px 40px 9px 14px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(102, 228, 255, 0.12), rgba(255, 255, 255, 0.055)),
    rgba(3, 7, 18, 0.72);
  box-shadow: 0 0 0 4px rgba(102, 228, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.model-trigger::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}

.model-trigger[aria-expanded="true"] {
  border-color: rgba(102, 228, 255, 0.78);
  box-shadow: 0 0 0 5px rgba(102, 228, 255, 0.13), 0 18px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.model-trigger[aria-expanded="true"]::after {
  border-color: var(--cyan);
  transform: translateY(-35%) rotate(225deg);
}

.model-trigger-main {
  max-width: 100%;
  overflow: hidden;
  color: #f9fbff;
  font-size: 12.5px;
  font-weight: 950;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-trigger-sub {
  max-width: 100%;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  z-index: 80;
  width: min(352px, calc(100vw - 48px));
  max-height: min(430px, 62vh);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 24px;
  padding: 8px;
  background:
    radial-gradient(circle at 90% 0%, rgba(102, 228, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(36, 39, 47, 0.98), rgba(18, 20, 27, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  animation: modelMenuIn 0.18s var(--ease);
}

@keyframes modelMenuIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.model-option {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  gap: 11px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 10px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.16s var(--ease);
}

.model-option:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.075);
}

.model-option--active {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.105);
}

.model-icon {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 13px;
  color: #f7f3ea;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.28), transparent 18px),
    rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-size: 14px;
  font-weight: 950;
}

.model-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.model-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 13.5px;
  font-weight: 950;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: #b8bbc2;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.model-check {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
}

.model-check::before {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}

.model-option--active .model-check {
  opacity: 1;
  transform: scale(1);
  border-color: transparent;
  background: #fff;
}

.model-option--active .model-check::before {
  border-color: #24272f;
}

.mini-switch {
  min-height: 39px;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.054);
}

.mini-switch .mini-label {
  padding: 0;
}

.btn-gen {
  align-self: flex-end;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 25px;
  font-size: 14px;
}

.composer-extra {
  margin-top: 12px;
}

.upload-field {
  margin: 12px 0 4px;
}

.upload-box {
  position: relative;
  overflow: hidden;
  border: 1px dashed rgba(102, 228, 255, 0.36);
  border-radius: 22px;
  padding: 22px 18px;
  color: var(--text-dim);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(102, 228, 255, 0.12), transparent 40%),
    rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.upload-box:hover {
  border-color: rgba(102, 228, 255, 0.7);
  color: var(--text);
  background: rgba(102, 228, 255, 0.07);
}

.frame-preview {
  max-width: 100%;
  max-height: 160px;
  margin-top: 12px;
  border-radius: 16px;
}

/* Switch */
.checkbox-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 25px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  cursor: pointer;
  transition: 0.24s var(--ease);
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--text-dim);
  transform: translateY(-50%);
  transition: 0.24s var(--ease);
}

.switch input:checked + .switch-slider {
  border-color: transparent;
  background: var(--grad);
}

.switch input:checked + .switch-slider::before {
  background: #fff;
  transform: translate(18px, -50%);
}

/* Modal and lightbox */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(3, 5, 12, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fade 0.18s var(--ease);
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-card {
  width: min(520px, 94vw);
  border-radius: 30px;
  padding: 27px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.056)),
    rgba(9, 12, 24, 0.92);
  animation: pop 0.26s var(--ease);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-card h3 {
  margin: 0 0 16px;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 19px;
}

.modal-card .status {
  margin-top: 10px;
}

.modal-card--wide {
  max-width: 590px;
  width: 94vw;
}

.modal-sub {
  margin: -5px 0 15px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.65;
}

.key-row {
  display: flex;
  align-items: stretch;
  gap: 9px;
}

.key-input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
}

.key-usage {
  margin-top: 16px;
}

.key-usage-head {
  margin-bottom: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 850;
}

.code-block {
  max-height: 270px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 13px 15px;
  color: #e6f7ff;
  background: rgba(0, 0, 0, 0.28);
  font: 12px/1.65 ui-monospace, "Cascadia Code", Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3vh 3vw;
  background: rgba(2, 4, 10, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: zoom-out;
}

.lightbox img {
  max-width: 94vw;
  max-height: 94vh;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-xl);
  animation: pop 0.22s var(--ease);
}

/* Admin */
.topbar {
  position: sticky;
  top: 18px;
  z-index: 20;
  max-width: 1320px;
  margin: 18px auto 0;
  border-radius: 27px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.052)),
    rgba(8, 11, 24, 0.78);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: -0.035em;
}

.brand span {
  display: block;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-hero {
  position: relative;
  max-width: 1320px;
  margin: 18px auto 0;
  overflow: hidden;
  border-radius: 36px;
  padding: 38px;
  background:
    radial-gradient(circle at 84% 22%, rgba(248, 212, 129, 0.18), transparent 28%),
    radial-gradient(circle at 18% 4%, rgba(102, 228, 255, 0.14), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.052)),
    rgba(8, 11, 24, 0.74);
}

.admin-hero::after {
  content: "";
  position: absolute;
  right: 36px;
  top: 34px;
  width: 210px;
  height: 128px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03)),
    radial-gradient(circle at 30% 32%, rgba(107, 167, 255, 0.28), transparent 26%),
    radial-gradient(circle at 70% 70%, rgba(240, 167, 255, 0.2), transparent 30%);
  transform: rotate(5deg);
}

.admin-hero h1 {
  max-width: 790px;
  margin: 10px 0 10px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.96;
  letter-spacing: -0.075em;
}

.admin-hero > p:not(.eyebrow) {
  max-width: 660px;
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.8;
}

.admin-hero-metrics {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.admin-hero-metrics span {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-nav-wrap {
  max-width: 1320px;
  margin: 16px auto 0;
  border-radius: 25px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.058);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-tab {
  border: 1px solid transparent;
  border-radius: 17px;
  padding: 10px 18px;
  color: var(--text-dim);
  background: transparent;
  cursor: pointer;
  font: 850 14px/1 inherit;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.admin-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.admin-tab--active {
  color: #fff;
  border-color: transparent;
  background: var(--grad);
  box-shadow: 0 18px 42px rgba(107, 167, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.admin-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 0 86px;
}

.admin-pane {
  border-radius: 31px;
  padding: 27px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.048)),
    rgba(8, 11, 24, 0.72);
  animation: fade 0.24s var(--ease);
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
}

.admin-toolbar h3,
.settings-card h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.045em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 22px;
  background:
    radial-gradient(circle at 82% 18%, rgba(102, 228, 255, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(102, 228, 255, 0.28);
}

.stat-card::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  height: 1px;
  background: linear-gradient(90deg, rgba(102, 228, 255, 0.56), transparent);
}

.stat-val {
  font-size: 36px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.06em;
  background: linear-gradient(120deg, #fff, #fff0bf 34%, #adf5ff 78%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-key {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 0.16s;
}

.data-table tbody tr:hover {
  background: rgba(102, 228, 255, 0.07);
}

.empty-cell {
  padding: 38px 0 !important;
  color: var(--text-muted);
  text-align: center !important;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: normal;
}

.mono {
  color: #d6dbe8;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.acct-info {
  color: var(--cyan);
}

.prompt-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 900;
}

.badge-admin {
  color: #eadfff;
  background: rgba(167, 139, 250, 0.2);
}

.badge-ok {
  color: #c9ffe0;
  background: rgba(114, 240, 176, 0.16);
}

.badge-off {
  color: #ffd2db;
  background: rgba(255, 125, 145, 0.17);
}

.settings-card {
  max-width: 760px;
}

.settings-card h3 {
  margin-bottom: 20px;
}

.add-account {
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
}

.add-account h4 {
  margin: 0 0 11px;
  color: var(--text-dim);
  font-size: 14px;
}

.add-account-row {
  display: grid;
  gap: 11px;
}

.admin-status {
  position: fixed;
  right: 26px;
  bottom: 22px;
  z-index: 50;
  max-width: 390px;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 0;
  padding: 12px 16px;
  background: rgba(12, 16, 29, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: pop 0.22s var(--ease);
}

.admin-status:empty {
  display: none;
}

/* Responsive */
@media (max-width: 1080px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: 430px;
  }

  .app-shell {
    padding: 12px;
    gap: 12px;
  }

  .topbar,
  .admin-hero,
  .admin-nav-wrap,
  .admin-main {
    margin-left: 14px;
    margin-right: 14px;
  }
}

@media (max-width: 880px) {
  :root {
    --sidebar-w: 82px;
  }

  .side-brand-name,
  .side-label,
  .side-item span,
  .side-chip span,
  .side-panel,
  .user-meta {
    display: none;
  }

  .sidebar {
    padding: 16px 12px;
  }

  .side-brand,
  .side-item,
  .side-link,
  .user-box {
    justify-content: center;
  }

  .side-link,
  .side-chip {
    font-size: 0;
  }

  .side-chip {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0;
  }

  .side-link svg,
  .side-chip svg {
    width: 18px;
    height: 18px;
  }

  .composer {
    width: calc(100% - 24px);
  }

  .composer-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .btn-gen {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .auth-view {
    padding: 14px;
  }

  .auth-hero,
  .auth-card {
    border-radius: 26px;
    padding: 26px;
  }

  .auth-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell {
    min-height: 100vh;
    height: auto;
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
  }

  .side-brand {
    padding: 0;
  }

  .side-nav,
  .side-actions {
    flex-direction: row;
  }

  .side-spacer,
  .side-foot .user-box {
    display: none;
  }

  .workspace {
    min-height: calc(100vh - 112px);
  }

  .work-top,
  .topbar,
  .topbar-right,
  .admin-toolbar,
  .composer-head,
  .modal-actions,
  .key-row {
    align-items: stretch;
    flex-direction: column;
  }

  .stage-scroll {
    padding: 24px 16px 12px;
  }

  .hello {
    font-size: clamp(42px, 16vw, 70px);
  }

  .composer {
    border-radius: 24px;
  }

  .composer-opts {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .showcase-strip {
    grid-template-columns: 1fr;
  }

  .model-field,
  .model-trigger {
    width: 100%;
    min-width: 0;
  }

  .model-menu {
    width: min(352px, calc(100vw - 32px));
  }

  .mini select {
    width: 100%;
  }

  .field-row {
    display: flex;
    flex-direction: column;
  }

  .admin-hero::after {
    display: none;
  }

  .admin-main {
    padding-left: 0;
    padding-right: 0;
  }

  .admin-pane {
    border-radius: 25px;
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==================== 我的生成历史 ==================== */
.side-item--active {
  color: #fff;
  border-color: rgba(102, 228, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(107, 167, 255, 0.18), rgba(167, 139, 250, 0.14)),
    rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 16px 36px rgba(0, 0, 0, 0.18);
}
.side-item--active svg {
  color: var(--cyan);
}

.history-view {
  max-width: 1260px;
  margin: 0 auto;
}
.history-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.history-head .hello {
  font-size: clamp(34px, 5vw, 54px);
  text-align: left;
  margin-top: 6px;
}
.history-head .hello-sub {
  margin-top: 10px;
  font-size: 14px;
}
.history-actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.hcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease);
}
.hcard:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}
.hcard-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.36);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hcard-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  color: #fff;
  background: rgba(10, 13, 22, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.hcard-badge--video {
  color: var(--gold);
}
.hcard-badge--image {
  color: var(--cyan);
}
.hcard-media > img,
.hcard-media > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.hcard-imgs {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
}
.hcard-imgs.multi {
  grid-template-columns: 1fr 1fr;
}
.hcard-imgs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.hcard-pending,
.hcard-fail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
  padding: 16px;
  text-align: center;
}
.hcard-fail {
  color: var(--red);
}
.hcard-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px 14px 12px;
}
.hcard-prompt {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hcard-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}
.hcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.hcard-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}
.hcard-links a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 800;
}
.hcard-links a:hover {
  text-decoration: underline;
}
.hcard-del {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 5px 12px;
  color: var(--text-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.hcard-del:hover {
  color: var(--red);
  border-color: rgba(255, 125, 145, 0.5);
  background: rgba(255, 125, 145, 0.08);
}

.history-empty {
  min-height: min(46vh, 460px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  color: var(--text-dim);
}
.history-empty h2 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 26px;
}

/* ==================== 模型 Logo（下拉选项 + 触发器） ==================== */
.model-trigger {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.model-trigger-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.model-trigger-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.26), transparent 16px),
    rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.model-trigger-icon .model-logo {
  width: 18px;
  height: 18px;
}
.model-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}
/* 单色品牌 SVG 在深色界面反白显示；彩色 PNG（豆包）保持原样 */
.model-logo.mono {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
.model-logo-fb {
  font-size: 13px;
  font-weight: 900;
  color: #f7f3ea;
}

/* ==================== 提示词输入行 + 紧凑首帧上传 ==================== */
.composer-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.composer-input-row .composer-input {
  flex: 1;
  min-width: 0;
}
.frame-upload {
  position: relative;
  flex: 0 0 auto;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(102, 228, 255, 0.42);
  border-radius: 14px;
  padding: 0;
  color: var(--text-dim);
  background:
    radial-gradient(circle at 50% 0%, rgba(102, 228, 255, 0.12), transparent 65%),
    rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.frame-upload:hover {
  border-color: rgba(102, 228, 255, 0.7);
  color: var(--text);
  background: rgba(102, 228, 255, 0.08);
}
.frame-upload-tip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.1;
}
.frame-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame-upload.has-image .frame-upload-tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  flex-direction: row;
  gap: 0;
  padding: 3px 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.18s var(--ease);
}
.frame-upload.has-image:hover .frame-upload-tip {
  opacity: 1;
}

/* ==================== 历史：分类筛选 + 日期分组 ==================== */
.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 22px;
}
.history-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.history-filter:hover {
  color: var(--text);
  border-color: var(--line-strong);
}
.history-filter--active {
  color: #fff;
  border-color: rgba(102, 228, 255, 0.4);
  background:
    linear-gradient(135deg, rgba(107, 167, 255, 0.2), rgba(167, 139, 250, 0.16)),
    rgba(255, 255, 255, 0.05);
}
.history-filter-n {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.history-filter--active .history-filter-n {
  background: rgba(255, 255, 255, 0.24);
}

.history-groups {
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.history-date {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
}
.history-date-label {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 850;
}
.history-date-count {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}
.history-date::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ==================== 侧栏底部：用户卡 + 操作工具条 ==================== */
.side-foot {
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.user-box {
  gap: 13px;
  padding: 13px;
  border-radius: 18px;
}
.user-avatar {
  box-shadow: 0 14px 30px rgba(240, 167, 255, 0.24);
}
.side-actions {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 8px;
}
.side-chip {
  flex: 1 1 calc(50% - 4px);
  min-width: calc(50% - 4px);
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 10px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  font: 800 12.5px/1 inherit;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.side-chip svg {
  flex: 0 0 auto;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.side-chip:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}
.side-chip:hover svg {
  color: var(--cyan);
}
.side-chip--danger:hover {
  color: #fff;
  border-color: rgba(255, 125, 145, 0.5);
  background: rgba(255, 125, 145, 0.1);
}
.side-chip--danger:hover svg {
  color: var(--red);
}

/* ==================== 后台：按模型定价 + 积分流水 ==================== */
.model-cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 10px 0 16px;
}
.model-cost-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.model-cost-item .mc-name {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
}
.credit-plus {
  color: var(--green);
  font-weight: 850;
}
.credit-minus {
  color: var(--red);
  font-weight: 850;
}

/* ==================== 后台：左右布局 ==================== */
.admin-shell {
  display: flex;
  min-height: 100vh;
}
.admin-side {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line);
}
.admin-side-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.admin-side-brand-text span {
  color: var(--text);
  font-weight: 900;
  font-size: 15px;
}
.admin-side-brand-text small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}
.admin-side-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}
.admin-navi {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text-dim);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: 800 13.5px/1.2 inherit;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.admin-navi svg {
  flex: 0 0 auto;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.admin-navi:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.admin-navi--active {
  color: #fff;
  border-color: rgba(102, 228, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(107, 167, 255, 0.18), rgba(167, 139, 250, 0.14)),
    rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.admin-navi--active svg {
  color: var(--cyan);
}
.admin-side-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.admin-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.admin-content-top {
  padding: 26px 32px 18px;
  border-bottom: 1px solid var(--line);
}
.admin-content-top h1 {
  margin: 4px 0 0;
  font-size: 28px;
  color: var(--text);
}
.admin-content-body {
  flex: 1;
  padding: 26px 32px 40px;
  overflow-y: auto;
}

/* ==================== 品牌 Logo：画笔图标（替换原 ✦） ==================== */
.logo,
.user-avatar {
  position: relative;
  font-size: 0;
}
.logo::after,
.user-avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m9.06 11.9 8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08'/><path d='M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 0 0-3-3.02z'/></svg>");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 56%;
}
@media (max-width: 820px) {
  .admin-shell {
    flex-direction: column;
  }
  .admin-side {
    flex-basis: auto;
    width: 100%;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .admin-side-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-navi {
    width: auto;
  }
  .admin-content-top,
  .admin-content-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ==================== 视频·多图参考 ==================== */
.ref-images-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.ref-images-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ref-thumb {
  position: relative;
  width: 66px;
  height: 66px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #02040a;
}
.ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ref-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.ref-del:hover {
  background: rgba(255, 125, 145, 0.9);
}
.ref-images-tip {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
}

/* ---------- 充值弹窗（在线支付 + 卡密） ---------- */
.pay-tabs { display: flex; gap: 8px; margin: 4px 0 16px; }
.pay-tab {
  flex: 1; padding: 9px 0; border: 1px solid var(--border, #2a2f3a);
  background: transparent; color: var(--text-muted, #8b93a5);
  border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all .15s;
}
.pay-tab.active { background: var(--accent, #4f7dff); color: #fff; border-color: transparent; }
.pay-tiers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.pay-tier {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 14px 6px; border: 1.5px solid var(--border, #2a2f3a);
  background: transparent; border-radius: 11px; cursor: pointer; transition: all .15s;
}
.pay-tier:hover { border-color: var(--accent, #4f7dff); }
.pay-tier.active { border-color: var(--accent, #4f7dff); background: rgba(79, 125, 255, 0.12); }
.pay-tier-amt { font-size: 20px; font-weight: 800; color: var(--text, #e6e9f0); }
.pay-tier-credits { font-size: 11.5px; color: var(--text-muted, #8b93a5); }
.pay-qr-wrap { display: flex; justify-content: center; margin: 16px 0; }
.pay-qr { width: 220px; height: 220px; border-radius: 10px; background: #fff; padding: 8px; box-sizing: border-box; }
.pay-amount { font-size: 20px; font-weight: 800; color: #16c784; }
.pay-tip { font-size: 12px; color: var(--text-muted, #8b93a5); text-align: center; line-height: 1.6; }
