/* ============================================================
   Premium UI 主题 - 玻璃拟态深色奢华风 (premium.css)
   统一入口：所有页面 <link rel="stylesheet" href="/static/premium.css">
   用法：
   1. body 会自动获得深色背景 + 紫色/粉色光晕
   2. 卡片加 class="glass" 获得玻璃面板效果
   3. 按钮加 class="btn-grad" 获得渐变按钮效果
   4. 输入框加 class="input-dark" 获得深色输入框效果
   ============================================================ */

:root {
  --p-bg: #0a0a12;
  --p-bg-deeper: #050507;
  --p-glass: rgba(255, 255, 255, 0.04);
  --p-glass-strong: rgba(255, 255, 255, 0.08);
  --p-border: rgba(255, 255, 255, 0.1);
  --p-text: #ffffff;
  --p-text-sub: rgba(255, 255, 255, 0.55);
  --p-text-dim: rgba(255, 255, 255, 0.35);
  --p-purple: #a855f7;
  --p-pink: #ec4899;
  --p-orange: #f59e0b;
  --p-red: #ef4444;
  --p-grad: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --p-grad-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --p-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ============ 全局深色背景 ============ */
body {
  background: var(--p-bg) !important;
  color: var(--p-text) !important;
  background-image:
    radial-gradient(ellipse at top left, rgba(168, 85, 247, 0.15), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(236, 72, 153, 0.1), transparent 50%) !important;
  background-attachment: fixed;
  min-height: 100vh;
}

/* 文字覆盖（防残留浅色主题） */
body, p, span, div, h1, h2, h3, h4, h5, h6, li, td, th, label, small {
  color: inherit;
}

/* ============ 玻璃面板 ============ */
.glass {
  background: var(--p-glass) !important;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--p-border) !important;
  border-radius: 20px !important;
  box-shadow: var(--p-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.glass-strong {
  background: var(--p-glass-strong) !important;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ============ 渐变按钮 ============ */
.btn-grad {
  background: var(--p-grad) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 14px 24px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
  cursor: pointer;
  letter-spacing: 2px;
}
.btn-grad:active { transform: scale(0.98); }
.btn-grad-warm {
  background: var(--p-grad-warm) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 14px !important;
  padding: 14px 24px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s;
  cursor: pointer;
}
.btn-grad-warm:active { transform: scale(0.98); }

/* 覆盖 Bootstrap 按钮 */
.btn-primary, .btn-success, .btn-danger, .btn-info, .btn-warning {
  border: none !important;
  border-radius: 12px !important;
  font-weight: 600;
}
.btn-outline-secondary, .btn-outline-primary, .btn-outline-danger {
  background: rgba(255, 255, 255, 0.04) !important;
  color: var(--p-text-sub) !important;
  border: 1px solid var(--p-border) !important;
  border-radius: 12px !important;
}

/* ============ 深色输入框 ============ */
.input-dark, .form-control, .form-select {
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  color: #fff !important;
  transition: all 0.3s;
  box-shadow: none !important;
}
.input-dark::placeholder, .form-control::placeholder {
  color: var(--p-text-dim) !important;
}
.input-dark:focus, .form-control:focus, .form-select:focus {
  border-color: var(--p-purple) !important;
  background: rgba(168, 85, 247, 0.06) !important;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.12) !important;
  color: #fff !important;
}
.form-select { background-color: #14141f !important; }
.form-select option { background: #14141f !important; color: #fff !important; }
.form-label { color: var(--p-text-sub) !important; }

/* ============ 顶部导航条 ============ */
.topbar-premium {
  height: 50px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.topbar-premium h1 { font-size: 15px; font-weight: 600; color: #000; }
.topbar-premium .url { font-size: 11px; color: #888; margin-top: 1px; letter-spacing: 0.5px; }

/* ============ Hero 渐变大卡片 ============ */
.hero-card {
  background: var(--p-grad-warm);
  border-radius: 24px;
  padding: 28px 24px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  color: #fff !important;
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.2);
}
.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.15), transparent 60%);
  pointer-events: none;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 12px;
}
.hero-tag .dot {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px #fff;
}
.hero-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #fff !important;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.hero-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}

/* ============ 徽章 ============ */
.badge-premium {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 20px !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--p-text-sub) !important;
}

/* ============ 大标题 ============ */
.title-grad {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 6px;
  background: linear-gradient(180deg, #fff 0%, #ccc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ 搜索框 ============ */
.search-premium {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 18px !important;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.search-premium input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
}
.search-premium input::placeholder { color: var(--p-text-dim); }

/* ============ 分类标签 ============ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.cat-item {
  background: rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 14px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--p-text) !important;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: block;
}
.cat-item.active {
  background: var(--p-bg-deeper) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.cat-item:active { transform: scale(0.95); }

/* ============ 商品卡片 ============ */
.product-card-p {
  background: rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 18px !important;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  color: var(--p-text) !important;
  transition: transform 0.2s;
}
.product-card-p:active { transform: scale(0.99); }
.product-card-p img {
  width: 76px; height: 76px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.product-card-p .p-name-p {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--p-text) !important;
}
.price-p {
  font-size: 20px;
  font-weight: 800;
  color: #ef4444 !important;
}
.price-p::before { content: '¥'; font-size: 14px; margin-right: 2px; }

/* ============ 底部导航 ============ */
.bottom-nav-p {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(10, 10, 18, 0.85) !important;
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  padding: 8px 0 12px;
  z-index: 1000;
  max-width: 600px;
  margin: 0 auto;
}
.nav-item-p {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  cursor: pointer;
  color: var(--p-text-dim) !important;
  font-size: 11px;
  text-decoration: none;
  transition: color 0.3s;
}
.nav-item-p .icon { font-size: 22px; line-height: 1; }
.nav-item-p.active { color: var(--p-orange) !important; font-weight: 600; }

/* ============ 表格/列表覆盖 ============ */
.table { color: var(--p-text) !important; --bs-table-bg: transparent; }
.table thead th { color: var(--p-text-sub) !important; border-color: rgba(255,255,255,0.08) !important; }
.table td, .table th { border-color: rgba(255,255,255,0.08) !important; }
.table-hover tbody tr:hover { color: #fff !important; background: rgba(255,255,255,0.04) !important; }

.card {
  background: var(--p-glass) !important;
  backdrop-filter: blur(20px);
  border: 1px solid var(--p-border) !important;
  border-radius: 18px !important;
  color: var(--p-text) !important;
}
.card .card-header, .card-header { background: rgba(255,255,255,0.03) !important; color: var(--p-text) !important; border-color: rgba(255,255,255,0.08) !important; }
.card .card-body { color: var(--p-text) !important; }

/* 状态徽章 */
.badge { font-weight: 600; }
.bg-light, .bg-white { background-color: rgba(255,255,255,0.06) !important; color: var(--p-text) !important; }

/* Alert 覆盖 */
.alert {
  background: var(--p-glass-strong) !important;
  border: 1px solid var(--p-border) !important;
  color: var(--p-text) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(20px);
}
.alert-primary { border-color: rgba(168,85,247,0.4) !important; }
.alert-danger { border-color: rgba(239,68,68,0.4) !important; }
.alert-success { border-color: rgba(34,197,94,0.4) !important; }
.alert-warning { border-color: rgba(245,158,11,0.4) !important; }
.alert small, .alert .text-muted, .text-muted { color: var(--p-text-sub) !important; }
.alert-danger strong { color: #fca5a5 !important; }

/* 链接 */
a { color: #c4b5fd; }
a.text-secondary, a.text-muted { color: var(--p-text-sub) !important; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 页面切换动画 ============ */
.fade-in { animation: pFadeIn 0.4s ease; }
@keyframes pFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
