:root {
  --bg-gradient: radial-gradient(circle at top center, #1e1f42, #0f1024 40%, #050610 100%);
  --accent-1: #6366f1;
  --accent-2: #0ea5e9;
  --accent-3: #a855f7;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-bg-hover: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  --success-hover: #059669;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --transition-fast: 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --glow-primary: 0 0 20px rgba(99, 102, 241, 0.5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== 动态背景光球 ========== */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orbs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: orbFloat 25s ease-in-out infinite;
}

.bg-orbs span:nth-child(1) {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  top: -15%;
  left: -10%;
  animation-delay: 0s;
}

.bg-orbs span:nth-child(2) {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  bottom: -10%;
  right: -10%;
  animation-delay: -8s;
}

.bg-orbs span:nth-child(3) {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #10b981, #34d399);
  top: 40%;
  left: 50%;
  animation-delay: -16s;
}

.bg-orbs span:nth-child(4) {
  width: 520px;
  height: 520px;
  background: linear-gradient(135deg, #f472b6, #ec4899);
  top: 70%;
  left: -5%;
  animation-delay: -20s;
}

.bg-orbs span:nth-child(5) {
  width: 450px;
  height: 450px;
  background: linear-gradient(135deg, #f97316, #facc15);
  top: -5%;
  right: 20%;
  animation-delay: -10s;
  opacity: 0.35;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' fill-opacity='0.08'%3E%3Cpath fill='%23fff' d='M0 0h10v10H0zM40 40h10v10H40zM70 10h10v10H70z'/%3E%3C/g%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.4;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -40px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }

  75% {
    transform: translate(40px, 30px) scale(1.02);
  }
}

/* ========== 主容器 ========== */
.glass-app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 24px clamp(16px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1920px;
  margin: 0 auto;
}

/* ========== 玻璃面板基础样式 ========== */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  box-shadow: var(--glass-shadow);
  padding: 24px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  pointer-events: none;
}

.glass-panel:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

/* ========== 导航栏 ========== */
.glass-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  position: sticky;
  top: 16px;
  z-index: 50;
}

.glass-nav:hover {
  transform: none;
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.glass-nav>div:first-child small,
.nav-info small {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.metric-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  min-width: 140px;
}

.metric-pill strong {
  color: var(--text-primary);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.system-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.user-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill,
.pill-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.pill strong {
  color: var(--text-primary);
  font-weight: 600;
}

.pill-soft {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.nav-shortcut {
  border-radius: var(--radius-full);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
}

.nav-shortcut:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

/* ========== 内容网格布局 ========== */
.content-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  flex: 1;
}

/* ========== 侧边导航 ========== */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: fit-content;
  position: sticky;
  top: 120px;
  /* 调整为顶部导航栏高度 + 间距 */
  align-self: flex-start;
}

.side-nav:hover {
  transform: none;
}

.nav-button {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-button .nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fbcfe8;
  font-weight: 600;
}

.nav-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.nav-button span,
.nav-button {
  position: relative;
  z-index: 1;
}

.nav-button:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.nav-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.nav-button.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

/* ========== 控制台主区域 ========== */
.console {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.console h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.console .hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -8px 0 8px;
}

.console.disabled {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.5);
}

.console-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

/* ========== 表单样式 ========== */
.prompt-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 输入框通用样式 */
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  resize: none;
  transition: all var(--transition-fast);
}

textarea::placeholder,
input::placeholder {
  color: var(--text-muted);
}

textarea:hover,
input:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent-1);
  background: rgba(0, 0, 0, 0.4);
  box-shadow:
    0 0 0 4px rgba(99, 102, 241, 0.15),
    0 0 20px rgba(99, 102, 241, 0.1);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

select option {
  background: #1a1b3a;
  color: var(--text-primary);
  padding: 12px;
}

/* 提示词输入区 */
.prompt-group .prompt-area {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.chip:active {
  transform: translateY(0);
}

.prompt-group textarea {
  flex: 1;
  min-height: 140px;
  line-height: 1.6;
}

.prompt-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.input-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.prompt-tip-card {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tip-icon {
  font-size: 1.2rem;
}

.tip-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.tip-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

/* 种子输入行 */
.seed-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seed-input-row input {
  flex: 1;
}

/* ========== 按钮样式 ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 25px rgba(99, 102, 241, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary span {
  position: relative;
  z-index: 1;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-ghost:active {
  transform: scale(0.98);
}

.btn-mini {
  padding: 10px 16px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.advanced-panel {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(8, 11, 26, 0.4);
  margin-top: 16px;
  overflow: hidden;
  transition: border 0.2s ease;
}

.advanced-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 14px 20px 0;
}

.advanced-panel:not(.collapsed) .advanced-summary {
  color: var(--text-primary);
}

.advanced-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  cursor: pointer;
}

.advanced-toggle .chevron {
  transition: transform 0.2s ease;
}

.advanced-panel .advanced-body {
  max-height: 1200px;
  transition: max-height 0.3s ease;
  padding: 0 20px 20px;
}

.advanced-panel.collapsed .advanced-body {
  max-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.advanced-panel.collapsed .advanced-toggle .chevron {
  transform: rotate(-90deg);
}

.btn-danger-ghost {
  border-color: rgba(239, 68, 68, 0.3);
  color: rgba(248, 113, 113, 0.9);
}

.btn-danger-ghost:hover {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

/* 按钮加载状态 */
.btn-mini.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-mini.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-primary.loading {
  color: transparent;
  pointer-events: none;
}

.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  top: 50%;
  left: 50%;
  margin: -11px 0 0 -11px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  z-index: 2;
}

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

/* ========== 状态卡片 / 预览区 ========== */
.status-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: flex-start;
}

.stage-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  list-style: none;
}

.stage-list li {
  padding: 8px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  transition: all var(--transition-fast);
}

.stage-list li.active {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}

.status-badge {
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

.preview-area {
  flex: 1;
  min-height: 280px;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.3);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
}

.preview-area:has(img) {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

.preview-controls {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 6px 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.preview-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.preview-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.preview-counter {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 60px;
  text-align: center;
}

.preview-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-area p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.preview-area img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all var(--transition-base);
}

.preview-area img:hover {
  transform: scale(1.02);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.status-card>small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ========== 进度条 ========== */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-lg);
}

.progress-container.hidden {
  display: none;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

/* ========== 历史画廊 ========== */
.history-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 140px);
  overflow: hidden;
}

.history-panel:hover {
  transform: none;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  padding-right: 8px;
  padding-bottom: 8px;
}

.history-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  animation: fadeSlideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.history-card:nth-child(1) {
  animation-delay: 0.05s;
}

.history-card:nth-child(2) {
  animation-delay: 0.1s;
}

.history-card:nth-child(3) {
  animation-delay: 0.15s;
}

.history-card:nth-child(4) {
  animation-delay: 0.2s;
}

.history-card:nth-child(5) {
  animation-delay: 0.25s;
}

.history-card:nth-child(6) {
  animation-delay: 0.3s;
}

.history-card:nth-child(n+7) {
  animation-delay: 0.35s;
}

.history-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.8) 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 1;
}

.history-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.15);
}

.history-card:hover::before {
  opacity: 1;
}

.history-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.history-card:hover img {
  transform: scale(1.08);
}

.history-card .meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.9));
  font-size: 0.7rem;
  z-index: 2;
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.history-card:hover .meta {
  transform: translateY(0);
}

.history-card .meta span {
  display: block;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.history-card .meta strong {
  display: block;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.4;
}

.history-card .delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.history-card:hover .delete-btn {
  opacity: 1;
  transform: scale(1);
}

.history-card .delete-btn:hover {
  background: var(--danger-hover);
  transform: scale(1.1);
}

.history-footer {
  display: flex;
  justify-content: center;
  padding-top: 12px;
  flex-shrink: 0;
}

.history-footer.hidden {
  display: none;
}

.load-more-btn {
  padding: 12px 28px;
}

/* 空状态 */
.history-grid>p {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 48px 20px;
  font-size: 0.9rem;
}

/* 滚动条美化 */
.history-grid::-webkit-scrollbar {
  width: 6px;
}

.history-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}

.history-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.history-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}



/* ========== 认证覆盖层 ========== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fadeIn var(--transition-base);
}

.auth-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.auth-card {
  width: min(440px, 100%);
  background: rgba(15, 15, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: slideUp var(--transition-slow);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
}

.auth-tabs button {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-tabs button.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.auth-tabs button:not(.active) {
  background: transparent;
  color: var(--text-muted);
}

.auth-tabs button:not(.active):hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-card .btn-primary {
  width: 100%;
  margin-top: 8px;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
}

.alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.hidden {
  display: none !important;
}

/* ========== Lightbox ========== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-slow);
}

.lightbox-overlay.active .lightbox-container {
  transform: scale(1) translateY(0);
}

.lightbox-close {
  position: absolute;
  top: -48px;
  right: -8px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: rgba(239, 68, 68, 0.5);
  transform: rotate(90deg);
}

#lightboxImage {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  object-fit: contain;
}

.lightbox-info {
  text-align: center;
  max-width: 600px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all var(--transition-base);
}

.lightbox-info.expanded {
  max-height: 300px;
  opacity: 1;
  padding: 18px 22px;
  overflow-y: auto;
}

.lightbox-prompt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.6;
  font-style: italic;
}

.lightbox-meta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lightbox-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.lightbox-btn {
  padding: 10px 18px;
  font-size: 0.85rem;
}

.lightbox-toggle-info {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lightbox-toggle-info:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-primary);
}

.lightbox-toggle-info.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

.lightbox-btn.danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: rgba(248, 113, 113, 0.9);
}

.lightbox-btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.5);
}

.gallery-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gallery-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-hero h1 {
  margin: 0;
  font-size: 1.6rem;
}

.gallery-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.history-panel.full {
  min-height: 60vh;
}

/* ========== Toast 提示 ========== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
  z-index: 300;
  opacity: 0;
  transition: all var(--transition-base);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 10px 40px rgba(239, 68, 68, 0.3);
}

/* ========== 状态指示器 ========== */
.pill[data-status="pending"] {
  animation: pulse 1.5s ease-in-out infinite;
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.pill[data-status="success"] {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.pill[data-status="error"] {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* ========== 响应式设计 ========== */
@media (max-width: 1400px) {
  .content-grid {
    grid-template-columns: 200px 1fr 340px;
  }

  .console-layout {
    grid-template-columns: 1fr 300px;
  }
}

@media (max-width: 1200px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .side-nav {
    position: relative;
    top: 0;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-button {
    flex: 1;
    min-width: 140px;
    text-align: center;
  }

  .console-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .history-panel {
    max-height: none;
  }

  .history-grid {
    max-height: 60vh;
  }
}

@media (max-width: 900px) {
  .glass-app {
    padding: 16px;
    gap: 16px;
  }

  .glass-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    top: 0;
  }

  .nav-meta {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .system-pills {
    justify-content: flex-start;
  }

  .user-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-insights {
    width: 100%;
  }

  .user-indicator {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

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

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

@media (max-width: 600px) {
  .glass-panel {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .glass-nav {
    padding: 14px 16px;
  }

  .brand {
    font-size: 1.15rem;
  }

  .side-nav {
    gap: 8px;
  }

  .nav-button {
    padding: 12px 14px;
    font-size: 0.85rem;
  }

  .console h2 {
    font-size: 1.25rem;
  }

  .btn-primary {
    width: 100%;
    padding: 14px 24px;
  }

  .action-row {
    flex-direction: column;
    gap: 10px;
  }

  .action-row .btn-ghost {
    width: 100%;
  }

  .prompt-group .prompt-area {
    flex-direction: column;
  }

  .prompt-group .btn-mini {
    width: 100%;
  }

  .prompt-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .seed-input-row {
    flex-direction: column;
  }

  .seed-input-row .btn-mini {
    width: 100%;
  }

  .history-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .preview-quick-actions {
    flex-direction: column;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .section-actions {
    width: 100%;
    justify-content: space-between;
  }

  .lightbox-container {
    padding: 12px;
  }

  .lightbox-actions {
    flex-direction: column;
    width: 100%;
  }

  .lightbox-actions button {
    width: 100%;
  }

  .auth-card {
    padding: 24px;
  }

  .toast {
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(100px);
    text-align: center;
  }

  .toast.show {
    transform: translateX(0) translateY(0);
  }
}

/* ========== 滚动到顶部隐藏导航效果（可选） ========== */
@media (min-width: 901px) {
  .glass-nav {
    transition:
      transform var(--transition-base),
      opacity var(--transition-base);
  }
}

/* ========== 焦点可见性（无障碍） ========== */
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ========== 选择高亮 ========== */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: white;
}

/* ========== 新增动画 ========== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  }

  50% {
    box-shadow: 0 4px 25px rgba(99, 102, 241, 0.6);
  }
}

.btn-primary:not(:hover):not(:active) {
  animation: pulse-glow 3s infinite;
}
.admin-body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at 20% 20%, #1a1b3a, #090b16 70%);
  color: #f4f6ff;
}

.admin-app {
  position: relative;
  padding: 32px clamp(16px, 4vw, 48px);
  max-width: 1400px;
  margin: 0 auto;
  z-index: 1;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 24px;
}

.admin-brand strong {
  font-size: 1.4rem;
}

.admin-brand small {
  display: block;
  font-size: 0.85rem;
  opacity: 0.85;
}

.admin-tagline {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #cdd1ff;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user-chip {
  padding: 10px 16px;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-user-chip .chip-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.admin-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.admin-sidebar {
  width: 260px;
  position: sticky;
  top: 120px;
  padding: 18px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-nav-item {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  color: #f8fbff;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.admin-nav-item small {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
}

.admin-nav-item:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.12);
  transform: translateX(4px);
}

.admin-nav-item.active {
  border-color: rgba(99, 102, 241, 0.8);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.15));
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-card {
  min-height: 340px;
  display: flex;
  flex-direction: column;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: flex;
  flex-direction: column;
}

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

.card-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.card-header p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.65);
}

.reveal-toggle {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  gap: 6px;
}

.reveal-toggle input {
  width: 16px;
  height: 16px;
}

.setting-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 520px;
  overflow-y: auto;
}

.setting-item {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.setting-info {
  flex: 1 1 240px;
}

.setting-info h4 {
  margin: 0;
  font-size: 1rem;
}

.setting-info p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.setting-pill {
  display: inline-flex;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.8);
}

.setting-editor {
  flex: 1 1 260px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.setting-editor input,
.setting-editor select,
.setting-editor textarea {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(9, 11, 22, 0.45);
  color: #f6f8ff;
}

.setting-editor textarea {
  min-height: 46px;
  resize: vertical;
}

.setting-editor .setting-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hidden-value {
  font-style: italic;
  color: rgba(255, 255, 255, 0.6);
}

.user-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.user-card-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-card-actions input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
}

.user-form input[type="text"],
.user-form input[type="email"],
.user-form input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.form-flags {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

.user-table-wrapper {
  flex: 1;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.admin-table th {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.admin-table td .tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
}

.user-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-main small {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
}

.tag-success {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.25);
}

.tag-danger {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.3);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-actions button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 0.8rem;
}

.table-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.table-actions button.danger {
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-chip {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.stat-chip span {
  display: block;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.stat-chip strong {
  font-size: 1.3rem;
}

.chart-wrapper {
  margin-bottom: 24px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bar-chart {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 200px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.25);
  overflow-x: auto;
}

.bar {
  flex: 1;
  min-width: 26px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, rgba(120, 167, 255, 0.9), rgba(80, 110, 255, 0.5));
  position: relative;
}

.bar::after {
  content: attr(data-value);
  position: absolute;
  inset: auto 0 -24px 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.model-table-wrapper h3 {
  margin: 0 0 12px;
}

.admin-login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 20, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.admin-login-overlay.hidden {
  display: none;
}

.login-sheet {
  max-width: 420px;
  width: 90%;
  padding: 24px;
  text-align: left;
}

.login-sheet form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-sheet input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.form-message {
  min-height: 24px;
  font-size: 0.9rem;
  color: #ff7272;
}

.btn-accent {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #7c4dff, #5ad7ff);
  color: #0a0c1c;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(90, 215, 255, 0.35);
}

.btn-ghost {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.empty-placeholder {
  text-align: center;
  padding: 24px 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.admin-toast {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(39, 94, 255, 0.12);
  color: #dbeafe;
  transition: opacity 0.2s ease;
}

.admin-toast.hidden {
  opacity: 0;
  pointer-events: none;
  height: 0;
  padding: 0 18px;
  margin: 0;
  border-width: 0;
}

.admin-toast.error {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
}

.admin-toast.success {
  background: rgba(16, 185, 129, 0.18);
  color: #d1fae5;
}

@media (max-width: 960px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    position: relative;
    top: auto;
  }
}
