/* ============================================
   果汁君魔法修图 - 公共样式
   设计风格：玻璃拟态 + 暗紫蓝渐变 + 动态视觉
   ============================================ */

:root {
  /* 色彩系统 */
  --bg-primary: #0a0a1a;
  --bg-secondary: #111125;
  --bg-tertiary: #1a1a35;
  --gradient-1: linear-gradient(135deg, #1a0b2e 0%, #0f1a3d 50%, #0a1628 100%);
  --gradient-2: linear-gradient(135deg, #6c2bd9 0%, #3b82f6 100%);
  --gradient-3: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.3) 0%, transparent 60%);

  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-gold: #f59e0b;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.08);

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
  --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.4);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 背景装饰 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-1);
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
  z-index: -1;
  animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-20px, 20px); }
}

/* 玻璃卡片 */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* 导航栏 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 26, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
}

.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
}

.navbar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transition: var(--transition);
}

.navbar-logo:hover .navbar-logo-icon {
  transform: rotate(-10deg) scale(1.05);
}

.navbar-logo-text {
  background: var(--gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-link {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.navbar-link:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.navbar-link.active {
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.1);
}
.navbar-link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent-purple);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}
.navbar-avatar::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-primary);
}

.navbar-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.navbar-avatar-wrap {
  position: relative;
}

/* 汉堡菜单按钮（移动端显示，桌面隐藏） */
.navbar-hamburger {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.navbar-hamburger:hover { border-color: var(--accent-purple); color: var(--accent-purple); }
.navbar-hamburger svg { width: 18px; height: 18px; }

/* 用户菜单 */
.user-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 1000;
  animation: panelSlideDown 0.25s ease;
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 22px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border-bottom: 1px solid var(--glass-border);
}

.user-menu-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-menu-info {
  flex: 1;
  min-width: 0;
}

.user-menu-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-email {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.user-menu-credits {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
  flex-shrink: 0;
}
.user-menu-credits svg { width: 14px; height: 14px; }

.user-menu-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
}

.user-menu-btn:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-purple);
}

.user-menu-btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.user-menu-btn-danger:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.navbar-credits {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.navbar-credits:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.navbar-credits-wrap {
  position: relative;
}

/* 积分面板 */
.credit-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 360px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 1000;
  animation: panelSlideDown 0.25s ease;
}

@keyframes panelSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.credit-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(236, 72, 153, 0.1));
  border-bottom: 1px solid var(--glass-border);
}

.credit-panel-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.credit-panel-balance {
  font-size: 32px;
  font-weight: 800;
  background: var(--gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.credit-panel-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.credit-panel-close:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.credit-panel-tabs {
  display: flex;
  padding: 0 22px;
  border-bottom: 1px solid var(--glass-border);
}

.credit-tab {
  padding: 12px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  margin-right: 20px;
}

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

.credit-tab.active {
  color: var(--accent-purple);
  border-bottom-color: var(--accent-purple);
}

.credit-panel-body {
  max-height: 340px;
  overflow-y: auto;
}

.credit-tab-content {
  padding: 8px 0;
}

/* 积分历史列表 */
.credit-history-list {
  padding: 4px 0;
}

.credit-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  transition: var(--transition);
}

.credit-history-item:hover {
  background: var(--glass-hover);
}

.credit-history-info {
  flex: 1;
  min-width: 0;
}

.credit-history-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-history-time {
  font-size: 11px;
  color: var(--text-secondary);
}

.credit-history-amount {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 12px;
}

.credit-history-amount.credit-add {
  color: var(--success);
}

.credit-history-amount.credit-reduce {
  color: var(--error);
}

.credit-history-empty {
  padding: 40px 22px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.credit-history-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 22px;
  color: var(--text-secondary);
  font-size: 13px;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 获取积分面板 */
.recharge-info {
  padding: 20px 22px;
  text-align: center;
}

.recharge-info-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.recharge-info-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.recharge-info-desc {
  text-align: left;
  margin-bottom: 20px;
}

.recharge-info-desc p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.6;
}

.recharge-info-desc strong {
  color: var(--accent-gold);
  font-weight: 700;
}

.recharge-contact {
  padding: 16px;
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-2);
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

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

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-hover);
  border-color: var(--accent-purple);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

/* 表单 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.05);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* 状态标签 */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-uploaded { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); }
.status-uploaded::before { background: var(--text-secondary); }

.status-analyzing, .status-generating { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-analyzing::before, .status-generating::before { background: var(--warning); animation: pulse 1.5s infinite; }

.status-completed { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-completed::before { background: var(--success); }

.status-failed { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.status-failed::before { background: var(--error); }

/* 用户/showcase 状态徽章 */
.status-active { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-active::before { background: var(--success); }

.status-inactive { background: rgba(100, 116, 139, 0.15); color: var(--text-secondary); }
.status-inactive::before { background: var(--text-secondary); }

.status-banned { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.status-banned::before { background: var(--error); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Toast 通知 */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.toast {
  padding: 14px 20px 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  cursor: default;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.toast:hover {
  transform: translateX(0) translateY(-2px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* 左侧色条 */
.toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 2px 0 0 2px;
}

/* 图标容器 */
.toast-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-icon-wrap svg { width: 16px; height: 16px; color: #fff !important; }

.toast-message { flex: 1; line-height: 1.4; }

/* 关闭按钮 */
.toast-close {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s, background 0.2s;
}

.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.1); }
.toast-close svg { width: 14px; height: 14px; }

/* 底部进度条 */
.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  width: 100%;
  transform-origin: left;
  animation: toastProgress linear forwards;
  border-radius: 0 0 0 var(--radius-md);
}

/* 各类型样式 */
.toast-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}
.toast-success::before { background: var(--success); }
.toast-success .toast-icon-wrap { background: rgba(16, 185, 129, 0.25); }
.toast-success .toast-progress { background: linear-gradient(90deg, var(--success), rgba(16, 185, 129, 0.3)); }

.toast-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.toast-error::before { background: var(--error); }
.toast-error .toast-icon-wrap { background: rgba(239, 68, 68, 0.25); }
.toast-error .toast-progress { background: linear-gradient(90deg, var(--error), rgba(239, 68, 68, 0.3)); }

.toast-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}
.toast-info::before { background: var(--info); }
.toast-info .toast-icon-wrap { background: rgba(59, 130, 246, 0.25); }
.toast-info .toast-progress { background: linear-gradient(90deg, var(--info), rgba(59, 130, 246, 0.3)); }

@keyframes toastIn {
  from { transform: translateY(-30px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to { transform: translateY(-20px) scale(0.95); opacity: 0; }
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* 加载动画 */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 3px;
}

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

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
  animation: modalIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination button:hover:not(:disabled) {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.pagination button.active {
  background: var(--gradient-2);
  color: white;
  border-color: transparent;
}

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

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-text {
  font-size: 15px;
}

/* 响应式 */
@media (max-width: 768px) {
  .navbar-inner {
    padding: 0 16px;
    height: 56px;
  }
  .navbar-logo-icon { width: 32px; height: 32px; border-radius: 8px; }
  .navbar-logo { gap: 8px; font-size: 17px; }
  .navbar-hamburger { display: flex; }
  .navbar:not(.navbar-guest) .navbar-logo { display: none; }
  .navbar-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
  }
  .navbar-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .navbar-link {
    padding: 10px 12px;
    font-size: 14px;
  }
  .navbar-credits { padding: 4px 10px; font-size: 12px; }
  .user-menu { width: calc(100vw - 32px); }
  .user-menu-header { padding: 16px; }
  .user-menu-avatar { width: 40px; height: 40px; font-size: 16px; }
  .user-menu-items { padding: 12px 14px; gap: 6px; }
  .user-menu-btn { padding: 10px 14px; font-size: 13px; gap: 10px; }
  .user-menu-credits { padding: 5px 10px; font-size: 12px; }
  .btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   全局 SVG 图标样式
   ============================================ */

.emoji-icon {
  width: 1em;
  height: 1em;
  display: inline-flex;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  flex-shrink: 0;
}

/* 积分图标统一金色 */
.credit-icon {
  color: var(--accent-gold);
}

/* 导航/侧栏图标容器 */
.admin-nav-item .icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-nav-item .icon .emoji-icon {
  width: 18px;
  height: 18px;
}

/* 统计卡片图标 */
.stat-card-icon .emoji-icon {
  width: 24px;
  height: 24px;
}

/* 空状态图标 */
.empty-state-icon .emoji-icon,
.empty-state-icon svg {
  width: 48px;
  height: 48px;
}

/* 搜索图标 */
.search-icon .emoji-icon,
.search-icon svg {
  width: 16px;
  height: 16px;
}

/* 输入框图标 */
.input-icon .emoji-icon,
.input-icon svg {
  width: 18px;
  height: 18px;
}

/* 特性卡片图标 */
.feature-icon .emoji-icon,
.feature-icon svg {
  width: 32px;
  height: 32px;
}

/* 按钮内图标 */
.btn .emoji-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

/* 缩略图占位符图标 */
.thumb-placeholder .emoji-icon,
.thumb-placeholder svg {
  width: 32px;
  height: 32px;
}

/* Toast 图标 */
/* 标题行图标 */
.info-card-title .emoji-icon,
h4 .emoji-icon {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: -3px;
}

/* 积分徽章图标 */
.credit-badge .emoji-icon {
  width: 14px;
  height: 14px;
  margin-right: 2px;
  vertical-align: -2px;
}

/* 积分面板相关 */
.navbar-credits .emoji-icon {
  width: 18px;
  height: 18px;
  margin-right: 4px;
}

.recharge-info-icon .emoji-icon {
  width: 28px;
  height: 28px;
}

.recharge-info-desc .emoji-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: -2px;
}

/* === 管理后台公共样式 === */

/* 管理后台布局 */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 240px;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 24px 0;
}

.admin-sidebar-header {
  padding: 0 24px 22px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 16px;
}

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

.admin-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.admin-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.admin-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  margin-top: 2px;
}

.admin-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.admin-nav-item:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.admin-nav-item.active {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  box-shadow: inset 3px 0 0 var(--accent-purple);
}

.admin-nav-item .icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.admin-sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
}

.admin-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.admin-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-role {
  font-size: 11px;
  color: var(--text-secondary);
}

.admin-logout-btn {
  width: 100%;
}

.admin-content {
  margin-left: 240px;
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* 加载状态 */
.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.3);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 46px;
}

.stat-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card-icon .emoji-icon,
.stat-card-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.icon-purple { background: rgba(139, 92, 246, 0.15); }
.icon-blue { background: rgba(59, 130, 246, 0.15); }
.icon-green { background: rgba(16, 185, 129, 0.15); }
.icon-gold { background: rgba(245, 158, 11, 0.15); }
.icon-pink { background: rgba(236, 72, 153, 0.15); }
.icon-cyan { background: rgba(6, 182, 212, 0.15); }

.stat-card-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* 工具栏与搜索 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 420px;
}

.search-box .form-input {
  padding-left: 40px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.6;
  pointer-events: none;
}

.toolbar-info {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 表格 */
.table-card {
  padding: 8px;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

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

.admin-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: var(--transition);
}

.admin-table tbody tr:hover td {
  background: var(--glass-hover);
}

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

/* 用户单元格 */
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.user-cell-name {
  font-weight: 600;
}

.user-cell-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* 文本省略与行操作 */
.text-ellipsis {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

/* 开关 */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: rgba(100, 116, 139, 0.3);
  border-radius: 13px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.toggle-switch.active {
  background: var(--accent-purple);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: var(--transition);
}

.toggle-switch.active::after {
  transform: translateX(22px);
}

.toggle-label {
  font-size: 14px;
  color: var(--text-primary);
}

/* 移动端汉堡按钮栏（桌面端隐藏） */
.admin-mobile-header {
  display: none;
}

/* 遮罩层（桌面端隐藏） */
.admin-overlay {
  display: none;
}

/* === 管理后台移动端适配 ≤768px === */
@media (max-width: 768px) {
  /* 汉堡按钮栏 */
  .admin-mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 90;
    flex-shrink: 0;
  }

  .admin-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0 9px;
  }

  .admin-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--text-primary);
    transition: var(--transition);
  }

  .admin-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .admin-hamburger.open span:nth-child(2) {
    opacity: 0;
  }
  .admin-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .admin-mobile-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
  }

  /* 侧边栏变抽屉 */
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  /* 遮罩层 */
  .admin-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .admin-overlay.active {
    display: block;
    opacity: 1;
  }

  /* 内容区全宽 */
  .admin-layout {
    flex-direction: column;
  }

  .admin-content {
    margin-left: 0;
    padding: 16px;
    flex: 1;
    min-width: 0;
  }

  /* 减小标题 */
  .page-title {
    font-size: 20px;
  }

  .page-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  /* 统计卡片：2列 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 16px 12px;
  }

  .stat-card-value {
    font-size: 24px;
  }

  .stat-card-label {
    font-size: 12px;
  }

  .stat-card-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  /* 工具栏纵向排列 */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-box {
    max-width: none;
  }

  /* 表格紧凑化 */
  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .text-ellipsis {
    max-width: 120px;
  }

  /* 分页换行 */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* 用户单元格缩小 */
  .user-cell-avatar {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  /* 行操作按钮换行 */
  .row-actions {
    flex-wrap: wrap;
  }
}

/* === 管理后台移动端适配 ≤480px === */
@media (max-width: 480px) {
  .admin-content {
    padding: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-title {
    font-size: 18px;
  }

  .stat-card-value {
    font-size: 22px;
  }

  .admin-mobile-title {
    font-size: 15px;
  }

  /* 表格进一步紧凑 */
  .admin-table th,
  .admin-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* 导航栏小屏适配：≤480px 隐藏 logo 文字、收紧间距，防止溢出 */
@media (max-width: 480px) {
  .navbar-inner {
    padding: 0 12px;
  }
  .navbar-logo-text {
    display: none;
  }
  /* 未登录态 navbar 内容少，移动端也显示 logo 文字 */
  .navbar-guest .navbar-logo-text {
    display: inline;
  }
  .navbar-logo {
    gap: 8px;
  }
  .navbar-links {
    gap: 2px;
  }
  .navbar-link {
    padding: 6px 10px;
    font-size: 13px;
  }
  .navbar-user {
    gap: 6px;
  }
}

/* === 全站公告条 === */
.site-notice-bar {
  /* 公告条插在 fixed 导航栏之后（普通文档流顶部），必须下移让出导航高度，否则被导航盖住 */
  margin-top: 68px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.06));
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  padding: 10px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-primary);
  animation: siteNoticeSlide 0.3s ease-out;
}
.site-notice-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 900px;
}
.site-notice-icon {
  font-size: 16px;
  flex-shrink: 0;
}
@keyframes siteNoticeSlide {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
  .site-notice-bar { margin-top: 56px; font-size: 12px; padding: 8px 16px; }
}

/* 站点 Logo 圆角：跟随各容器自身的圆角值（导航栏12px/移动端8px、登录页18px、后台侧边栏12px），媒体查询自动适应 */
/* Logo img 统一填充方式（替代各页面重复的 inline style） */
.navbar-logo-icon img,
.admin-logo-icon img,
.auth-logo img,
.login-logo img {
  border-radius: inherit;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

